diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index d034af26501e..2c59a1d6c365 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -37,7 +37,7 @@ com.azure:azure-data-sdk-parent;1.3.0;1.3.0 com.azure:azure-sdk-parent;1.6.0;1.6.0 com.azure:azure-client-sdk-parent;1.7.0;1.7.0 com.azure:azure-ai-agents-persistent;1.0.0-beta.2;1.0.0-beta.3 -com.azure:azure-ai-agents;2.0.1;2.1.0-beta.2 +com.azure:azure-ai-agents;2.0.1;2.1.0 com.azure:azure-ai-anomalydetector;3.0.0-beta.5;3.0.0-beta.6 com.azure:azure-ai-contentsafety;1.0.18;1.1.0-beta.1 com.azure:azure-ai-contentunderstanding;1.0.0;1.1.0-beta.2 @@ -53,7 +53,7 @@ com.azure:azure-ai-openai-assistants;1.0.0-beta.5;1.0.0-beta.6 com.azure:azure-ai-openai-realtime;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-openai-stainless;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-personalizer;1.0.0-beta.1;1.0.0-beta.2 -com.azure:azure-ai-projects;2.0.1;2.1.0-beta.2 +com.azure:azure-ai-projects;2.0.1;2.1.0 com.azure:azure-ai-speech-transcription;1.0.0;1.1.0-beta.1 com.azure:azure-ai-textanalytics;5.5.13;5.6.0-beta.1 com.azure:azure-ai-textanalytics-perf;1.0.0-beta.1;1.0.0-beta.1 diff --git a/sdk/ai/azure-ai-agents/CHANGELOG.md b/sdk/ai/azure-ai-agents/CHANGELOG.md index 527ff8a8e270..aea5bbf3c9c8 100644 --- a/sdk/ai/azure-ai-agents/CHANGELOG.md +++ b/sdk/ai/azure-ai-agents/CHANGELOG.md @@ -1,21 +1,38 @@ # Release History -## 2.1.0-beta.2 (Unreleased) +## 2.1.0 (2026-05-29) ### Features Added - Added protocol-style methods on `ResponsesClient` and `ResponsesAsyncClient` that accept a raw JSON request body (`BinaryData`) and a `com.openai.core.RequestOptions`, and return the openai-java raw HTTP response. These mirror the existing `createAzureResponse` and `createStreamingAzureResponse` typed surface: `createResponseWithResponse` (returns `HttpResponseFor`) and `createResponseStreamWithResponse` (returns `HttpResponseFor>`). They delegate to the underlying openai-java `ResponseService.withRawResponse()` surface and continue to flow through the Azure HTTP pipeline. - -### Other Changes - -- Enabled `ResponsesTests` and `ResponsesAsyncTests` (previously `@Disabled`) with create/retrieve/delete/input-items and background-cancel coverage for the typed (`ResponseService` / `ResponseServiceAsync`) surface, plus coverage for the new protocol-method surface. Recordings published to `Azure/azure-sdk-assets` and referenced from `assets.json`. +- Added preview support for external agents via `ExternalAgentDefinition`, `AgentKind.EXTERNAL`, and `AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW`. +- Added preview code-based hosted agent operations on `AgentsClient` and `AgentsAsyncClient`, including `createAgentVersionFromCode`, `updateAgentFromCode`, and `downloadAgentCode`, plus related code package models such as `CreateAgentVersionFromCodeContent`, `CodeFileDetails`, and `CodeDependencyResolution`. `CodeConfiguration` now exposes the service-computed code package hash via `getContentSha256()`. +- Added preview agent optimization job and candidate management operations on `AgentsClient` and `AgentsAsyncClient`, including creating, listing, retrieving, canceling, and deleting optimization jobs, listing and inspecting candidates, downloading candidate files, and promoting candidates. +- Added `stopSession` and `stopSessionWithResponse` to stop hosted-agent sessions. +- Added `force` query parameter support for hosted-agent `deleteAgentWithResponse` and `deleteAgentVersionWithResponse` requests through `RequestOptions`, allowing active sessions to be cascade-deleted. +- Added individual memory item operations to `MemoryStoresClient` and `MemoryStoresAsyncClient`: `createMemory`, `updateMemory`, `listMemories`, `getMemory`, and `deleteMemory`, with new `ListMemoriesOptions`, `DeleteMemoryResponse`, and `MemoryItemKind.PROCEDURAL` support. +- Added new preview tools `FabricIqPreviewTool` and `ToolboxSearchPreviewTool`, plus related tool call/output models for Azure tools. +- Added optional per-tool configuration via `ToolConfig` and `toolConfigs` accessors on supported tool classes. +- Added `getComparisonFilter()` and `getCompoundFilter()` convenience getters on `FileSearchTool` for retrieving OpenAI filter types. +- Added new feature-flag values, including `AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW`, `AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW`, and `FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V1_PREVIEW`. +- Added hosted-agent, Fabric IQ, Toolbox Search, and async toolbox samples. ### Breaking Changes -### Bugs Fixed +- `AgentEndpoint` renamed to `AgentEndpointConfig`. +- Session file listing methods on `AgentSessionFilesClient` and `AgentSessionFilesAsyncClient` were renamed from `getSessionFiles` to `listSessionFiles` and now return paged `SessionDirectoryEntry` results. `SessionDirectoryListResponse` was removed. +- Hosted-agent session methods no longer take a required `isolationKey` argument. Use overloads that accept the optional `userIsolationKey` value, or set the `x-ms-user-isolation-key` header through `RequestOptions`. +- `AgentDefinitionOptInKeys.CONTAINER_AGENTS_V1_PREVIEW` was removed. Use the applicable hosted-agent, code-agent, agent-endpoint, workflow-agent, or external-agent opt-in key instead. +- `HostedAgentDefinition` no longer exposes top-level `image` or `containerProtocolVersions` accessors. Use `ContainerConfiguration` for container images and `protocolVersions` for ingress protocol configuration. +- `CodeConfiguration` constructor now requires `CodeDependencyResolution` in addition to runtime and entry point. +- `WorkIqPreviewTool` now takes the Work IQ project connection ID directly. `WorkIQPreviewToolParameters` was removed. ### Other Changes +- Enabled `ResponsesTests` and `ResponsesAsyncTests` (previously `@Disabled`) with create/retrieve/delete/input-items and background-cancel coverage for the typed (`ResponseService` / `ResponseServiceAsync`) surface, plus coverage for the new protocol-method surface. Recordings published to `Azure/azure-sdk-assets` and referenced from `assets.json`. +- Re-enabled `SessionLogSyncTest` and `SessionLogAsyncTest`; both tests are recordable via `@RecordWithoutRequestBody` and run live against the configured Foundry project. +- Regenerated client from the updated TypeSpec specification. + ## 2.1.0-beta.1 (2026-05-12) ### Features Added @@ -23,7 +40,7 @@ - Added new `ToolboxesClient` and `ToolboxesAsyncClient` sub-clients (preview, opt-in via `FoundryFeaturesOptInKeys.TOOLBOXES_V1_PREVIEW`) for managing toolboxes and toolbox versions, with operations including `createToolboxVersion`, `getToolbox`, `getToolboxVersion`, `listToolboxes`, `listToolboxVersions`, `updateToolbox`, `deleteToolbox`, and `deleteToolboxVersion`. New `buildToolboxesClient()` and `buildToolboxesAsyncClient()` methods on `AgentsClientBuilder`. - Added new `AgentSessionFilesClient` and `AgentSessionFilesAsyncClient` sub-clients for working with files in an agent session, with `uploadSessionFile`, `downloadSessionFile`, `getSessionFiles`, and `deleteSessionFile`. New `buildAgentSessionFilesClient()` and `buildAgentSessionFilesAsyncClient()` methods on `AgentsClientBuilder`. - Added `buildAgentScopedOpenAIClient(String agentName)` and `buildAgentScopedOpenAIAsyncClient(String agentName)` to `AgentsClientBuilder` for constructing OpenAI clients targeting a specific agent's endpoint (base URL `{endpoint}/agents/{agentName}/endpoint/protocols/openai`). The default `buildOpenAIClient()` / `buildOpenAIAsyncClient()` continue to target `{endpoint}/openai/v1`. -- Added agent-session operations to `AgentsClient` and `AgentsAsyncClient`: `createSession`, `getSession`, `deleteSession`, `listSessions`, and `getSessionLogStreamWithResponse`. Added typed session log streaming convenience methods: `AgentsClient.getSessionLogStream(...)`, and `AgentsAsyncClient.getSessionLogStream(...)`, returning `SessionLogEvent`. New related models: `AgentSessionResource`, `AgentSessionStatus`, `SessionDirectoryEntry`, `SessionDirectoryListResponse`, `SessionFileWriteResponse`, `SessionLogEvent`, `SessionLogEventType`, `IsolationKeySource` (with `Kind`), `EntraIsolationKeySource`, and `HeaderIsolationKeySource`. +- Added agent-session operations to `AgentsClient` and `AgentsAsyncClient`: `createSession`, `getSession`, `deleteSession`, `listSessions`, and `getSessionLogStreamWithResponse`. Added typed session log streaming convenience methods: `AgentsClient.getSessionLogStream(...)`, and `AgentsAsyncClient.getSessionLogStream(...)`, returning `SessionLogEvent`. New related models: `AgentSessionResource`, `AgentSessionStatus`, `SessionDirectoryEntry`, `SessionDirectoryListResponse`, `SessionFileWriteResult`, `SessionLogEvent`, `SessionLogEventType`, `IsolationKeySource` (with `Kind`), `EntraIsolationKeySource`, and `HeaderIsolationKeySource`. - Added `updateAgentDetails(String, UpdateAgentDetailsPatchRequest, ...)` and `updateAgentDetailsWithResponse` on `AgentsClient`/`AgentsAsyncClient` for patching agent details, plus new `UpdateAgentDetailsPatchRequest` model. - Added new agent-endpoint and identity model types for hosted agents: `AgentEndpoint`, `AgentEndpointProtocol`, `AgentEndpointAuthorizationScheme` (with `Type`), `EntraAuthorizationScheme`, `BotServiceAuthorizationScheme`, `BotServiceRbacAuthorizationScheme`, `AgentIdentity`, `AgentBlueprintReference` (with `Type`), `ManagedAgentIdentityBlueprintReference`, `AgentCard`, and `AgentCardSkill`. `AgentDetails` now exposes `getAgentEndpoint`, `getInstanceIdentity`, `getBlueprint`, `getBlueprintReference`, and `getAgentCard`. `AgentVersionDetails` now exposes `getInstanceIdentity`, `getBlueprint`, `getBlueprintReference`, and `getAgentGuid`. - Added agent-versioning model types: `VersionIndicator` (with `Type`), `VersionRefIndicator`, `VersionSelector` (with `Type`), `VersionSelectionRule`, `FixedRatioVersionSelectionRule`, and `CreateAgentVersionInput`. diff --git a/sdk/ai/azure-ai-agents/README.md b/sdk/ai/azure-ai-agents/README.md index a52231658900..0256f53b7e82 100644 --- a/sdk/ai/azure-ai-agents/README.md +++ b/sdk/ai/azure-ai-agents/README.md @@ -25,7 +25,7 @@ Various documentation is available to help you get started com.azure azure-ai-agents - 2.1.0-beta.1 + 2.1.0 ``` [//]: # ({x-version-update-end}) @@ -57,9 +57,9 @@ AgentsAsyncClient agentsAsyncClient = new AgentsClientBuilder() ``` The Agents client library has the following sub-clients which group the different operations that can be performed: -- `AgentsClient` / `AgentsAsyncClient`: Perform operations related to agents, such as creating, retrieving, updating, and deleting agents. Also includes agent-session operations (`createSession`, `getSession`, `deleteSession`, `listSessions`, `getSessionLogStream`, `getSessionLogStreamWithResponse`). +- `AgentsClient` / `AgentsAsyncClient`: Perform operations related to agents, such as creating, retrieving, updating, and deleting agents. Also includes hosted-agent sessions, code package operations and preview agent optimization operations. - `ResponsesClient` / `ResponsesAsyncClient`: Handle responses operations. See the [OpenAI's Responses API documentation][openai_responses_api_docs] for more information. -- `MemoryStoresClient` / `MemoryStoresAsyncClient` **(preview)**: Manage memory stores for agents. This operation group requires the `MemoryStores=V1Preview` feature opt-in flag and is automatically set by the SDK on every request. +- `MemoryStoresClient` / `MemoryStoresAsyncClient` **(preview)**: Manage memory stores and individual memory items for agents. This operation group requires the `MemoryStores=V1Preview` feature opt-in flag and is automatically set by the SDK on every request. - `ToolboxesClient` / `ToolboxesAsyncClient` **(preview)**: Manage toolboxes and toolbox versions. This operation group requires the `Toolboxes=V1Preview` feature opt-in flag and is automatically set by the SDK on every request. - `AgentSessionFilesClient` / `AgentSessionFilesAsyncClient` **(preview)**: Work with files in an agent session, including uploading, downloading, listing, and deleting session files. @@ -121,21 +121,25 @@ The SDK supports a variety of tools that can be attached to agent definitions. S | `BingCustomSearchPreviewTool` | Bing custom search | | `BrowserAutomationPreviewTool` | Browser automation | | `ComputerUsePreviewTool` | Computer use | +| `FabricIqPreviewTool` | Fabric IQ | | `McpTool` | Model Context Protocol (MCP) | | `MemorySearchPreviewTool` | Memory search | | `MicrosoftFabricPreviewTool` | Microsoft Fabric | | `SharepointPreviewTool` | SharePoint grounding | +| `ToolboxSearchPreviewTool` | Toolbox search | | `WebSearchPreviewTool` | Web search | | `WorkIqPreviewTool` | Work IQ | +Supported tool classes may also expose optional `name`, `description`, and `toolConfigs` properties for user-defined labels and per-tool configuration. + ### Experimental features and opt-in flags Some features require an opt-in via the `Foundry-Features` HTTP header. The SDK provides two enums for these flags: -- **`AgentDefinitionOptInKeys`** — Used when creating or updating agents. Passed as a parameter to `createAgent`, `updateAgent`, `createAgentVersion`, and related methods. Available keys: `HOSTED_AGENTS_V1_PREVIEW`, `WORKFLOW_AGENTS_V1_PREVIEW`, `CONTAINER_AGENTS_V1_PREVIEW`, `AGENT_ENDPOINT_V1_PREVIEW`. -- **`FoundryFeaturesOptInKeys`** — Defines all known opt-in keys, including: `EVALUATIONS_V1_PREVIEW`, `SCHEDULES_V1_PREVIEW`, `RED_TEAMS_V1_PREVIEW`, `INSIGHTS_V1_PREVIEW`, `MEMORY_STORES_V1_PREVIEW`, `TOOLBOXES_V1_PREVIEW`, `SKILLS_V1_PREVIEW`. +- **`AgentDefinitionOptInKeys`** — Used when creating or updating agents. Passed as a parameter to `createAgent`, `updateAgent`, `createAgentVersion`, and related methods. Available keys: `HOSTED_AGENTS_V1_PREVIEW`, `WORKFLOW_AGENTS_V1_PREVIEW`, `AGENT_ENDPOINT_V1_PREVIEW`, `CODE_AGENTS_V1_PREVIEW`, `EXTERNAL_AGENTS_V1_PREVIEW`. +- **`FoundryFeaturesOptInKeys`** — Defines all known opt-in keys, including: `EVALUATIONS_V1_PREVIEW`, `SCHEDULES_V1_PREVIEW`, `RED_TEAMS_V1_PREVIEW`, `INSIGHTS_V1_PREVIEW`, `MEMORY_STORES_V1_PREVIEW`, `ROUTINES_V1_PREVIEW`, `TOOLBOXES_V1_PREVIEW`, `SKILLS_V1_PREVIEW`, `DATA_GENERATION_JOBS_V1_PREVIEW`, `MODELS_V1_PREVIEW`, `AGENTS_OPTIMIZATION_V1_PREVIEW`. -> **Note:** The `MemoryStoresClient` automatically sets the `MemoryStores=V1Preview` opt-in flag on every request. The `ToolboxesClient` automatically sets the `Toolboxes=V1Preview` opt-in flag on every request. +> **Note:** The `MemoryStoresClient` automatically sets the `MemoryStores=V1Preview` opt-in flag on every request. The `ToolboxesClient` automatically sets the `Toolboxes=V1Preview` opt-in flag on every request. Agent optimization methods accept `FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V1_PREVIEW`; code-based hosted agents and external agents use the corresponding `AgentDefinitionOptInKeys` values. ```java // OpenAI SDK ResponseService accessed from ResponsesClient @@ -147,6 +151,23 @@ OpenAIClient openAIClient = builder.buildOpenAIClient(); ConversationService conversationService = openAIClient.conversations(); ``` +### Preview hosted-agent capabilities + +Hosted-agent previews are exposed on `AgentsClient` and `AgentsAsyncClient`. The following capabilities require the corresponding opt-in flag when you create or modify preview resources: + +| Capability | APIs and models | Opt-in flag | +|---|---|---| +| Code-based hosted agents | `createAgentVersionFromCode`, `updateAgentFromCode`, `downloadAgentCode`, `CodeConfiguration`, `CodeDependencyResolution` | `AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW` | +| External agents | `ExternalAgentDefinition`, `AgentKind.EXTERNAL` | `AgentDefinitionOptInKeys.EXTERNAL_AGENTS_V1_PREVIEW` | +| Agent endpoints and sessions | `AgentEndpointConfig`, `createSession`, `listSessions`, `stopSession`, `AgentSessionFilesClient` | `AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW` | +| Agent optimization | `createOptimizationJob`, `listOptimizationJobs`, `listOptimizationCandidates`, `promoteOptimizationCandidate` | `FoundryFeaturesOptInKeys.AGENTS_OPTIMIZATION_V1_PREVIEW` | + +For code-based hosted agents, `CodeConfiguration.getContentSha256()` returns the service-computed SHA-256 hash of the uploaded code package. Session APIs that need per-user isolation can use overloads that accept `userIsolationKey`, or set the `x-ms-user-isolation-key` header through `RequestOptions`. To delete hosted agents or agent versions that still have active sessions, add the `force=true` query parameter through `RequestOptions` when calling the corresponding `deleteAgentWithResponse` or `deleteAgentVersionWithResponse` method. + +### Memory item management + +`MemoryStoresClient` and `MemoryStoresAsyncClient` manage memory stores and individual memory items. In addition to store-level operations, use `createMemory`, `updateMemory`, `listMemories`, `getMemory`, and `deleteMemory` to manage individual memories. `ListMemoriesOptions` supports filtering by scope and `MemoryItemKind`, including `MemoryItemKind.PROCEDURAL`. + ### Using OpenAI's official library If you prefer using the [OpenAI official Java client library][openai_java_sdk] instead, you can do so by including that dependency in your project instead and following the instructions in the linked repository. Additionally, you will have to set up your `OpenAIClient` as shown below: @@ -492,6 +513,24 @@ See the full sample in [FabricSync.java](https://github.com/Azure/azure-sdk-for- --- +##### **Fabric IQ (Preview)** + +Connect agents to Fabric IQ project connections for enterprise data grounding: + +```java com.azure.ai.agents.define_fabric_iq + +FabricIqPreviewTool fabricIqTool = new FabricIqPreviewTool(fabricIqConnectionId) + .setServerLabel("fabric_iq") + .setRequireApproval("never") + .setName("fabric_iq_lookup") + .setDescription("Use FabricIQ to answer questions grounded in enterprise data."); + +``` + +See the full sample in [FabricIQSync.java](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQSync.java). + +--- + ##### **Microsoft SharePoint (Preview)** ([documentation](https://learn.microsoft.com/azure/foundry/agents/how-to/tools/sharepoint?pivots=java)) Search through SharePoint documents for grounding: @@ -576,6 +615,40 @@ See the full sample in [OpenApiWithConnectionSync.java](https://github.com/Azure --- +#### Toolbox Tools + +Toolbox tools are defined in toolbox versions and managed through `ToolboxesClient` / `ToolboxesAsyncClient`. + +##### **Toolbox Search (Preview)** + +Use `ToolboxSearchPreviewTool` inside a toolbox version to let an agent search the available toolbox tools at runtime: + +```java com.azure.ai.agents.toolboxes.ToolboxSearchToolboxSample.createToolboxSearchToolbox + +ToolboxSearchPreviewTool toolboxSearchTool = new ToolboxSearchPreviewTool() + .setName("search_tools") + .setDescription("Search over available toolbox tools at runtime."); + +ToolboxVersionDetails version = toolboxesClient.createToolboxVersion( + toolboxName, + Collections.singletonList(toolboxSearchTool), + "Toolbox version with a Toolbox Search preview tool.", + null, + null, + null); + +System.out.printf("Created toolbox: %s%n", version.getName()); +System.out.printf("Toolbox version: %s%n", version.getVersion()); +for (Tool tool : version.getTools()) { + System.out.printf("Tool type: %s%n", tool.getType()); +} + +``` + +See the full sample in [ToolboxSearchToolboxSample.java](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxSearchToolboxSample.java). + +--- + ### Streaming responses The `ResponsesClient` and `ResponsesAsyncClient` support streaming, which allows you to process response events as they arrive rather than waiting for the full response. This is useful for displaying text to users in real time and observing tool execution progress. diff --git a/sdk/ai/azure-ai-agents/assets.json b/sdk/ai/azure-ai-agents/assets.json index 67067ff3bcf7..75c7a7d49847 100644 --- a/sdk/ai/azure-ai-agents/assets.json +++ b/sdk/ai/azure-ai-agents/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/ai/azure-ai-agents", - "Tag": "java/ai/azure-ai-agents_a3142fe843" + "Tag": "java/ai/azure-ai-agents_9343deca93" } diff --git a/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml b/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml index e57cc1bfca27..fa252792d711 100644 --- a/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml +++ b/sdk/ai/azure-ai-agents/checkstyle-suppressions.xml @@ -28,6 +28,8 @@ + + diff --git a/sdk/ai/azure-ai-agents/cspell.yaml b/sdk/ai/azure-ai-agents/cspell.yaml index d8163c7781be..b10fb66c7d71 100644 --- a/sdk/ai/azure-ai-agents/cspell.yaml +++ b/sdk/ai/azure-ai-agents/cspell.yaml @@ -3,4 +3,5 @@ import: overrides: - filename: "**/sdk/ai/azure-ai-agents/*" words: - - gitmcp \ No newline at end of file + - dedup + - gitmcp diff --git a/sdk/ai/azure-ai-agents/pom.xml b/sdk/ai/azure-ai-agents/pom.xml index 2bd5bc6b788d..20334354d0bd 100644 --- a/sdk/ai/azure-ai-agents/pom.xml +++ b/sdk/ai/azure-ai-agents/pom.xml @@ -14,7 +14,7 @@ com.azure azure-ai-agents - 2.1.0-beta.2 + 2.1.0 jar Microsoft Azure SDK for Agents diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesAsyncClient.java index 12cf73456690..c267b05edaa1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesAsyncClient.java @@ -5,8 +5,9 @@ import com.azure.ai.agents.implementation.AgentSessionFilesImpl; import com.azure.ai.agents.models.AgentDefinitionOptInKeys; -import com.azure.ai.agents.models.SessionDirectoryListResponse; -import com.azure.ai.agents.models.SessionFileWriteResponse; +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.agents.models.SessionDirectoryEntry; +import com.azure.ai.agents.models.SessionFileWriteResult; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -16,10 +17,15 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; 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.FluxUtil; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -50,7 +56,10 @@ public final class AgentSessionFilesAsyncClient { * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -73,7 +82,7 @@ public final class AgentSessionFilesAsyncClient { * * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The destination file path within the sandbox, relative to the session home directory. * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -86,9 +95,9 @@ public final class AgentSessionFilesAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadSessionFileWithResponse(String agentName, String sessionId, String path, - BinaryData content, RequestOptions requestOptions) { - return this.serviceClient.uploadSessionFileWithResponseAsync(agentName, sessionId, path, content, + public Mono> uploadSessionFileWithResponse(String agentName, String agentSessionId, + String path, BinaryData content, RequestOptions requestOptions) { + return this.serviceClient.uploadSessionFileWithResponseAsync(agentName, agentSessionId, path, content, requestOptions); } @@ -100,7 +109,10 @@ public Mono> uploadSessionFileWithResponse(String agentName * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -112,7 +124,7 @@ public Mono> uploadSessionFileWithResponse(String agentName * * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file path to download from the sandbox, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -123,9 +135,9 @@ public Mono> uploadSessionFileWithResponse(String agentName */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadSessionFileWithResponse(String agentName, String sessionId, String path, - RequestOptions requestOptions) { - return this.serviceClient.downloadSessionFileWithResponseAsync(agentName, sessionId, path, requestOptions); + public Mono> downloadSessionFileWithResponse(String agentName, String agentSessionId, + String path, RequestOptions requestOptions) { + return this.serviceClient.downloadSessionFileWithResponseAsync(agentName, agentSessionId, path, requestOptions); } /** @@ -135,8 +147,8 @@ public Mono> downloadSessionFileWithResponse(String agentNa * * * - * + * *
Query Parameters
NameTypeRequiredDescription
recursiveBooleanNoWhether to recursively delete directory contents. Defaults - * to false.
recursiveBooleanNoWhether to recursively delete directory contents. The + * service defaults to `false` if a value is not specified by the caller.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

@@ -145,12 +157,15 @@ public Mono> downloadSessionFileWithResponse(String agentNa * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file or directory path to delete, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -161,9 +176,9 @@ public Mono> downloadSessionFileWithResponse(String agentNa */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSessionFileWithResponse(String agentName, String sessionId, String path, + public Mono> deleteSessionFileWithResponse(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { - return this.serviceClient.deleteSessionFileWithResponseAsync(agentName, sessionId, path, requestOptions); + return this.serviceClient.deleteSessionFileWithResponseAsync(agentName, agentSessionId, path, requestOptions); } /** @@ -171,11 +186,9 @@ public Mono> deleteSessionFileWithResponse(String agentName, Stri * Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large. * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The destination file path within the sandbox, relative to the session home directory. * @param content The content parameter. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. * @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. @@ -186,126 +199,130 @@ public Mono> deleteSessionFileWithResponse(String agentName, Stri */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadSessionFile(String agentName, String sessionId, String path, - BinaryData content, AgentDefinitionOptInKeys foundryFeatures) { + public Mono uploadSessionFile(String agentName, String agentSessionId, String path, + BinaryData content) { // Generated convenience method for uploadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return uploadSessionFileWithResponse(agentName, sessionId, path, content, requestOptions) + return uploadSessionFileWithResponse(agentName, agentSessionId, path, content, requestOptions) .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SessionFileWriteResponse.class)); + .map(protocolMethodData -> protocolMethodData.toObject(SessionFileWriteResult.class)); } /** - * Upload a file to the session sandbox via binary stream. - * Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large. + * Download a file from the session sandbox as a binary stream. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The destination file path within the sandbox, relative to the session home directory. - * @param content The content parameter. + * @param agentSessionId The session ID. + * @param path The file path to download from the sandbox, relative to the session home directory. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from uploading a file to a session sandbox on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono uploadSessionFile(String agentName, String sessionId, String path, - BinaryData content) { - // Generated convenience method for uploadSessionFileWithResponse + public Mono downloadSessionFile(String agentName, String agentSessionId, String path) { + // Generated convenience method for downloadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - return uploadSessionFileWithResponse(agentName, sessionId, path, content, requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SessionFileWriteResponse.class)); + return downloadSessionFileWithResponse(agentName, agentSessionId, path, requestOptions) + .flatMap(FluxUtil::toMono); } /** - * Download a file from the session sandbox as a binary stream. + * Delete a file or directory from the session sandbox. + * If `recursive` is false (default) and the target is a non-empty directory, the API returns 409 Conflict. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The file path to download from the sandbox, relative to the session home directory. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. + * @param agentSessionId The session ID. + * @param path The file or directory path to delete, relative to the session home directory. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadSessionFile(String agentName, String sessionId, String path, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for downloadSessionFileWithResponse + public Mono deleteSessionFile(String agentName, String agentSessionId, String path) { + // Generated convenience method for deleteSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return downloadSessionFileWithResponse(agentName, sessionId, path, requestOptions).flatMap(FluxUtil::toMono); + return deleteSessionFileWithResponse(agentName, agentSessionId, path, requestOptions).flatMap(FluxUtil::toMono); } /** - * Download a file from the session sandbox as a binary stream. + * Upload a file to the session sandbox via binary stream. + * Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The file path to download from the sandbox, relative to the session home directory. + * @param agentSessionId The session ID. + * @param path The destination file path within the sandbox, relative to the session home directory. + * @param content The content parameter. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return response from uploading a file to a session sandbox on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadSessionFile(String agentName, String sessionId, String path) { - // Generated convenience method for downloadSessionFileWithResponse + public Mono uploadSessionFile(String agentName, String agentSessionId, String path, + BinaryData content, AgentDefinitionOptInKeys foundryFeatures, String userIsolationKey) { + // Generated convenience method for uploadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - return downloadSessionFileWithResponse(agentName, sessionId, path, requestOptions).flatMap(FluxUtil::toMono); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return uploadSessionFileWithResponse(agentName, agentSessionId, path, content, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SessionFileWriteResult.class)); } /** - * Delete a file or directory from the session sandbox. - * If `recursive` is false (default) and the target is a non-empty directory, the API returns 409 Conflict. + * Download a file from the session sandbox as a binary stream. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The file or directory path to delete, relative to the session home directory. + * @param agentSessionId The session ID. + * @param path The file path to download from the sandbox, relative to the session home directory. * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted * preview resources. - * @param recursive Whether to recursively delete directory contents. Defaults to false. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSessionFile(String agentName, String sessionId, String path, - AgentDefinitionOptInKeys foundryFeatures, Boolean recursive) { - // Generated convenience method for deleteSessionFileWithResponse + public Mono downloadSessionFile(String agentName, String agentSessionId, String path, + AgentDefinitionOptInKeys foundryFeatures, String userIsolationKey) { + // Generated convenience method for downloadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); if (foundryFeatures != null) { requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); } - if (recursive != null) { - requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); } - return deleteSessionFileWithResponse(agentName, sessionId, path, requestOptions).flatMap(FluxUtil::toMono); + return downloadSessionFileWithResponse(agentName, agentSessionId, path, requestOptions) + .flatMap(FluxUtil::toMono); } /** @@ -313,8 +330,14 @@ public Mono deleteSessionFile(String agentName, String sessionId, String p * If `recursive` is false (default) and the target is a non-empty directory, the API returns 409 Conflict. * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file or directory path to delete, relative to the session home directory. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param recursive Whether to recursively delete directory contents. The service defaults to `false` if a value is + * not specified by the caller. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. * @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. @@ -325,22 +348,58 @@ public Mono deleteSessionFile(String agentName, String sessionId, String p */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSessionFile(String agentName, String sessionId, String path) { + public Mono deleteSessionFile(String agentName, String agentSessionId, String path, + AgentDefinitionOptInKeys foundryFeatures, Boolean recursive, String userIsolationKey) { // Generated convenience method for deleteSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - return deleteSessionFileWithResponse(agentName, sessionId, path, requestOptions).flatMap(FluxUtil::toMono); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (recursive != null) { + requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return deleteSessionFileWithResponse(agentName, agentSessionId, path, requestOptions).flatMap(FluxUtil::toMono); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pathStringNoThe directory path to list, relative to the session home + * directory. Defaults to the home directory if not provided.
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * * * + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -348,88 +407,138 @@ public Mono deleteSessionFile(String agentName, String sessionId, String p *
      * {@code
      * {
-     *     path: String (Required)
-     *     entries (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             size: long (Required)
-     *             is_directory: boolean (Required)
-     *             modified_time: OffsetDateTime (Required)
-     *         }
-     *     ]
+     *     name: String (Required)
+     *     size: long (Required)
+     *     is_directory: boolean (Required)
+     *     modified_time: long (Required)
      * }
      * }
      * 
* * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @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 response from listing a directory in a session sandbox along with {@link Response} on successful - * completion of {@link Mono}. + * @return the paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSessionFilesWithResponse(String agentName, String sessionId, String path, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionFiles(String agentName, String agentSessionId, RequestOptions requestOptions) { - return this.serviceClient.getSessionFilesWithResponseAsync(agentName, sessionId, path, requestOptions); + return this.serviceClient.listSessionFilesAsync(agentName, agentSessionId, requestOptions); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted * preview resources. + * @param path The directory path to list, relative to the session home directory. Defaults to the home directory if + * not provided. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from listing a directory in a session sandbox on successful completion of {@link Mono}. + * @return the paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSessionFiles(String agentName, String sessionId, String path, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for getSessionFilesWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionFiles(String agentName, String agentSessionId, + AgentDefinitionOptInKeys foundryFeatures, String path, String userIsolationKey, Integer limit, PageOrder order, + String after, String before) { + // Generated convenience method for listSessionFiles RequestOptions requestOptions = new RequestOptions(); if (foundryFeatures != null) { requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); } - return getSessionFilesWithResponse(agentName, sessionId, path, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SessionDirectoryListResponse.class)); + if (path != null) { + requestOptions.addQueryParam("path", path, false); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listSessionFiles(agentName, agentSessionId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(SessionDirectoryEntry.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from listing a directory in a session sandbox on successful completion of {@link Mono}. + * @return the paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSessionFiles(String agentName, String sessionId, String path) { - // Generated convenience method for getSessionFilesWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionFiles(String agentName, String agentSessionId) { + // Generated convenience method for listSessionFiles RequestOptions requestOptions = new RequestOptions(); - return getSessionFilesWithResponse(agentName, sessionId, path, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SessionDirectoryListResponse.class)); + PagedFlux pagedFluxResponse = listSessionFiles(agentName, agentSessionId, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(SessionDirectoryEntry.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesClient.java index dc1e3e309a01..ef07adf76a99 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentSessionFilesClient.java @@ -5,8 +5,9 @@ import com.azure.ai.agents.implementation.AgentSessionFilesImpl; import com.azure.ai.agents.models.AgentDefinitionOptInKeys; -import com.azure.ai.agents.models.SessionDirectoryListResponse; -import com.azure.ai.agents.models.SessionFileWriteResponse; +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.agents.models.SessionDirectoryEntry; +import com.azure.ai.agents.models.SessionFileWriteResult; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -16,6 +17,7 @@ import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; @@ -48,7 +50,10 @@ public final class AgentSessionFilesClient { * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -71,7 +76,7 @@ public final class AgentSessionFilesClient { * * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The destination file path within the sandbox, relative to the session home directory. * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -83,9 +88,10 @@ public final class AgentSessionFilesClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadSessionFileWithResponse(String agentName, String sessionId, String path, + public Response uploadSessionFileWithResponse(String agentName, String agentSessionId, String path, BinaryData content, RequestOptions requestOptions) { - return this.serviceClient.uploadSessionFileWithResponse(agentName, sessionId, path, content, requestOptions); + return this.serviceClient.uploadSessionFileWithResponse(agentName, agentSessionId, path, content, + requestOptions); } /** @@ -96,7 +102,10 @@ public Response uploadSessionFileWithResponse(String agentName, Stri * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -108,7 +117,7 @@ public Response uploadSessionFileWithResponse(String agentName, Stri * * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file path to download from the sandbox, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -119,9 +128,9 @@ public Response uploadSessionFileWithResponse(String agentName, Stri */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadSessionFileWithResponse(String agentName, String sessionId, String path, + public Response downloadSessionFileWithResponse(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { - return this.serviceClient.downloadSessionFileWithResponse(agentName, sessionId, path, requestOptions); + return this.serviceClient.downloadSessionFileWithResponse(agentName, agentSessionId, path, requestOptions); } /** @@ -131,8 +140,8 @@ public Response downloadSessionFileWithResponse(String agentName, St * * * - * + * *
Query Parameters
NameTypeRequiredDescription
recursiveBooleanNoWhether to recursively delete directory contents. Defaults - * to false.
recursiveBooleanNoWhether to recursively delete directory contents. The + * service defaults to `false` if a value is not specified by the caller.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

@@ -141,12 +150,15 @@ public Response downloadSessionFileWithResponse(String agentName, St * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file or directory path to delete, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -157,9 +169,9 @@ public Response downloadSessionFileWithResponse(String agentName, St */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSessionFileWithResponse(String agentName, String sessionId, String path, + public Response deleteSessionFileWithResponse(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { - return this.serviceClient.deleteSessionFileWithResponse(agentName, sessionId, path, requestOptions); + return this.serviceClient.deleteSessionFileWithResponse(agentName, agentSessionId, path, requestOptions); } /** @@ -167,11 +179,9 @@ public Response deleteSessionFileWithResponse(String agentName, String ses * Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large. * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The destination file path within the sandbox, relative to the session home directory. * @param content The content parameter. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. * @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. @@ -182,123 +192,125 @@ public Response deleteSessionFileWithResponse(String agentName, String ses */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SessionFileWriteResponse uploadSessionFile(String agentName, String sessionId, String path, - BinaryData content, AgentDefinitionOptInKeys foundryFeatures) { + public SessionFileWriteResult uploadSessionFile(String agentName, String agentSessionId, String path, + BinaryData content) { // Generated convenience method for uploadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return uploadSessionFileWithResponse(agentName, sessionId, path, content, requestOptions).getValue() - .toObject(SessionFileWriteResponse.class); + return uploadSessionFileWithResponse(agentName, agentSessionId, path, content, requestOptions).getValue() + .toObject(SessionFileWriteResult.class); } /** - * Upload a file to the session sandbox via binary stream. - * Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large. + * Download a file from the session sandbox as a binary stream. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The destination file path within the sandbox, relative to the session home directory. - * @param content The content parameter. + * @param agentSessionId The session ID. + * @param path The file path to download from the sandbox, relative to the session home directory. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from uploading a file to a session sandbox. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SessionFileWriteResponse uploadSessionFile(String agentName, String sessionId, String path, - BinaryData content) { - // Generated convenience method for uploadSessionFileWithResponse + public BinaryData downloadSessionFile(String agentName, String agentSessionId, String path) { + // Generated convenience method for downloadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - return uploadSessionFileWithResponse(agentName, sessionId, path, content, requestOptions).getValue() - .toObject(SessionFileWriteResponse.class); + return downloadSessionFileWithResponse(agentName, agentSessionId, path, requestOptions).getValue(); } /** - * Download a file from the session sandbox as a binary stream. + * Delete a file or directory from the session sandbox. + * If `recursive` is false (default) and the target is a non-empty directory, the API returns 409 Conflict. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The file path to download from the sandbox, relative to the session home directory. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. + * @param agentSessionId The session ID. + * @param path The file or directory path to delete, relative to the session home directory. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData downloadSessionFile(String agentName, String sessionId, String path, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for downloadSessionFileWithResponse + public void deleteSessionFile(String agentName, String agentSessionId, String path) { + // Generated convenience method for deleteSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return downloadSessionFileWithResponse(agentName, sessionId, path, requestOptions).getValue(); + deleteSessionFileWithResponse(agentName, agentSessionId, path, requestOptions).getValue(); } /** - * Download a file from the session sandbox as a binary stream. + * Upload a file to the session sandbox via binary stream. + * Maximum file size is 50 MB. Uploads exceeding this limit return 413 Payload Too Large. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The file path to download from the sandbox, relative to the session home directory. + * @param agentSessionId The session ID. + * @param path The destination file path within the sandbox, relative to the session home directory. + * @param content The content parameter. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return response from uploading a file to a session sandbox. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData downloadSessionFile(String agentName, String sessionId, String path) { - // Generated convenience method for downloadSessionFileWithResponse + public SessionFileWriteResult uploadSessionFile(String agentName, String agentSessionId, String path, + BinaryData content, AgentDefinitionOptInKeys foundryFeatures, String userIsolationKey) { + // Generated convenience method for uploadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - return downloadSessionFileWithResponse(agentName, sessionId, path, requestOptions).getValue(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return uploadSessionFileWithResponse(agentName, agentSessionId, path, content, requestOptions).getValue() + .toObject(SessionFileWriteResult.class); } /** - * Delete a file or directory from the session sandbox. - * If `recursive` is false (default) and the target is a non-empty directory, the API returns 409 Conflict. + * Download a file from the session sandbox as a binary stream. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The file or directory path to delete, relative to the session home directory. + * @param agentSessionId The session ID. + * @param path The file path to download from the sandbox, relative to the session home directory. * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted * preview resources. - * @param recursive Whether to recursively delete directory contents. Defaults to false. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSessionFile(String agentName, String sessionId, String path, - AgentDefinitionOptInKeys foundryFeatures, Boolean recursive) { - // Generated convenience method for deleteSessionFileWithResponse + public BinaryData downloadSessionFile(String agentName, String agentSessionId, String path, + AgentDefinitionOptInKeys foundryFeatures, String userIsolationKey) { + // Generated convenience method for downloadSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); if (foundryFeatures != null) { requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); } - if (recursive != null) { - requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); } - deleteSessionFileWithResponse(agentName, sessionId, path, requestOptions).getValue(); + return downloadSessionFileWithResponse(agentName, agentSessionId, path, requestOptions).getValue(); } /** @@ -306,8 +318,14 @@ public void deleteSessionFile(String agentName, String sessionId, String path, * If `recursive` is false (default) and the target is a non-empty directory, the API returns 409 Conflict. * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file or directory path to delete, relative to the session home directory. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param recursive Whether to recursively delete directory contents. The service defaults to `false` if a value is + * not specified by the caller. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. * @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. @@ -317,22 +335,58 @@ public void deleteSessionFile(String agentName, String sessionId, String path, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSessionFile(String agentName, String sessionId, String path) { + public void deleteSessionFile(String agentName, String agentSessionId, String path, + AgentDefinitionOptInKeys foundryFeatures, Boolean recursive, String userIsolationKey) { // Generated convenience method for deleteSessionFileWithResponse RequestOptions requestOptions = new RequestOptions(); - deleteSessionFileWithResponse(agentName, sessionId, path, requestOptions).getValue(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (recursive != null) { + requestOptions.addQueryParam("recursive", String.valueOf(recursive), false); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + deleteSessionFileWithResponse(agentName, agentSessionId, path, requestOptions).getValue(); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pathStringNoThe directory path to list, relative to the session home + * directory. Defaults to the home directory if not provided.
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * * * + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -340,87 +394,114 @@ public void deleteSessionFile(String agentName, String sessionId, String path) { *
      * {@code
      * {
-     *     path: String (Required)
-     *     entries (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             size: long (Required)
-     *             is_directory: boolean (Required)
-     *             modified_time: OffsetDateTime (Required)
-     *         }
-     *     ]
+     *     name: String (Required)
+     *     size: long (Required)
+     *     is_directory: boolean (Required)
+     *     modified_time: long (Required)
      * }
      * }
      * 
* * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @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 response from listing a directory in a session sandbox along with {@link Response}. + * @return the paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSessionFilesWithResponse(String agentName, String sessionId, String path, + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessionFiles(String agentName, String agentSessionId, RequestOptions requestOptions) { - return this.serviceClient.getSessionFilesWithResponse(agentName, sessionId, path, requestOptions); + return this.serviceClient.listSessionFiles(agentName, agentSessionId, requestOptions); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted * preview resources. + * @param path The directory path to list, relative to the session home directory. Defaults to the home directory if + * not provided. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from listing a directory in a session sandbox. + * @return the paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public SessionDirectoryListResponse getSessionFiles(String agentName, String sessionId, String path, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for getSessionFilesWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessionFiles(String agentName, String agentSessionId, + AgentDefinitionOptInKeys foundryFeatures, String path, String userIsolationKey, Integer limit, PageOrder order, + String after, String before) { + // Generated convenience method for listSessionFiles RequestOptions requestOptions = new RequestOptions(); if (foundryFeatures != null) { requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); } - return getSessionFilesWithResponse(agentName, sessionId, path, requestOptions).getValue() - .toObject(SessionDirectoryListResponse.class); + if (path != null) { + requestOptions.addQueryParam("path", path, false); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listSessionFiles(agentName, agentSessionId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(SessionDirectoryEntry.class)); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. * * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response from listing a directory in a session sandbox. + * @return the paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public SessionDirectoryListResponse getSessionFiles(String agentName, String sessionId, String path) { - // Generated convenience method for getSessionFilesWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessionFiles(String agentName, String agentSessionId) { + // Generated convenience method for listSessionFiles RequestOptions requestOptions = new RequestOptions(); - return getSessionFilesWithResponse(agentName, sessionId, path, requestOptions).getValue() - .toObject(SessionDirectoryListResponse.class); + return serviceClient.listSessionFiles(agentName, agentSessionId, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(SessionDirectoryEntry.class)); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsAsyncClient.java index c8b41199459b..58a93bd4a471 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsAsyncClient.java @@ -5,7 +5,9 @@ import com.azure.ai.agents.implementation.AgentsImpl; import com.azure.ai.agents.implementation.JsonMergePatchHelper; +import com.azure.ai.agents.implementation.MultipartFormDataHelper; import com.azure.ai.agents.implementation.SessionLogStreamHelper; +import com.azure.ai.agents.implementation.models.CreateAgentFromCodeContent; import com.azure.ai.agents.implementation.models.CreateAgentFromManifestRequest; import com.azure.ai.agents.implementation.models.CreateAgentOptions; import com.azure.ai.agents.implementation.models.CreateAgentRequest; @@ -21,8 +23,19 @@ import com.azure.ai.agents.models.AgentKind; import com.azure.ai.agents.models.AgentSessionResource; import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.CandidateDeployConfig; +import com.azure.ai.agents.models.CandidateMetadata; +import com.azure.ai.agents.models.CandidateResults; +import com.azure.ai.agents.models.CreateAgentVersionFromCodeContent; import com.azure.ai.agents.models.CreateAgentVersionInput; +import com.azure.ai.agents.models.FoundryFeaturesOptInKeys; +import com.azure.ai.agents.models.JobStatus; +import com.azure.ai.agents.models.OptimizationCandidatePagedResult; +import com.azure.ai.agents.models.OptimizationJob; +import com.azure.ai.agents.models.OptimizationJobInputs; import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.agents.models.PromoteCandidateInput; +import com.azure.ai.agents.models.PromoteCandidateResult; import com.azure.ai.agents.models.SessionLogEvent; import com.azure.ai.agents.models.UpdateAgentDetailsOptions; import com.azure.ai.agents.models.VersionIndicator; @@ -80,11 +93,12 @@ public final class AgentsAsyncClient { * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -106,7 +120,7 @@ public final class AgentsAsyncClient { * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -160,7 +174,8 @@ public Mono> getAgentWithResponse(String agentName, Request * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -173,7 +188,7 @@ public Mono> getAgentWithResponse(String agentName, Request * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -200,11 +215,12 @@ public Mono> getAgentWithResponse(String agentName, Request * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -324,11 +340,12 @@ public Mono deleteAgentVersion(String agentName, String agentVersion) { * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -476,7 +493,8 @@ public Mono createAgentVersion(String agentName, AgentDefin * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -490,7 +508,7 @@ public Mono createAgentVersion(String agentName, AgentDefin * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -508,7 +526,7 @@ public Mono createAgentVersion(String agentName, AgentDefin * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -557,11 +575,12 @@ public Mono createAgentVersion(String agentName, AgentDefin * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -583,7 +602,7 @@ public Mono createAgentVersion(String agentName, AgentDefin * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -638,7 +657,8 @@ Mono> createAgentWithResponse(BinaryData createAgentRequest * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -651,7 +671,7 @@ Mono> createAgentWithResponse(BinaryData createAgentRequest * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -683,11 +703,12 @@ Mono> createAgentWithResponse(BinaryData createAgentRequest * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -709,7 +730,7 @@ Mono> createAgentWithResponse(BinaryData createAgentRequest * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -832,11 +853,12 @@ Mono updateAgent(String agentName, AgentDefinition definition) { * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -858,7 +880,7 @@ Mono updateAgent(String agentName, AgentDefinition definition) { * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -946,11 +968,12 @@ Mono> createAgentFromManifestWithResponse(BinaryData create * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -972,7 +995,7 @@ Mono> createAgentFromManifestWithResponse(BinaryData create * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -1055,11 +1078,12 @@ Mono> updateAgentFromManifestWithResponse(String agentName, * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1279,11 +1303,12 @@ public Mono createAgentVersionFromManifest(String agentName * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1456,7 +1481,7 @@ public PagedFlux listAgentVersions(String agentName, Intege * Query Parameters * NameTypeRequiredDescription * kindStringNoFilter agents by kind. If not provided, all agents are returned. - * Allowed values: "prompt", "hosted", "workflow". + * Allowed values: "prompt", "hosted", "workflow", "external". * limitIntegerNoA limit on the number of objects to be returned. Limit can range * between 1 and 100, and the * default is 20. @@ -1493,11 +1518,12 @@ public PagedFlux listAgentVersions(String agentName, Intege * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1519,7 +1545,7 @@ public PagedFlux listAgentVersions(String agentName, Intege * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -1629,6 +1655,14 @@ Mono createAgentFromManifest(String agentName, String manifestId, * only items associated with the specified agent ID will be returned. * * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -1659,70 +1693,6 @@ public PagedFlux listAgentConversations(RequestOptions requestOption
         return this.serviceClient.listAgentConversationsAsync(requestOptions);
     }
 
-    /**
-     * Returns the list of all conversations.
-     *
-     * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
-     * default is 20.
-     * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
-     * for descending order.
-     * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
-     * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
-     * subsequent call can include after=obj_foo in order to fetch the next page of the list.
-     * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
-     * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
-     * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
-     * @param agentName Filter by agent name. If provided, only items associated with the specified agent will be
-     * returned.
-     * @param agentId Filter by agent ID in the format `name:version`. If provided, only items associated with the
-     * specified agent ID will be returned.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the response data for a requested list of items as paginated response with {@link PagedFlux}.
-     */
-    @Generated
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedFlux listAgentConversations(Integer limit, PageOrder order, String after, String before,
-        String agentName, String agentId) {
-        // Generated convenience method for listAgentConversations
-        RequestOptions requestOptions = new RequestOptions();
-        if (limit != null) {
-            requestOptions.addQueryParam("limit", String.valueOf(limit), false);
-        }
-        if (order != null) {
-            requestOptions.addQueryParam("order", order.toString(), false);
-        }
-        if (after != null) {
-            requestOptions.addQueryParam("after", after, false);
-        }
-        if (before != null) {
-            requestOptions.addQueryParam("before", before, false);
-        }
-        if (agentName != null) {
-            requestOptions.addQueryParam("agent_name", agentName, false);
-        }
-        if (agentId != null) {
-            requestOptions.addQueryParam("agent_id", agentId, false);
-        }
-        PagedFlux pagedFluxResponse = listAgentConversations(requestOptions);
-        return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> {
-            Flux> flux = (continuationTokenParam == null)
-                ? pagedFluxResponse.byPage().take(1)
-                : pagedFluxResponse.byPage(continuationTokenParam).take(1);
-            return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(),
-                pagedResponse.getStatusCode(), pagedResponse.getHeaders(),
-                pagedResponse.getValue()
-                    .stream()
-                    .map(protocolMethodData -> protocolMethodData.toObject(Conversation.class))
-                    .collect(Collectors.toList()),
-                pagedResponse.getContinuationToken(), null));
-        });
-    }
-
     /**
      * Returns the list of all conversations.
      *
@@ -1799,7 +1769,18 @@ public Mono> deleteAgentWithResponse(String agentName, RequestOpt
     }
 
     /**
-     * Deletes an agent.
+     * Deletes an agent. For hosted agents, if any version has active sessions, the request
+     * is rejected with HTTP 409 unless `force` is set to true. When force is true, all
+     * associated sessions are cascade-deleted along with the agent and its versions.
+     * 

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the agent even if + * its versions have active sessions, cascading deletion to all associated sessions. The service defaults to `false` + * if a value is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
@@ -1827,7 +1808,18 @@ Mono> internalDeleteAgentWithResponse(String agentName, Req
     }
 
     /**
-     * Deletes a specific version of an agent.
+     * Deletes a specific version of an agent. For hosted agents, if the version has active
+     * sessions, the request is rejected with HTTP 409 unless `force` is set to true. When
+     * force is true, all sessions associated with this version are cascade-deleted.
+     * 

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the version even if + * it has active sessions, cascading deletion to all associated sessions. The service defaults to `false` if a value + * is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
@@ -1857,69 +1849,6 @@ Mono> internalDeleteAgentVersionWithResponse(String agentNa
         return this.serviceClient.internalDeleteAgentVersionWithResponseAsync(agentName, agentVersion, 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.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     agent_session_id: String (Optional)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
-     * }
-     * }
-     * 
- * - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param createSessionRequest The createSessionRequest parameter. - * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with - * {@link Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSessionWithResponse(String agentName, String isolationKey, - BinaryData createSessionRequest, RequestOptions requestOptions) { - return this.serviceClient.createSessionWithResponseAsync(agentName, isolationKey, createSessionRequest, - requestOptions); - } - /** * Retrieves a session by ID. *

Header Parameters

@@ -1928,7 +1857,10 @@ public Mono> createSessionWithResponse(String agentName, St * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -1965,37 +1897,6 @@ public Mono> getSessionWithResponse(String agentName, Strin return this.serviceClient.getSessionWithResponseAsync(agentName, sessionId, requestOptions); } - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
- * You can add these to a request with {@link RequestOptions#addHeader} - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @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 Response} on successful completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSessionWithResponse(String agentName, String sessionId, String isolationKey, - RequestOptions requestOptions) { - return this.serviceClient.deleteSessionWithResponseAsync(agentName, sessionId, isolationKey, requestOptions); - } - /** * Returns a list of sessions for the specified agent. *

Query Parameters

@@ -2024,7 +1925,10 @@ public Mono> deleteSessionWithResponse(String agentName, String s * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -2179,16 +2083,10 @@ public Mono createAgentVersion(String agentName, AgentDefin } /** - * 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. + * Retrieves a session by ID. * - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param versionIndicator Determines which agent version backs the session. - * @param agentSessionId Optional caller-provided session ID. If specified, it must be unique within the agent - * endpoint. Auto-generated if omitted. + * @param agentName The name of the agent. + * @param sessionId The session identifier. * @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. @@ -2200,268 +2098,65 @@ public Mono createAgentVersion(String agentName, AgentDefin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSession(String agentName, String isolationKey, - VersionIndicator versionIndicator, String agentSessionId) { - // Generated convenience method for createSessionWithResponse + public Mono getSession(String agentName, String sessionId) { + // Generated convenience method for getSessionWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateSessionRequest createSessionRequestObj - = new CreateSessionRequest(versionIndicator).setAgentSessionId(agentSessionId); - BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); - return createSessionWithResponse(agentName, isolationKey, createSessionRequest, requestOptions) - .flatMap(FluxUtil::toMono) + return getSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); } /** - * 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. + * Returns a list of sessions for the specified agent. * - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param versionIndicator Determines which agent version backs the session. + * @param agentName The name of the agent. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agent session providing a long-lived compute sandbox for hosted agent invocations on successful - * completion of {@link Mono}. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSession(String agentName, String isolationKey, - VersionIndicator versionIndicator) { - // Generated convenience method for createSessionWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessions(String agentName) { + // Generated convenience method for listSessions RequestOptions requestOptions = new RequestOptions(); - CreateSessionRequest createSessionRequestObj = new CreateSessionRequest(versionIndicator); - BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); - return createSessionWithResponse(agentName, isolationKey, createSessionRequest, requestOptions) - .flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); + PagedFlux pagedFluxResponse = listSessions(agentName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); } /** - * Retrieves a session by ID. + * Streams console logs (stdout / stderr) for a specific hosted agent session as typed + * {@link SessionLogEvent} values. * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agent session providing a long-lived compute sandbox for hosted agent invocations on successful - * completion of {@link Mono}. + * @param agentName The name of the hosted agent. + * @param agentVersion The version of the agent. + * @param sessionId The session ID (maps to an ADC sandbox). + * @return A stream of {@link SessionLogEvent} values emitted by the hosted agent session log stream. */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSession(String agentName, String sessionId, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for getSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return getSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public Flux getSessionLogStream(String agentName, String agentVersion, String sessionId) { + RequestOptions requestOptions = new RequestOptions().setHeader(HttpHeaderName.fromString("Foundry-Features"), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW.toString()); + return getSessionLogStream(agentName, agentVersion, sessionId, requestOptions); } /** - * Retrieves a session by ID. - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agent session providing a long-lived compute sandbox for hosted agent invocations on successful - * completion of {@link Mono}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSession(String agentName, String sessionId) { - // Generated convenience method for getSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); - } - - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSession(String agentName, String sessionId, String isolationKey, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for deleteSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return deleteSessionWithResponse(agentName, sessionId, isolationKey, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSession(String agentName, String sessionId, String isolationKey) { - // Generated convenience method for deleteSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return deleteSessionWithResponse(agentName, sessionId, isolationKey, requestOptions).flatMap(FluxUtil::toMono); - } - - /** - * Returns a list of sessions for the specified agent. - * - * @param agentName The name of the agent. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSessions(String agentName, AgentDefinitionOptInKeys foundryFeatures, - Integer limit, PageOrder order, String after, String before) { - // Generated convenience method for listSessions - RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - PagedFlux pagedFluxResponse = listSessions(agentName, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Returns a list of sessions for the specified agent. - * - * @param agentName The name of the agent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSessions(String agentName) { - // Generated convenience method for listSessions - RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listSessions(agentName, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Streams console logs (stdout / stderr) for a specific hosted agent session as typed - * {@link SessionLogEvent} values. - * - * @param agentName The name of the hosted agent. - * @param agentVersion The version of the agent. - * @param sessionId The session ID (maps to an ADC sandbox). - * @return A stream of {@link SessionLogEvent} values emitted by the hosted agent session log stream. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public Flux getSessionLogStream(String agentName, String agentVersion, String sessionId) { - RequestOptions requestOptions = new RequestOptions().setHeader(HttpHeaderName.fromString("Foundry-Features"), - AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW.toString()); - return getSessionLogStream(agentName, agentVersion, sessionId, requestOptions); - } - - /** - * Streams console logs (stdout / stderr) for a specific hosted agent session as typed - * {@link SessionLogEvent} values. + * Streams console logs (stdout / stderr) for a specific hosted agent session as typed + * {@link SessionLogEvent} values. * * @param agentName The name of the hosted agent. * @param agentVersion The version of the agent. @@ -2511,7 +2206,8 @@ public Flux getSessionLogStream(String agentName, String agentV * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -2554,7 +2250,8 @@ public Mono> getSessionLogStreamWithResponse(String agentNa * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -2572,7 +2269,7 @@ public Mono> getSessionLogStreamWithResponse(String agentNa * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -2621,11 +2318,12 @@ public Mono> getSessionLogStreamWithResponse(String agentNa * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -2647,7 +2345,7 @@ public Mono> getSessionLogStreamWithResponse(String agentNa * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -2834,4 +2532,2993 @@ public Mono updateAgentDetails(String agentName, UpdateAgentDetail .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)); } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createAgentFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + // Operation 'createAgentFromCode' is of content-type 'multipart/form-data'. Protocol API is not usable and + // hence not generated. + return this.serviceClient.createAgentFromCodeWithResponseAsync(agentName, codeZipSha256, content, + requestOptions); + } + + /** + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> updateAgentFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + // Operation 'updateAgentFromCode' is of content-type 'multipart/form-data'. Protocol API is not usable and + // hence not generated. + return this.serviceClient.updateAgentFromCodeWithResponseAsync(agentName, codeZipSha256, content, + requestOptions); + } + + /** + * The createAgentVersionFromCode operation. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createAgentVersionFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + // Operation 'createAgentVersionFromCode' is of content-type 'multipart/form-data'. Protocol API is not usable + // and hence not generated. + return this.serviceClient.createAgentVersionFromCodeWithResponseAsync(agentName, codeZipSha256, content, + requestOptions); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
agent_versionStringNoThe version of the agent whose code zip should be + * downloaded. + * If omitted, the latest version's code zip is returned.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadAgentCodeWithResponse(String agentName, RequestOptions requestOptions) { + return this.serviceClient.downloadAgentCodeWithResponseAsync(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. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Optional)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to create a session for. + * @param createSessionRequest The createSessionRequest parameter. + * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createSessionWithResponse(String agentName, BinaryData createSessionRequest, + RequestOptions requestOptions) { + return this.serviceClient.createSessionWithResponseAsync(agentName, createSessionRequest, requestOptions); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSessionWithResponse(String agentName, String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.deleteSessionWithResponseAsync(agentName, sessionId, requestOptions); + } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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 foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAgentFromCode(String agentName, String codeZipSha256, CreateAgentFromCodeContent content, + AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for createAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return createAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)); + } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAgentFromCode(String agentName, String codeZipSha256, CreateAgentFromCodeContent content) { + // Generated convenience method for createAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)); + } + + /** + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAgentFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content, AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for updateAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return updateAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)); + } + + /** + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAgentFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content) { + // Generated convenience method for updateAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return updateAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)); + } + + /** + * The createAgentVersionFromCode operation. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAgentVersionFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content, AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for createAgentVersionFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return createAgentVersionFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class)); + } + + /** + * The createAgentVersionFromCode operation. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAgentVersionFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content) { + // Generated convenience method for createAgentVersionFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createAgentVersionFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class)); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + * + * @param agentName The name of the agent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono downloadAgentCode(String agentName) { + // Generated convenience method for downloadAgentCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return downloadAgentCodeWithResponse(agentName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * 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. + * + * @param agentName The name of the agent to create a session for. + * @param versionIndicator Determines which agent version backs the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an agent session providing a long-lived compute sandbox for hosted agent invocations on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createSession(String agentName, VersionIndicator versionIndicator) { + // Generated convenience method for createSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateSessionRequest createSessionRequestObj = new CreateSessionRequest(versionIndicator); + BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); + return createSessionWithResponse(agentName, createSessionRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteSession(String agentName, String sessionId) { + // Generated convenience method for deleteSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + * + * @param agentName The name of the agent. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param agentVersion The version of the agent whose code zip should be downloaded. + * If omitted, the latest version's code zip is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono downloadAgentCode(String agentName, AgentDefinitionOptInKeys foundryFeatures, + String agentVersion) { + // Generated convenience method for downloadAgentCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (agentVersion != null) { + requestOptions.addQueryParam("agent_version", agentVersion, false); + } + return downloadAgentCodeWithResponse(agentName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Returns the list of all conversations. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @param agentName Filter by agent name. If provided, only items associated with the specified agent will be + * returned. + * @param agentId Filter by agent ID in the format `name:version`. If provided, only items associated with the + * specified agent ID will be returned. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAgentConversations(Integer limit, PageOrder order, String after, String before, + String agentName, String agentId, String userIsolationKey) { + // Generated convenience method for listAgentConversations + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (agentName != null) { + requestOptions.addQueryParam("agent_name", agentName, false); + } + if (agentId != null) { + requestOptions.addQueryParam("agent_id", agentId, false); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + PagedFlux pagedFluxResponse = listAgentConversations(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Conversation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Returns the list of all conversations. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @param agentName Filter by agent name. If provided, only items associated with the specified agent will be + * returned. + * @param agentId Filter by agent ID in the format `name:version`. If provided, only items associated with the + * specified agent ID will be returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAgentConversations(Integer limit, PageOrder order, String after, String before, + String agentName, String agentId) { + // Generated convenience method for listAgentConversations + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (agentName != null) { + requestOptions.addQueryParam("agent_name", agentName, false); + } + if (agentId != null) { + requestOptions.addQueryParam("agent_id", agentId, false); + } + PagedFlux pagedFluxResponse = listAgentConversations(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Conversation.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent (Required): {
+     *         agent_name: String (Required)
+     *         agent_version: String (Optional)
+     *     }
+     *     train_dataset_reference (Required): {
+     *         name: String (Required)
+     *         version: String (Optional)
+     *     }
+     *     validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *     evaluators (Optional): [
+     *         String (Optional)
+     *     ]
+     *     options (Optional): {
+     *         max_iterations: Integer (Optional)
+     *         optimization_config (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         eval_model: String (Optional)
+     *         optimization_model: String (Optional)
+     *         evaluation_level: String(turn/conversation) (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param inputs The optimization job inputs. + * @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 inputs, + RequestOptions requestOptions) { + return this.serviceClient.createOptimizationJobWithResponseAsync(inputs, requestOptions); + } + + /** + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about an agent optimization job. + * + * Get an optimization job by id along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.getOptimizationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
statusStringNoFilter to jobs in this lifecycle state. Allowed values: + * "queued", "in_progress", "succeeded", "failed", "cancelled".
agent_nameStringNoFilter to jobs targeting this agent name.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOptimizationJobs(RequestOptions requestOptions) { + return this.serviceClient.listOptimizationJobsAsync(requestOptions); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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> cancelOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelOptimizationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoWhen true, force-delete even if the job is in a non-terminal + * state.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.deleteOptimizationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Optional)
+     *     last_id: String (Optional)
+     *     has_more: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listOptimizationCandidatesWithResponse(String jobId, + RequestOptions requestOptions) { + return this.serviceClient.listOptimizationCandidatesWithResponseAsync(jobId, requestOptions); + } + + /** + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     job_id: String (Required)
+     *     candidate_name: String (Required)
+     *     status: String (Required)
+     *     score: Double (Optional)
+     *     has_results: boolean (Required)
+     *     created_at: long (Required)
+     *     updated_at: long (Required)
+     *     promotion (Optional): {
+     *         promoted_at: long (Required)
+     *         agent_name: String (Required)
+     *         agent_version: String (Required)
+     *     }
+     *     files (Required): [
+     *          (Required){
+     *             path: String (Required)
+     *             type: String (Required)
+     *             size_bytes: long (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @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 a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationCandidateWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateWithResponseAsync(jobId, candidateId, requestOptions); + } + + /** + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     instructions: String (Optional)
+     *     model: String (Optional)
+     *     temperature: Double (Optional)
+     *     skills (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @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 candidate deploy config. + * + * Get the candidate's deploy config JSON along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationCandidateConfigWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateConfigWithResponseAsync(jobId, candidateId, requestOptions); + } + + /** + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     results (Required): [
+     *          (Required){
+     *             task_name: String (Required)
+     *             query: String (Optional)
+     *             scores (Required): {
+     *                 String: double (Required)
+     *             }
+     *             composite_score: double (Required)
+     *             tokens: long (Required)
+     *             duration_seconds: double (Required)
+     *             passed: boolean (Required)
+     *             error_message: String (Optional)
+     *             rationales (Optional): {
+     *                 String: String (Required)
+     *             }
+     *             response: String (Optional)
+     *             run_id: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @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 candidate evaluation results. + * + * Get full per-task evaluation results for a candidate along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationCandidateResultsWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateResultsWithResponseAsync(jobId, candidateId, requestOptions); + } + + /** + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + * + * @param jobId The ID of the job. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an agent optimization job. + * + * Get an optimization job by id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + } + + /** + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + * + * @param jobId The ID of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an agent optimization job. + * + * Get an optimization job by id on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationJob(String jobId) { + // Generated convenience method for getOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + } + + /** + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @param status Filter to jobs in this lifecycle state. + * @param agentName Filter to jobs targeting this agent name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOptimizationJobs(FoundryFeaturesOptInKeys foundryFeatures, Integer limit, + PageOrder order, String after, String before, JobStatus status, String agentName) { + // Generated convenience method for listOptimizationJobs + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (status != null) { + requestOptions.addQueryParam("status", status.toString(), false); + } + if (agentName != null) { + requestOptions.addQueryParam("agent_name", agentName, false); + } + PagedFlux pagedFluxResponse = listOptimizationJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / 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. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listOptimizationJobs() { + // Generated convenience method for listOptimizationJobs + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listOptimizationJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + * + * @param jobId The ID of the job to cancel. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelOptimizationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for cancelOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return cancelOptimizationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + * + * @param jobId The ID of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelOptimizationJob(String jobId) { + // Generated convenience method for cancelOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelOptimizationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * + * @param jobId The ID of the job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteOptimizationJob(String jobId) { + // Generated convenience method for deleteOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteOptimizationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + * + * @param jobId The optimization job id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listOptimizationCandidates(String jobId, + FoundryFeaturesOptInKeys foundryFeatures, Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listOptimizationCandidatesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listOptimizationCandidatesWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationCandidatePagedResult.class)); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + * + * @param jobId The optimization job id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listOptimizationCandidates(String jobId) { + // Generated convenience method for listOptimizationCandidatesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listOptimizationCandidatesWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationCandidatePagedResult.class)); + } + + /** + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidate(String jobId, String candidateId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateWithResponse(jobId, candidateId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CandidateMetadata.class)); + } + + /** + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidate(String jobId, String candidateId) { + // Generated convenience method for getOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateWithResponse(jobId, candidateId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CandidateMetadata.class)); + } + + /** + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate deploy config. + * + * Get the candidate's deploy config JSON on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidateConfig(String jobId, String candidateId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateConfigWithResponse(jobId, candidateId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CandidateDeployConfig.class)); + } + + /** + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate deploy config. + * + * Get the candidate's deploy config JSON on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidateConfig(String jobId, String candidateId) { + // Generated convenience method for getOptimizationCandidateConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateConfigWithResponse(jobId, candidateId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CandidateDeployConfig.class)); + } + + /** + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate evaluation results. + * + * Get full per-task evaluation results for a candidate on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidateResults(String jobId, String candidateId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateResultsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateResultsWithResponse(jobId, candidateId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CandidateResults.class)); + } + + /** + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate evaluation results. + * + * Get full per-task evaluation results for a candidate on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidateResults(String jobId, String candidateId) { + // Generated convenience method for getOptimizationCandidateResultsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateResultsWithResponse(jobId, candidateId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CandidateResults.class)); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopSessionWithResponse(String agentName, String sessionId, + RequestOptions requestOptions) { + return this.serviceClient.stopSessionWithResponseAsync(agentName, sessionId, 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. + * + * @param agentName The name of the agent to create a session for. + * @param versionIndicator Determines which agent version backs the session. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @param agentSessionId Optional caller-provided session ID. If specified, it must be unique within the agent + * endpoint. Auto-generated if omitted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an agent session providing a long-lived compute sandbox for hosted agent invocations on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createSession(String agentName, VersionIndicator versionIndicator, + String userIsolationKey, String agentSessionId) { + // Generated convenience method for createSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateSessionRequest createSessionRequestObj + = new CreateSessionRequest(versionIndicator).setAgentSessionId(agentSessionId); + BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return createSessionWithResponse(agentName, createSessionRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); + } + + /** + * Retrieves a session by ID. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an agent session providing a long-lived compute sandbox for hosted agent invocations on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSession(String agentName, String sessionId, + AgentDefinitionOptInKeys foundryFeatures, String userIsolationKey) { + // Generated convenience method for getSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return getSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteSession(String agentName, String sessionId, AgentDefinitionOptInKeys foundryFeatures, + String userIsolationKey) { + // Generated convenience method for deleteSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return deleteSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopSession(String agentName, String sessionId, AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for stopSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return stopSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono stopSession(String agentName, String sessionId) { + // Generated convenience method for stopSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return stopSessionWithResponse(agentName, sessionId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Returns a list of sessions for the specified agent. + * + * @param agentName The name of the agent. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessions(String agentName, AgentDefinitionOptInKeys foundryFeatures, + String userIsolationKey, Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listSessions + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listSessions(agentName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AgentSessionResource.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * + * @param inputs The optimization job inputs. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job + * unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOptimizationJob(OptimizationJobInputs inputs, + FoundryFeaturesOptInKeys foundryFeatures, String operationId) { + // Generated convenience method for createOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (operationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); + } + return createOptimizationJobWithResponse(BinaryData.fromObject(inputs), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + } + + /** + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * + * @param inputs The optimization job inputs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOptimizationJob(OptimizationJobInputs inputs) { + // Generated convenience method for createOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOptimizationJobWithResponse(BinaryData.fromObject(inputs), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(OptimizationJob.class)); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * + * @param jobId The ID of the job to delete. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param force When true, force-delete even if the job is in a non-terminal state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteOptimizationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures, Boolean force) { + // Generated convenience method for deleteOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (force != null) { + requestOptions.addQueryParam("force", String.valueOf(force), false); + } + return deleteOptimizationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). + * @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 a candidate file. + * + * Stream a specific file from the candidate's blob directory along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationCandidateFileWithResponse(String jobId, String candidateId, + String path, RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateFileWithResponseAsync(jobId, candidateId, path, + requestOptions); + } + + /** + * Promote a candidate. + * + * Promotes a candidate, recording the deployment timestamp and target agent version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     status: String (Required)
+     *     promoted_at: long (Required)
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @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 response after successfully promoting a candidate along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> promoteOptimizationCandidateWithResponse(String jobId, String candidateId, + BinaryData candidateRequest, RequestOptions requestOptions) { + return this.serviceClient.promoteOptimizationCandidateWithResponseAsync(jobId, candidateId, candidateRequest, + requestOptions); + } + + /** + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate file. + * + * Stream a specific file from the candidate's blob directory on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidateFile(String jobId, String candidateId, String path, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateFileWithResponse(jobId, candidateId, path, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate file. + * + * Stream a specific file from the candidate's blob directory on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getOptimizationCandidateFile(String jobId, String candidateId, String path) { + // Generated convenience method for getOptimizationCandidateFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateFileWithResponse(jobId, candidateId, path, requestOptions) + .flatMap(FluxUtil::toMono); + } + + /** + * Promote a candidate. + * + * Promotes a candidate, recording the deployment timestamp and target agent version. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after successfully promoting a candidate on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono promoteOptimizationCandidate(String jobId, String candidateId, + PromoteCandidateInput candidateRequest, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for promoteOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return promoteOptimizationCandidateWithResponse(jobId, candidateId, BinaryData.fromObject(candidateRequest), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PromoteCandidateResult.class)); + } + + /** + * Promote a candidate. + * + * Promotes a candidate, recording the deployment timestamp and target agent version. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after successfully promoting a candidate on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono promoteOptimizationCandidate(String jobId, String candidateId, + PromoteCandidateInput candidateRequest) { + // Generated convenience method for promoteOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return promoteOptimizationCandidateWithResponse(jobId, candidateId, BinaryData.fromObject(candidateRequest), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PromoteCandidateResult.class)); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java index 2013e3c9c1ca..81ab36bbf40f 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 @@ -5,7 +5,9 @@ import com.azure.ai.agents.implementation.AgentsImpl; import com.azure.ai.agents.implementation.JsonMergePatchHelper; +import com.azure.ai.agents.implementation.MultipartFormDataHelper; import com.azure.ai.agents.implementation.SessionLogStreamHelper; +import com.azure.ai.agents.implementation.models.CreateAgentFromCodeContent; import com.azure.ai.agents.implementation.models.CreateAgentFromManifestRequest; import com.azure.ai.agents.implementation.models.CreateAgentOptions; import com.azure.ai.agents.implementation.models.CreateAgentRequest; @@ -21,8 +23,19 @@ import com.azure.ai.agents.models.AgentKind; import com.azure.ai.agents.models.AgentSessionResource; import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.CandidateDeployConfig; +import com.azure.ai.agents.models.CandidateMetadata; +import com.azure.ai.agents.models.CandidateResults; +import com.azure.ai.agents.models.CreateAgentVersionFromCodeContent; import com.azure.ai.agents.models.CreateAgentVersionInput; +import com.azure.ai.agents.models.FoundryFeaturesOptInKeys; +import com.azure.ai.agents.models.JobStatus; +import com.azure.ai.agents.models.OptimizationCandidatePagedResult; +import com.azure.ai.agents.models.OptimizationJob; +import com.azure.ai.agents.models.OptimizationJobInputs; import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.agents.models.PromoteCandidateInput; +import com.azure.ai.agents.models.PromoteCandidateResult; import com.azure.ai.agents.models.SessionLogEvent; import com.azure.ai.agents.models.UpdateAgentDetailsOptions; import com.azure.ai.agents.models.VersionIndicator; @@ -75,11 +88,12 @@ public final class AgentsClient { * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -101,7 +115,7 @@ public final class AgentsClient { * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -155,7 +169,8 @@ public Response getAgentWithResponse(String agentName, RequestOption * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -168,7 +183,7 @@ public Response getAgentWithResponse(String agentName, RequestOption * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -195,11 +210,12 @@ public Response getAgentWithResponse(String agentName, RequestOption * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -317,11 +333,12 @@ public void deleteAgentVersion(String agentName, String agentVersion) { * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -444,7 +461,8 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -458,7 +476,7 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -476,7 +494,7 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -525,11 +543,12 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -551,7 +570,7 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -606,7 +625,8 @@ Response createAgentWithResponse(BinaryData createAgentRequest, Requ * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -619,7 +639,7 @@ Response createAgentWithResponse(BinaryData createAgentRequest, Requ * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -651,11 +671,12 @@ Response createAgentWithResponse(BinaryData createAgentRequest, Requ * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -677,7 +698,7 @@ Response createAgentWithResponse(BinaryData createAgentRequest, Requ * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -800,11 +821,12 @@ AgentDetails updateAgent(String agentName, AgentDefinition definition) { * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -826,7 +848,7 @@ AgentDetails updateAgent(String agentName, AgentDefinition definition) { * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -913,11 +935,12 @@ Response createAgentFromManifestWithResponse(BinaryData createAgentF * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -939,7 +962,7 @@ Response createAgentFromManifestWithResponse(BinaryData createAgentF * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -1022,11 +1045,12 @@ Response updateAgentFromManifestWithResponse(String agentName, * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1239,11 +1263,12 @@ public AgentVersionDetails createAgentVersionFromManifest(String agentName, Stri * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1393,7 +1418,7 @@ public PagedIterable listAgentVersions(String agentName, In * Query Parameters * NameTypeRequiredDescription * kindStringNoFilter agents by kind. If not provided, all agents are returned. - * Allowed values: "prompt", "hosted", "workflow". + * Allowed values: "prompt", "hosted", "workflow", "external". * limitIntegerNoA limit on the number of objects to be returned. Limit can range * between 1 and 100, and the * default is 20. @@ -1430,11 +1455,12 @@ public PagedIterable listAgentVersions(String agentName, In * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1456,7 +1482,7 @@ public PagedIterable listAgentVersions(String agentName, In * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -1565,6 +1591,14 @@ AgentDetails createAgentFromManifest(String agentName, String manifestId, Map * * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -1595,59 +1629,6 @@ public PagedIterable listAgentConversations(RequestOptions requestOp
         return this.serviceClient.listAgentConversations(requestOptions);
     }
 
-    /**
-     * Returns the list of all conversations.
-     *
-     * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the
-     * default is 20.
-     * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc`
-     * for descending order.
-     * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list.
-     * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
-     * subsequent call can include after=obj_foo in order to fetch the next page of the list.
-     * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list.
-     * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your
-     * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
-     * @param agentName Filter by agent name. If provided, only items associated with the specified agent will be
-     * returned.
-     * @param agentId Filter by agent ID in the format `name:version`. If provided, only items associated with the
-     * specified agent ID will be returned.
-     * @throws IllegalArgumentException thrown if parameters fail the validation.
-     * @throws HttpResponseException thrown if the request is rejected by server.
-     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
-     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
-     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
-     * @return the response data for a requested list of items as paginated response with {@link PagedIterable}.
-     */
-    @Generated
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedIterable listAgentConversations(Integer limit, PageOrder order, String after,
-        String before, String agentName, String agentId) {
-        // Generated convenience method for listAgentConversations
-        RequestOptions requestOptions = new RequestOptions();
-        if (limit != null) {
-            requestOptions.addQueryParam("limit", String.valueOf(limit), false);
-        }
-        if (order != null) {
-            requestOptions.addQueryParam("order", order.toString(), false);
-        }
-        if (after != null) {
-            requestOptions.addQueryParam("after", after, false);
-        }
-        if (before != null) {
-            requestOptions.addQueryParam("before", before, false);
-        }
-        if (agentName != null) {
-            requestOptions.addQueryParam("agent_name", agentName, false);
-        }
-        if (agentId != null) {
-            requestOptions.addQueryParam("agent_id", agentId, false);
-        }
-        return serviceClient.listAgentConversations(requestOptions)
-            .mapPage(bodyItemValue -> bodyItemValue.toObject(Conversation.class));
-    }
-
     /**
      * Returns the list of all conversations.
      *
@@ -1711,7 +1692,18 @@ public Response deleteAgentWithResponse(String agentName, RequestOptions r
     }
 
     /**
-     * Deletes an agent.
+     * Deletes an agent. For hosted agents, if any version has active sessions, the request
+     * is rejected with HTTP 409 unless `force` is set to true. When force is true, all
+     * associated sessions are cascade-deleted along with the agent and its versions.
+     * 

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the agent even if + * its versions have active sessions, cascading deletion to all associated sessions. The service defaults to `false` + * if a value is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
@@ -1739,7 +1731,18 @@ Response internalDeleteAgentWithResponse(String agentName, RequestOp
     }
 
     /**
-     * Deletes a specific version of an agent.
+     * Deletes a specific version of an agent. For hosted agents, if the version has active
+     * sessions, the request is rejected with HTTP 409 unless `force` is set to true. When
+     * force is true, all sessions associated with this version are cascade-deleted.
+     * 

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the version even if + * it has active sessions, cascading deletion to all associated sessions. The service defaults to `false` if a value + * is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
@@ -1769,69 +1772,6 @@ Response internalDeleteAgentVersionWithResponse(String agentName, St
         return this.serviceClient.internalDeleteAgentVersionWithResponse(agentName, agentVersion, 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.
-     * 

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     agent_session_id: String (Optional)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
-     * }
-     * }
-     * 
- * - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param createSessionRequest The createSessionRequest parameter. - * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with - * {@link Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSessionWithResponse(String agentName, String isolationKey, - BinaryData createSessionRequest, RequestOptions requestOptions) { - return this.serviceClient.createSessionWithResponse(agentName, isolationKey, createSessionRequest, - requestOptions); - } - /** * Retrieves a session by ID. *

Header Parameters

@@ -1840,7 +1780,10 @@ public Response createSessionWithResponse(String agentName, String i * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -1877,37 +1820,6 @@ public Response getSessionWithResponse(String agentName, String sess return this.serviceClient.getSessionWithResponse(agentName, sessionId, requestOptions); } - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
- * You can add these to a request with {@link RequestOptions#addHeader} - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @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 Response}. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSessionWithResponse(String agentName, String sessionId, String isolationKey, - RequestOptions requestOptions) { - return this.serviceClient.deleteSessionWithResponse(agentName, sessionId, isolationKey, requestOptions); - } - /** * Returns a list of sessions for the specified agent. *

Query Parameters

@@ -1936,7 +1848,10 @@ public Response deleteSessionWithResponse(String agentName, String session * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -2088,16 +2003,10 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition } /** - * 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. + * Retrieves a session by ID. * - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param versionIndicator Determines which agent version backs the session. - * @param agentSessionId Optional caller-provided session ID. If specified, it must be unique within the agent - * endpoint. Auto-generated if omitted. + * @param agentName The name of the agent. + * @param sessionId The session identifier. * @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. @@ -2108,251 +2017,67 @@ public AgentVersionDetails createAgentVersion(String agentName, AgentDefinition */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public AgentSessionResource createSession(String agentName, String isolationKey, VersionIndicator versionIndicator, - String agentSessionId) { - // Generated convenience method for createSessionWithResponse + public AgentSessionResource getSession(String agentName, String sessionId) { + // Generated convenience method for getSessionWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateSessionRequest createSessionRequestObj - = new CreateSessionRequest(versionIndicator).setAgentSessionId(agentSessionId); - BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); - return createSessionWithResponse(agentName, isolationKey, createSessionRequest, requestOptions).getValue() + return getSessionWithResponse(agentName, sessionId, requestOptions).getValue() .toObject(AgentSessionResource.class); } /** - * 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. + * Returns a list of sessions for the specified agent. * - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param versionIndicator Determines which agent version backs the session. + * @param agentName The name of the agent. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agent session providing a long-lived compute sandbox for hosted agent invocations. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentSessionResource createSession(String agentName, String isolationKey, - VersionIndicator versionIndicator) { - // Generated convenience method for createSessionWithResponse + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessions(String agentName) { + // Generated convenience method for listSessions RequestOptions requestOptions = new RequestOptions(); - CreateSessionRequest createSessionRequestObj = new CreateSessionRequest(versionIndicator); - BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); - return createSessionWithResponse(agentName, isolationKey, createSessionRequest, requestOptions).getValue() - .toObject(AgentSessionResource.class); + return serviceClient.listSessions(agentName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentSessionResource.class)); } /** - * Retrieves a session by ID. + * Streams console logs (stdout / stderr) for a specific hosted agent session as typed + * {@link SessionLogEvent} values. * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agent session providing a long-lived compute sandbox for hosted agent invocations. + * @param agentName The name of the hosted agent. + * @param agentVersion The version of the agent. + * @param sessionId The session ID (maps to an ADC sandbox). + * @return A stream of {@link SessionLogEvent} values emitted by the hosted agent session log stream. */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentSessionResource getSession(String agentName, String sessionId, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for getSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - return getSessionWithResponse(agentName, sessionId, requestOptions).getValue() - .toObject(AgentSessionResource.class); + @ServiceMethod(returns = ReturnType.COLLECTION) + public IterableStream getSessionLogStream(String agentName, String agentVersion, + String sessionId) { + RequestOptions requestOptions = new RequestOptions().setHeader(HttpHeaderName.fromString("Foundry-Features"), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW.toString()); + return getSessionLogStream(agentName, agentVersion, sessionId, requestOptions); } /** - * Retrieves a session by ID. + * Streams console logs (stdout / stderr) for a specific hosted agent session as typed + * {@link SessionLogEvent} values. * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an agent session providing a long-lived compute sandbox for hosted agent invocations. + * @param agentName The name of the hosted agent. + * @param agentVersion The version of the agent. + * @param sessionId The session ID (maps to an ADC sandbox). + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @return A stream of {@link SessionLogEvent} values emitted by the hosted agent session log stream. */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public AgentSessionResource getSession(String agentName, String sessionId) { - // Generated convenience method for getSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - return getSessionWithResponse(agentName, sessionId, requestOptions).getValue() - .toObject(AgentSessionResource.class); - } - - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSession(String agentName, String sessionId, String isolationKey, - AgentDefinitionOptInKeys foundryFeatures) { - // Generated convenience method for deleteSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - deleteSessionWithResponse(agentName, sessionId, isolationKey, requestOptions).getValue(); - } - - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSession(String agentName, String sessionId, String isolationKey) { - // Generated convenience method for deleteSessionWithResponse - RequestOptions requestOptions = new RequestOptions(); - deleteSessionWithResponse(agentName, sessionId, isolationKey, requestOptions).getValue(); - } - - /** - * Returns a list of sessions for the specified agent. - * - * @param agentName The name of the agent. - * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted - * preview resources. - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSessions(String agentName, AgentDefinitionOptInKeys foundryFeatures, - Integer limit, PageOrder order, String after, String before) { - // Generated convenience method for listSessions - RequestOptions requestOptions = new RequestOptions(); - if (foundryFeatures != null) { - requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); - } - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - return serviceClient.listSessions(agentName, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentSessionResource.class)); - } - - /** - * Returns a list of sessions for the specified agent. - * - * @param agentName The name of the agent. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSessions(String agentName) { - // Generated convenience method for listSessions - RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listSessions(agentName, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentSessionResource.class)); - } - - /** - * Streams console logs (stdout / stderr) for a specific hosted agent session as typed - * {@link SessionLogEvent} values. - * - * @param agentName The name of the hosted agent. - * @param agentVersion The version of the agent. - * @param sessionId The session ID (maps to an ADC sandbox). - * @return A stream of {@link SessionLogEvent} values emitted by the hosted agent session log stream. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream getSessionLogStream(String agentName, String agentVersion, - String sessionId) { - RequestOptions requestOptions = new RequestOptions().setHeader(HttpHeaderName.fromString("Foundry-Features"), - AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW.toString()); - return getSessionLogStream(agentName, agentVersion, sessionId, requestOptions); - } - - /** - * Streams console logs (stdout / stderr) for a specific hosted agent session as typed - * {@link SessionLogEvent} values. - * - * @param agentName The name of the hosted agent. - * @param agentVersion The version of the agent. - * @param sessionId The session ID (maps to an ADC sandbox). - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @return A stream of {@link SessionLogEvent} values emitted by the hosted agent session log stream. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public IterableStream getSessionLogStream(String agentName, String agentVersion, String sessionId, - RequestOptions requestOptions) { - return new IterableStream<>(SessionLogStreamHelper - .parse(getSessionLogStreamWithResponse(agentName, agentVersion, sessionId, requestOptions).getValue() - .toFluxByteBuffer())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public IterableStream getSessionLogStream(String agentName, String agentVersion, String sessionId, + RequestOptions requestOptions) { + return new IterableStream<>(SessionLogStreamHelper + .parse(getSessionLogStreamWithResponse(agentName, agentVersion, sessionId, requestOptions).getValue() + .toFluxByteBuffer())); } /** @@ -2389,7 +2114,8 @@ public IterableStream getSessionLogStream(String agentName, Str * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -2431,7 +2157,8 @@ public Response getSessionLogStreamWithResponse(String agentName, St * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -2449,7 +2176,7 @@ public Response getSessionLogStreamWithResponse(String agentName, St * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -2498,11 +2225,12 @@ public Response getSessionLogStreamWithResponse(String agentName, St * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -2524,7 +2252,7 @@ public Response getSessionLogStreamWithResponse(String agentName, St * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -2706,4 +2434,2898 @@ public AgentDetails updateAgentDetails(String agentName, UpdateAgentDetailsOptio return updateAgentDetailsWithResponse(agentName, patchAgentObjectRequestInBinaryData, requestOptions).getValue() .toObject(AgentDetails.class); } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response createAgentFromCodeWithResponse(String agentName, String codeZipSha256, BinaryData content, + RequestOptions requestOptions) { + // Operation 'createAgentFromCode' is of content-type 'multipart/form-data'. Protocol API is not usable and + // hence not generated. + return this.serviceClient.createAgentFromCodeWithResponse(agentName, codeZipSha256, content, requestOptions); + } + + /** + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateAgentFromCodeWithResponse(String agentName, String codeZipSha256, BinaryData content, + RequestOptions requestOptions) { + // Operation 'updateAgentFromCode' is of content-type 'multipart/form-data'. Protocol API is not usable and + // hence not generated. + return this.serviceClient.updateAgentFromCodeWithResponse(agentName, codeZipSha256, content, requestOptions); + } + + /** + * The createAgentVersionFromCode operation. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response createAgentVersionFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + // Operation 'createAgentVersionFromCode' is of content-type 'multipart/form-data'. Protocol API is not usable + // and hence not generated. + return this.serviceClient.createAgentVersionFromCodeWithResponse(agentName, codeZipSha256, content, + requestOptions); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
agent_versionStringNoThe version of the agent whose code zip should be + * downloaded. + * If omitted, the latest version's code zip is returned.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response downloadAgentCodeWithResponse(String agentName, RequestOptions requestOptions) { + return this.serviceClient.downloadAgentCodeWithResponse(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. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Optional)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to create a session for. + * @param createSessionRequest The createSessionRequest parameter. + * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createSessionWithResponse(String agentName, BinaryData createSessionRequest, + RequestOptions requestOptions) { + return this.serviceClient.createSessionWithResponse(agentName, createSessionRequest, requestOptions); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSessionWithResponse(String agentName, String sessionId, RequestOptions requestOptions) { + return this.serviceClient.deleteSessionWithResponse(agentName, sessionId, requestOptions); + } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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 foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AgentDetails createAgentFromCode(String agentName, String codeZipSha256, CreateAgentFromCodeContent content, + AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for createAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return createAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(AgentDetails.class); + } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + AgentDetails createAgentFromCode(String agentName, String codeZipSha256, CreateAgentFromCodeContent content) { + // Generated convenience method for createAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(AgentDetails.class); + } + + /** + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentDetails updateAgentFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content, AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for updateAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return updateAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(AgentDetails.class); + } + + /** + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentDetails updateAgentFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content) { + // Generated convenience method for updateAgentFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return updateAgentFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(AgentDetails.class); + } + + /** + * The createAgentVersionFromCode operation. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentVersionDetails createAgentVersionFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content, AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for createAgentVersionFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return createAgentVersionFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(AgentVersionDetails.class); + } + + /** + * The createAgentVersionFromCode operation. + * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentVersionDetails createAgentVersionFromCode(String agentName, String codeZipSha256, + CreateAgentVersionFromCodeContent content) { + // Generated convenience method for createAgentVersionFromCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createAgentVersionFromCodeWithResponse(agentName, codeZipSha256, + new MultipartFormDataHelper(requestOptions).serializeJsonField("metadata", content.getMetadata()) + .serializeFileField("code", content.getCode().getContent(), content.getCode().getContentType(), + content.getCode().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(AgentVersionDetails.class); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + * + * @param agentName The name of the agent. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData downloadAgentCode(String agentName) { + // Generated convenience method for downloadAgentCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return downloadAgentCodeWithResponse(agentName, requestOptions).getValue(); + } + + /** + * 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. + * + * @param agentName The name of the agent to create a session for. + * @param versionIndicator Determines which agent version backs the session. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an agent session providing a long-lived compute sandbox for hosted agent invocations. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentSessionResource createSession(String agentName, VersionIndicator versionIndicator) { + // Generated convenience method for createSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateSessionRequest createSessionRequestObj = new CreateSessionRequest(versionIndicator); + BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); + return createSessionWithResponse(agentName, createSessionRequest, requestOptions).getValue() + .toObject(AgentSessionResource.class); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSession(String agentName, String sessionId) { + // Generated convenience method for deleteSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteSessionWithResponse(agentName, sessionId, requestOptions).getValue(); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + * + * @param agentName The name of the agent. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param agentVersion The version of the agent whose code zip should be downloaded. + * If omitted, the latest version's code zip is returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData downloadAgentCode(String agentName, AgentDefinitionOptInKeys foundryFeatures, + String agentVersion) { + // Generated convenience method for downloadAgentCodeWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (agentVersion != null) { + requestOptions.addQueryParam("agent_version", agentVersion, false); + } + return downloadAgentCodeWithResponse(agentName, requestOptions).getValue(); + } + + /** + * Returns the list of all conversations. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @param agentName Filter by agent name. If provided, only items associated with the specified agent will be + * returned. + * @param agentId Filter by agent ID in the format `name:version`. If provided, only items associated with the + * specified agent ID will be returned. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAgentConversations(Integer limit, PageOrder order, String after, + String before, String agentName, String agentId, String userIsolationKey) { + // Generated convenience method for listAgentConversations + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (agentName != null) { + requestOptions.addQueryParam("agent_name", agentName, false); + } + if (agentId != null) { + requestOptions.addQueryParam("agent_id", agentId, false); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return serviceClient.listAgentConversations(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Conversation.class)); + } + + /** + * Returns the list of all conversations. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @param agentName Filter by agent name. If provided, only items associated with the specified agent will be + * returned. + * @param agentId Filter by agent ID in the format `name:version`. If provided, only items associated with the + * specified agent ID will be returned. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAgentConversations(Integer limit, PageOrder order, String after, + String before, String agentName, String agentId) { + // Generated convenience method for listAgentConversations + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (agentName != null) { + requestOptions.addQueryParam("agent_name", agentName, false); + } + if (agentId != null) { + requestOptions.addQueryParam("agent_id", agentId, false); + } + return serviceClient.listAgentConversations(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Conversation.class)); + } + + /** + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent (Required): {
+     *         agent_name: String (Required)
+     *         agent_version: String (Optional)
+     *     }
+     *     train_dataset_reference (Required): {
+     *         name: String (Required)
+     *         version: String (Optional)
+     *     }
+     *     validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *     evaluators (Optional): [
+     *         String (Optional)
+     *     ]
+     *     options (Optional): {
+     *         max_iterations: Integer (Optional)
+     *         optimization_config (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         eval_model: String (Optional)
+     *         optimization_model: String (Optional)
+     *         evaluation_level: String(turn/conversation) (Optional)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param inputs The optimization job inputs. + * @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 Response createOptimizationJobWithResponse(BinaryData inputs, RequestOptions requestOptions) { + return this.serviceClient.createOptimizationJobWithResponse(inputs, requestOptions); + } + + /** + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about an agent optimization job. + * + * Get an optimization job by id along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.getOptimizationJobWithResponse(jobId, requestOptions); + } + + /** + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
statusStringNoFilter to jobs in this lifecycle state. Allowed values: + * "queued", "in_progress", "succeeded", "failed", "cancelled".
agent_nameStringNoFilter to jobs targeting this agent name.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOptimizationJobs(RequestOptions requestOptions) { + return this.serviceClient.listOptimizationJobs(requestOptions); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 Response cancelOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelOptimizationJobWithResponse(jobId, requestOptions); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoWhen true, force-delete even if the job is in a non-terminal + * state.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.deleteOptimizationJobWithResponse(jobId, requestOptions); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     data (Required): [
+     *          (Required){
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Optional)
+     *     last_id: String (Optional)
+     *     has_more: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listOptimizationCandidatesWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.listOptimizationCandidatesWithResponse(jobId, requestOptions); + } + + /** + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     job_id: String (Required)
+     *     candidate_name: String (Required)
+     *     status: String (Required)
+     *     score: Double (Optional)
+     *     has_results: boolean (Required)
+     *     created_at: long (Required)
+     *     updated_at: long (Required)
+     *     promotion (Optional): {
+     *         promoted_at: long (Required)
+     *         agent_name: String (Required)
+     *         agent_version: String (Required)
+     *     }
+     *     files (Required): [
+     *          (Required){
+     *             path: String (Required)
+     *             type: String (Required)
+     *             size_bytes: long (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @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 a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOptimizationCandidateWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateWithResponse(jobId, candidateId, requestOptions); + } + + /** + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     instructions: String (Optional)
+     *     model: String (Optional)
+     *     temperature: Double (Optional)
+     *     skills (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @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 candidate deploy config. + * + * Get the candidate's deploy config JSON along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOptimizationCandidateConfigWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateConfigWithResponse(jobId, candidateId, requestOptions); + } + + /** + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     results (Required): [
+     *          (Required){
+     *             task_name: String (Required)
+     *             query: String (Optional)
+     *             scores (Required): {
+     *                 String: double (Required)
+     *             }
+     *             composite_score: double (Required)
+     *             tokens: long (Required)
+     *             duration_seconds: double (Required)
+     *             passed: boolean (Required)
+     *             error_message: String (Optional)
+     *             rationales (Optional): {
+     *                 String: String (Required)
+     *             }
+     *             response: String (Optional)
+     *             run_id: String (Optional)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @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 candidate evaluation results. + * + * Get full per-task evaluation results for a candidate along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOptimizationCandidateResultsWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateResultsWithResponse(jobId, candidateId, requestOptions); + } + + /** + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + * + * @param jobId The ID of the job. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an agent optimization job. + * + * Get an optimization job by id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OptimizationJob getOptimizationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationJobWithResponse(jobId, requestOptions).getValue().toObject(OptimizationJob.class); + } + + /** + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + * + * @param jobId The ID of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an agent optimization job. + * + * Get an optimization job by id. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OptimizationJob getOptimizationJob(String jobId) { + // Generated convenience method for getOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationJobWithResponse(jobId, requestOptions).getValue().toObject(OptimizationJob.class); + } + + /** + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @param status Filter to jobs in this lifecycle state. + * @param agentName Filter to jobs targeting this agent name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOptimizationJobs(FoundryFeaturesOptInKeys foundryFeatures, Integer limit, + PageOrder order, String after, String before, JobStatus status, String agentName) { + // Generated convenience method for listOptimizationJobs + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (status != null) { + requestOptions.addQueryParam("status", status.toString(), false); + } + if (agentName != null) { + requestOptions.addQueryParam("agent_name", agentName, false); + } + return serviceClient.listOptimizationJobs(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(OptimizationJob.class)); + } + + /** + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / 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. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOptimizationJobs() { + // Generated convenience method for listOptimizationJobs + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listOptimizationJobs(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(OptimizationJob.class)); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + * + * @param jobId The ID of the job to cancel. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 cancelOptimizationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for cancelOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return cancelOptimizationJobWithResponse(jobId, requestOptions).getValue().toObject(OptimizationJob.class); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + * + * @param jobId The ID of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 cancelOptimizationJob(String jobId) { + // Generated convenience method for cancelOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelOptimizationJobWithResponse(jobId, requestOptions).getValue().toObject(OptimizationJob.class); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * + * @param jobId The ID of the job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteOptimizationJob(String jobId) { + // Generated convenience method for deleteOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteOptimizationJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + * + * @param jobId The optimization job id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OptimizationCandidatePagedResult listOptimizationCandidates(String jobId, + FoundryFeaturesOptInKeys foundryFeatures, Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listOptimizationCandidatesWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return listOptimizationCandidatesWithResponse(jobId, requestOptions).getValue() + .toObject(OptimizationCandidatePagedResult.class); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + * + * @param jobId The optimization job id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public OptimizationCandidatePagedResult listOptimizationCandidates(String jobId) { + // Generated convenience method for listOptimizationCandidatesWithResponse + RequestOptions requestOptions = new RequestOptions(); + return listOptimizationCandidatesWithResponse(jobId, requestOptions).getValue() + .toObject(OptimizationCandidatePagedResult.class); + } + + /** + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CandidateMetadata getOptimizationCandidate(String jobId, String candidateId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateWithResponse(jobId, candidateId, requestOptions).getValue() + .toObject(CandidateMetadata.class); + } + + /** + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CandidateMetadata getOptimizationCandidate(String jobId, String candidateId) { + // Generated convenience method for getOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateWithResponse(jobId, candidateId, requestOptions).getValue() + .toObject(CandidateMetadata.class); + } + + /** + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate deploy config. + * + * Get the candidate's deploy config JSON. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CandidateDeployConfig getOptimizationCandidateConfig(String jobId, String candidateId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateConfigWithResponse(jobId, candidateId, requestOptions).getValue() + .toObject(CandidateDeployConfig.class); + } + + /** + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate deploy config. + * + * Get the candidate's deploy config JSON. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CandidateDeployConfig getOptimizationCandidateConfig(String jobId, String candidateId) { + // Generated convenience method for getOptimizationCandidateConfigWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateConfigWithResponse(jobId, candidateId, requestOptions).getValue() + .toObject(CandidateDeployConfig.class); + } + + /** + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CandidateResults getOptimizationCandidateResults(String jobId, String candidateId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateResultsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateResultsWithResponse(jobId, candidateId, requestOptions).getValue() + .toObject(CandidateResults.class); + } + + /** + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CandidateResults getOptimizationCandidateResults(String jobId, String candidateId) { + // Generated convenience method for getOptimizationCandidateResultsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateResultsWithResponse(jobId, candidateId, requestOptions).getValue() + .toObject(CandidateResults.class); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopSessionWithResponse(String agentName, String sessionId, RequestOptions requestOptions) { + return this.serviceClient.stopSessionWithResponse(agentName, sessionId, 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. + * + * @param agentName The name of the agent to create a session for. + * @param versionIndicator Determines which agent version backs the session. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @param agentSessionId Optional caller-provided session ID. If specified, it must be unique within the agent + * endpoint. Auto-generated if omitted. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an agent session providing a long-lived compute sandbox for hosted agent invocations. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentSessionResource createSession(String agentName, VersionIndicator versionIndicator, + String userIsolationKey, String agentSessionId) { + // Generated convenience method for createSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateSessionRequest createSessionRequestObj + = new CreateSessionRequest(versionIndicator).setAgentSessionId(agentSessionId); + BinaryData createSessionRequest = BinaryData.fromObject(createSessionRequestObj); + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return createSessionWithResponse(agentName, createSessionRequest, requestOptions).getValue() + .toObject(AgentSessionResource.class); + } + + /** + * Retrieves a session by ID. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return an agent session providing a long-lived compute sandbox for hosted agent invocations. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public AgentSessionResource getSession(String agentName, String sessionId, AgentDefinitionOptInKeys foundryFeatures, + String userIsolationKey) { + // Generated convenience method for getSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + return getSessionWithResponse(agentName, sessionId, requestOptions).getValue() + .toObject(AgentSessionResource.class); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSession(String agentName, String sessionId, AgentDefinitionOptInKeys foundryFeatures, + String userIsolationKey) { + // Generated convenience method for deleteSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + deleteSessionWithResponse(agentName, sessionId, requestOptions).getValue(); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopSession(String agentName, String sessionId, AgentDefinitionOptInKeys foundryFeatures) { + // Generated convenience method for stopSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + stopSessionWithResponse(agentName, sessionId, requestOptions).getValue(); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void stopSession(String agentName, String sessionId) { + // Generated convenience method for stopSessionWithResponse + RequestOptions requestOptions = new RequestOptions(); + stopSessionWithResponse(agentName, sessionId, requestOptions).getValue(); + } + + /** + * Returns a list of sessions for the specified agent. + * + * @param agentName The name of the agent. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param userIsolationKey Opaque per-user isolation key used to scope endpoint-scoped data (responses, + * conversations, sessions) to a specific end user. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessions(String agentName, AgentDefinitionOptInKeys foundryFeatures, + String userIsolationKey, Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listSessions + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (userIsolationKey != null) { + requestOptions.setHeader(HttpHeaderName.fromString("x-ms-user-isolation-key"), userIsolationKey); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listSessions(agentName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentSessionResource.class)); + } + + /** + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * + * @param inputs The optimization job inputs. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job + * unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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(OptimizationJobInputs inputs, FoundryFeaturesOptInKeys foundryFeatures, + String operationId) { + // Generated convenience method for createOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (operationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); + } + return createOptimizationJobWithResponse(BinaryData.fromObject(inputs), requestOptions).getValue() + .toObject(OptimizationJob.class); + } + + /** + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + * + * @param inputs The optimization job inputs. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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(OptimizationJobInputs inputs) { + // Generated convenience method for createOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createOptimizationJobWithResponse(BinaryData.fromObject(inputs), requestOptions).getValue() + .toObject(OptimizationJob.class); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + * + * @param jobId The ID of the job to delete. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param force When true, force-delete even if the job is in a non-terminal state. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteOptimizationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures, Boolean force) { + // Generated convenience method for deleteOptimizationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (force != null) { + requestOptions.addQueryParam("force", String.valueOf(force), false); + } + deleteOptimizationJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). + * @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 a candidate file. + * + * Stream a specific file from the candidate's blob directory along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getOptimizationCandidateFileWithResponse(String jobId, String candidateId, String path, + RequestOptions requestOptions) { + return this.serviceClient.getOptimizationCandidateFileWithResponse(jobId, candidateId, path, requestOptions); + } + + /** + * Promote a candidate. + * + * Promotes a candidate, recording the deployment timestamp and target agent version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     status: String (Required)
+     *     promoted_at: long (Required)
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @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 response after successfully promoting a candidate along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response promoteOptimizationCandidateWithResponse(String jobId, String candidateId, + BinaryData candidateRequest, RequestOptions requestOptions) { + return this.serviceClient.promoteOptimizationCandidateWithResponse(jobId, candidateId, candidateRequest, + requestOptions); + } + + /** + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate file. + * + * Stream a specific file from the candidate's blob directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getOptimizationCandidateFile(String jobId, String candidateId, String path, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getOptimizationCandidateFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getOptimizationCandidateFileWithResponse(jobId, candidateId, path, requestOptions).getValue(); + } + + /** + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a candidate file. + * + * Stream a specific file from the candidate's blob directory. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public BinaryData getOptimizationCandidateFile(String jobId, String candidateId, String path) { + // Generated convenience method for getOptimizationCandidateFileWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getOptimizationCandidateFileWithResponse(jobId, candidateId, path, requestOptions).getValue(); + } + + /** + * Promote a candidate. + * + * Promotes a candidate, recording the deployment timestamp and target agent version. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after successfully promoting a candidate. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PromoteCandidateResult promoteOptimizationCandidate(String jobId, String candidateId, + PromoteCandidateInput candidateRequest, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for promoteOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return promoteOptimizationCandidateWithResponse(jobId, candidateId, BinaryData.fromObject(candidateRequest), + requestOptions).getValue().toObject(PromoteCandidateResult.class); + } + + /** + * Promote a candidate. + * + * Promotes a candidate, recording the deployment timestamp and target agent version. + * + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response after successfully promoting a candidate. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PromoteCandidateResult promoteOptimizationCandidate(String jobId, String candidateId, + PromoteCandidateInput candidateRequest) { + // Generated convenience method for promoteOptimizationCandidateWithResponse + RequestOptions requestOptions = new RequestOptions(); + return promoteOptimizationCandidateWithResponse(jobId, candidateId, BinaryData.fromObject(candidateRequest), + requestOptions).getValue().toObject(PromoteCandidateResult.class); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java index 714f31b8f084..309f09e57d9e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java @@ -5,11 +5,16 @@ import com.azure.ai.agents.implementation.MemoryStoresImpl; import com.azure.ai.agents.implementation.OpenAIJsonHelper; +import com.azure.ai.agents.implementation.models.CreateMemoryRequest; import com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest; -import com.azure.ai.agents.implementation.models.InputItem; +import com.azure.ai.agents.implementation.models.ListMemoriesRequest; import com.azure.ai.agents.implementation.models.SearchMemoriesRequest; import com.azure.ai.agents.implementation.models.UpdateMemoriesRequest; +import com.azure.ai.agents.implementation.models.UpdateMemoryRequest; import com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest; +import com.azure.ai.agents.models.ListMemoriesOptions; +import com.azure.ai.agents.models.MemoryItem; +import com.azure.ai.agents.models.MemoryItemKind; import com.azure.ai.agents.models.MemorySearchOptions; import com.azure.ai.agents.models.MemoryStoreDefinition; import com.azure.ai.agents.models.MemoryStoreDetails; @@ -85,7 +90,7 @@ public final class MemoryStoresAsyncClient { *
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -137,7 +142,7 @@ public Mono> createMemoryStoreWithResponse(BinaryData creat
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -177,7 +182,7 @@ public Mono> updateMemoryStoreWithResponse(String name, Bin
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -235,7 +240,7 @@ public Mono> getMemoryStoreWithResponse(String name, Reques
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -307,7 +312,7 @@ public Mono> deleteMemoryStoreWithResponse(String name, RequestOp
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -678,9 +683,7 @@ public PagedFlux listMemoryStores(Integer limit, PageOrder o
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_search_id: String (Optional)
      *     options (Optional): {
@@ -699,7 +702,7 @@ public PagedFlux listMemoryStores(Integer limit, PageOrder o
      *     memories (Required): [
      *          (Required){
      *             memory_item (Required): {
-     *                 kind: String(user_profile/chat_summary) (Required)
+     *                 kind: String(user_profile/chat_summary/procedural) (Required)
      *                 memory_id: String (Required)
      *                 updated_at: long (Required)
      *                 scope: String (Required)
@@ -748,9 +751,7 @@ Mono> internalSearchMemoriesWithResponse(String name, Binar
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -771,7 +772,7 @@ Mono> internalSearchMemoriesWithResponse(String name, Binar
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -846,7 +847,7 @@ PollerFlux beginInternalUpdateMemories(String name, Bina
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    Mono internalSearchMemories(String name, String scope, List items,
+    Mono internalSearchMemories(String name, String scope, List items,
         String previousSearchId, MemorySearchOptions options) {
         // Generated convenience method for internalSearchMemoriesWithResponse
         RequestOptions requestOptions = new RequestOptions();
@@ -879,7 +880,7 @@ Mono internalSearchMemories(String name, String scope
     public Mono searchMemories(String name, String scope, List items,
         String previousSearchId, MemorySearchOptions options) {
         // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
-        List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+        List inputItems = OpenAIJsonHelper.toBinaryDataList(items);
         return internalSearchMemories(name, scope, inputItems, previousSearchId, options);
     }
 
@@ -930,7 +931,7 @@ Mono internalSearchMemories(String name, String scope
     @Generated
     @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
     PollerFlux beginInternalUpdateMemories(String name,
-        String scope, List items, String previousUpdateId, Integer updateDelay) {
+        String scope, List items, String previousUpdateId, Integer updateDelay) {
         // Generated convenience method for beginInternalUpdateMemoriesWithModel
         RequestOptions requestOptions = new RequestOptions();
         UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items)
@@ -988,7 +989,7 @@ PollerFlux beginInt
     public PollerFlux beginUpdateMemories(String name,
         String scope, List items, String previousUpdateId, int updateDelayInSeconds) {
         // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
-        List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+        List inputItems = OpenAIJsonHelper.toBinaryDataList(items);
         return beginInternalUpdateMemories(name, scope, inputItems, previousUpdateId, updateDelayInSeconds);
     }
 
@@ -1018,7 +1019,7 @@ public PollerFlux b
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     deleted: boolean (Required)
      * }
@@ -1056,7 +1057,7 @@ Mono> internalDeleteMemoryStoreWithResponse(String name, Re
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     scope: String (Required)
      *     deleted: boolean (Required)
@@ -1080,4 +1081,391 @@ Mono> internalDeleteScopeWithResponse(String name, BinaryDa
         RequestOptions requestOptions) {
         return this.serviceClient.internalDeleteScopeWithResponseAsync(name, deleteScopeRequest, requestOptions);
     }
+
+    /**
+     * Create a memory item in a memory store.
+     * 

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     *     content: String (Required)
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param createMemoryRequest The createMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMemoryWithResponse(String name, BinaryData createMemoryRequest, + RequestOptions requestOptions) { + return this.serviceClient.createMemoryWithResponseAsync(name, createMemoryRequest, requestOptions); + } + + /** + * Update a memory item in a memory store. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to update. + * @param updateMemoryRequest The updateMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateMemoryWithResponse(String name, String memoryId, + BinaryData updateMemoryRequest, RequestOptions requestOptions) { + return this.serviceClient.updateMemoryWithResponseAsync(name, memoryId, updateMemoryRequest, requestOptions); + } + + /** + * Retrieve a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single memory item stored in the memory store, containing content and metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMemoryWithResponse(String name, String memoryId, + RequestOptions requestOptions) { + return this.serviceClient.getMemoryWithResponseAsync(name, memoryId, requestOptions); + } + + /** + * Delete a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
+     *     memory_id: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @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 response for deleting a memory item from a memory store along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> internalDeleteMemoryWithResponse(String name, String memoryId, + RequestOptions requestOptions) { + return this.serviceClient.internalDeleteMemoryWithResponseAsync(name, memoryId, requestOptions); + } + + /** + * Create a memory item in a memory store. + * + * @param name The name of the memory store. + * @param scope The namespace that logically groups and isolates memories, such as a user ID. + * @param content The content of the memory. + * @param kind The kind of the memory item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single memory item stored in the memory store, containing content and metadata on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createMemory(String name, String scope, String content, MemoryItemKind kind) { + // Generated convenience method for createMemoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateMemoryRequest createMemoryRequestObj = new CreateMemoryRequest(scope, content, kind); + BinaryData createMemoryRequest = BinaryData.fromObject(createMemoryRequestObj); + return createMemoryWithResponse(name, createMemoryRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MemoryItem.class)); + } + + /** + * Update a memory item in a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to update. + * @param content The updated content of the memory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single memory item stored in the memory store, containing content and metadata on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateMemory(String name, String memoryId, String content) { + // Generated convenience method for updateMemoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateMemoryRequest updateMemoryRequestObj = new UpdateMemoryRequest(content); + BinaryData updateMemoryRequest = BinaryData.fromObject(updateMemoryRequestObj); + return updateMemoryWithResponse(name, memoryId, updateMemoryRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MemoryItem.class)); + } + + /** + * Retrieve a memory item from a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single memory item stored in the memory store, containing content and metadata on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMemory(String name, String memoryId) { + // Generated convenience method for getMemoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMemoryWithResponse(name, memoryId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(MemoryItem.class)); + } + + /** + * Delete a memory item from a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for deleting a memory item from a memory store on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteMemoryWithResponse(String name, String memoryId, RequestOptions requestOptions) { + return internalDeleteMemoryWithResponse(name, memoryId, requestOptions) + .map(response -> new SimpleResponse<>(response, null)); + } + + /** + * Delete a memory item from a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a {@link Mono} that completes when the memory item is deleted. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteMemory(String name, String memoryId) { + RequestOptions requestOptions = new RequestOptions(); + return deleteMemoryWithResponse(name, memoryId, requestOptions).then(); + } + + /** + * List all memory items in a memory store. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoThe kind of the memory item. Allowed values: "user_profile", + * "chat_summary", "procedural".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param listMemoriesRequest The listMemoriesRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMemories(String name, BinaryData listMemoriesRequest, + RequestOptions requestOptions) { + return this.serviceClient.listMemoriesAsync(name, listMemoriesRequest, requestOptions); + } + + /** + * List all memory items in a memory store. + * + * @param options Options for listMemories API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMemories(ListMemoriesOptions options) { + // Generated convenience method for listMemories + RequestOptions requestOptions = new RequestOptions(); + String name = options.getName(); + MemoryItemKind kind = options.getKind(); + Integer limit = options.getLimit(); + PageOrder order = options.getOrder(); + String after = options.getAfter(); + String before = options.getBefore(); + ListMemoriesRequest listMemoriesRequestObj = new ListMemoriesRequest(options.getScope()); + BinaryData listMemoriesRequest = BinaryData.fromObject(listMemoriesRequestObj); + if (kind != null) { + requestOptions.addQueryParam("kind", kind.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listMemories(name, listMemoriesRequest, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(MemoryItem.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java index ed14d4fccbc8..bdb5a70803dc 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java @@ -5,11 +5,16 @@ import com.azure.ai.agents.implementation.MemoryStoresImpl; import com.azure.ai.agents.implementation.OpenAIJsonHelper; +import com.azure.ai.agents.implementation.models.CreateMemoryRequest; import com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest; -import com.azure.ai.agents.implementation.models.InputItem; +import com.azure.ai.agents.implementation.models.ListMemoriesRequest; import com.azure.ai.agents.implementation.models.SearchMemoriesRequest; import com.azure.ai.agents.implementation.models.UpdateMemoriesRequest; +import com.azure.ai.agents.implementation.models.UpdateMemoryRequest; import com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest; +import com.azure.ai.agents.models.ListMemoriesOptions; +import com.azure.ai.agents.models.MemoryItem; +import com.azure.ai.agents.models.MemoryItemKind; import com.azure.ai.agents.models.MemorySearchOptions; import com.azure.ai.agents.models.MemoryStoreDefinition; import com.azure.ai.agents.models.MemoryStoreDetails; @@ -79,7 +84,7 @@ public final class MemoryStoresClient { *
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -130,7 +135,7 @@ public Response createMemoryStoreWithResponse(BinaryData createMemor
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -169,7 +174,7 @@ public Response updateMemoryStoreWithResponse(String name, BinaryDat
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -226,7 +231,7 @@ public Response getMemoryStoreWithResponse(String name, RequestOptio
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -297,7 +302,7 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOptions
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -643,9 +648,7 @@ public PagedIterable listMemoryStores(Integer limit, PageOrd
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_search_id: String (Optional)
      *     options (Optional): {
@@ -664,7 +667,7 @@ public PagedIterable listMemoryStores(Integer limit, PageOrd
      *     memories (Required): [
      *          (Required){
      *             memory_item (Required): {
-     *                 kind: String(user_profile/chat_summary) (Required)
+     *                 kind: String(user_profile/chat_summary/procedural) (Required)
      *                 memory_id: String (Required)
      *                 updated_at: long (Required)
      *                 scope: String (Required)
@@ -713,9 +716,7 @@ Response internalSearchMemoriesWithResponse(String name, BinaryData
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -736,7 +737,7 @@ Response internalSearchMemoriesWithResponse(String name, BinaryData
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -811,7 +812,7 @@ SyncPoller beginInternalUpdateMemories(String name, Bina
      */
     @Generated
     @ServiceMethod(returns = ReturnType.SINGLE)
-    MemoryStoreSearchResponse internalSearchMemories(String name, String scope, List items,
+    MemoryStoreSearchResponse internalSearchMemories(String name, String scope, List items,
         String previousSearchId, MemorySearchOptions options) {
         // Generated convenience method for internalSearchMemoriesWithResponse
         RequestOptions requestOptions = new RequestOptions();
@@ -868,7 +869,7 @@ MemoryStoreSearchResponse internalSearchMemories(String name, String scope) {
     public MemoryStoreSearchResponse searchMemories(String name, String scope, List items,
         String previousSearchId, MemorySearchOptions options) {
         // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
-        List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+        List inputItems = OpenAIJsonHelper.toBinaryDataList(items);
         return internalSearchMemories(name, scope, inputItems, previousSearchId, options);
     }
 
@@ -895,7 +896,7 @@ public MemoryStoreSearchResponse searchMemories(String name, String scope, List<
     @Generated
     @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
     SyncPoller beginInternalUpdateMemories(String name,
-        String scope, List items, String previousUpdateId, Integer updateDelay) {
+        String scope, List items, String previousUpdateId, Integer updateDelay) {
         // Generated convenience method for beginInternalUpdateMemoriesWithModel
         RequestOptions requestOptions = new RequestOptions();
         UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items)
@@ -953,7 +954,7 @@ SyncPoller beginInt
     public SyncPoller beginUpdateMemories(String name,
         String scope, List items, String previousUpdateId, int updateDelayInSeconds) {
         // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list
-        List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson);
+        List inputItems = OpenAIJsonHelper.toBinaryDataList(items);
         return beginInternalUpdateMemories(name, scope, inputItems, previousUpdateId, updateDelayInSeconds);
     }
 
@@ -983,7 +984,7 @@ public SyncPoller b
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     deleted: boolean (Required)
      * }
@@ -1021,7 +1022,7 @@ Response internalDeleteMemoryStoreWithResponse(String name, RequestO
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     scope: String (Required)
      *     deleted: boolean (Required)
@@ -1044,4 +1045,371 @@ Response internalDeleteScopeWithResponse(String name, BinaryData del
         RequestOptions requestOptions) {
         return this.serviceClient.internalDeleteScopeWithResponse(name, deleteScopeRequest, requestOptions);
     }
+
+    /**
+     * Create a memory item in a memory store.
+     * 

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     *     content: String (Required)
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param createMemoryRequest The createMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMemoryWithResponse(String name, BinaryData createMemoryRequest, + RequestOptions requestOptions) { + return this.serviceClient.createMemoryWithResponse(name, createMemoryRequest, requestOptions); + } + + /** + * Update a memory item in a memory store. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to update. + * @param updateMemoryRequest The updateMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateMemoryWithResponse(String name, String memoryId, BinaryData updateMemoryRequest, + RequestOptions requestOptions) { + return this.serviceClient.updateMemoryWithResponse(name, memoryId, updateMemoryRequest, requestOptions); + } + + /** + * Retrieve a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single memory item stored in the memory store, containing content and metadata along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMemoryWithResponse(String name, String memoryId, RequestOptions requestOptions) { + return this.serviceClient.getMemoryWithResponse(name, memoryId, requestOptions); + } + + /** + * Delete a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
+     *     memory_id: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @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 response for deleting a memory item from a memory store along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response internalDeleteMemoryWithResponse(String name, String memoryId, RequestOptions requestOptions) { + return this.serviceClient.internalDeleteMemoryWithResponse(name, memoryId, requestOptions); + } + + /** + * Create a memory item in a memory store. + * + * @param name The name of the memory store. + * @param scope The namespace that logically groups and isolates memories, such as a user ID. + * @param content The content of the memory. + * @param kind The kind of the memory item. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single memory item stored in the memory store, containing content and metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MemoryItem createMemory(String name, String scope, String content, MemoryItemKind kind) { + // Generated convenience method for createMemoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateMemoryRequest createMemoryRequestObj = new CreateMemoryRequest(scope, content, kind); + BinaryData createMemoryRequest = BinaryData.fromObject(createMemoryRequestObj); + return createMemoryWithResponse(name, createMemoryRequest, requestOptions).getValue() + .toObject(MemoryItem.class); + } + + /** + * Update a memory item in a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to update. + * @param content The updated content of the memory. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single memory item stored in the memory store, containing content and metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MemoryItem updateMemory(String name, String memoryId, String content) { + // Generated convenience method for updateMemoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + UpdateMemoryRequest updateMemoryRequestObj = new UpdateMemoryRequest(content); + BinaryData updateMemoryRequest = BinaryData.fromObject(updateMemoryRequestObj); + return updateMemoryWithResponse(name, memoryId, updateMemoryRequest, requestOptions).getValue() + .toObject(MemoryItem.class); + } + + /** + * Retrieve a memory item from a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a single memory item stored in the memory store, containing content and metadata. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public MemoryItem getMemory(String name, String memoryId) { + // Generated convenience method for getMemoryWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getMemoryWithResponse(name, memoryId, requestOptions).getValue().toObject(MemoryItem.class); + } + + /** + * Delete a memory item from a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response for deleting a memory item from a memory store. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteMemoryWithResponse(String name, String memoryId, RequestOptions requestOptions) { + return new SimpleResponse<>(internalDeleteMemoryWithResponse(name, memoryId, requestOptions), null); + } + + /** + * Delete a memory item from a memory store. + * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMemory(String name, String memoryId) { + RequestOptions requestOptions = new RequestOptions(); + deleteMemoryWithResponse(name, memoryId, requestOptions); + } + + /** + * List all memory items in a memory store. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoThe kind of the memory item. Allowed values: "user_profile", + * "chat_summary", "procedural".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param listMemoriesRequest The listMemoriesRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMemories(String name, BinaryData listMemoriesRequest, + RequestOptions requestOptions) { + return this.serviceClient.listMemories(name, listMemoriesRequest, requestOptions); + } + + /** + * List all memory items in a memory store. + * + * @param options Options for listMemories API. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMemories(ListMemoriesOptions options) { + // Generated convenience method for listMemories + RequestOptions requestOptions = new RequestOptions(); + String name = options.getName(); + MemoryItemKind kind = options.getKind(); + Integer limit = options.getLimit(); + PageOrder order = options.getOrder(); + String after = options.getAfter(); + String before = options.getBefore(); + ListMemoriesRequest listMemoriesRequestObj = new ListMemoriesRequest(options.getScope()); + BinaryData listMemoriesRequest = BinaryData.fromObject(listMemoriesRequestObj); + if (kind != null) { + requestOptions.addQueryParam("kind", kind.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listMemories(name, listMemoriesRequest, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(MemoryItem.class)); + } } 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 5d90fd4b70a8..015a007274aa 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 @@ -10,6 +10,7 @@ import com.azure.ai.agents.models.Tool; import com.azure.ai.agents.models.ToolboxDetails; import com.azure.ai.agents.models.ToolboxPolicies; +import com.azure.ai.agents.models.ToolboxSkill; import com.azure.ai.agents.models.ToolboxVersionDetails; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -64,7 +65,12 @@ public final class ToolboxesAsyncClient { * } * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -91,7 +97,12 @@ public final class ToolboxesAsyncClient { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -103,7 +114,7 @@ public final class ToolboxesAsyncClient { * } *
* - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param createToolboxVersionRequest The createToolboxVersionRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -114,9 +125,9 @@ public final class ToolboxesAsyncClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createToolboxVersionWithResponse(String toolboxName, + public Mono> createToolboxVersionWithResponse(String name, BinaryData createToolboxVersionRequest, RequestOptions requestOptions) { - return this.serviceClient.createToolboxVersionWithResponseAsync(toolboxName, createToolboxVersionRequest, + return this.serviceClient.createToolboxVersionWithResponseAsync(name, createToolboxVersionRequest, requestOptions); } @@ -134,7 +145,7 @@ public Mono> createToolboxVersionWithResponse(String toolbo * } *
* - * @param toolboxName The name of the toolbox to retrieve. + * @param name The name of the toolbox to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -145,8 +156,8 @@ public Mono> createToolboxVersionWithResponse(String toolbo */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getToolboxWithResponse(String toolboxName, RequestOptions requestOptions) { - return this.serviceClient.getToolboxWithResponseAsync(toolboxName, requestOptions); + public Mono> getToolboxWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getToolboxWithResponseAsync(name, requestOptions); } /** @@ -233,7 +244,12 @@ public PagedFlux listToolboxes(RequestOptions requestOptions) { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -245,7 +261,7 @@ public PagedFlux listToolboxes(RequestOptions requestOptions) { * } *
* - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -255,8 +271,8 @@ public PagedFlux listToolboxes(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listToolboxVersions(String toolboxName, RequestOptions requestOptions) { - return this.serviceClient.listToolboxVersionsAsync(toolboxName, requestOptions); + public PagedFlux listToolboxVersions(String name, RequestOptions requestOptions) { + return this.serviceClient.listToolboxVersionsAsync(name, requestOptions); } /** @@ -276,7 +292,12 @@ public PagedFlux listToolboxVersions(String toolboxName, RequestOpti * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -288,7 +309,7 @@ public PagedFlux listToolboxVersions(String toolboxName, RequestOpti * } *
* - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -299,9 +320,9 @@ public PagedFlux listToolboxVersions(String toolboxName, RequestOpti */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getToolboxVersionWithResponse(String toolboxName, String version, + public Mono> getToolboxVersionWithResponse(String name, String version, RequestOptions requestOptions) { - return this.serviceClient.getToolboxVersionWithResponseAsync(toolboxName, version, requestOptions); + return this.serviceClient.getToolboxVersionWithResponseAsync(name, version, requestOptions); } /** @@ -328,7 +349,7 @@ public Mono> getToolboxVersionWithResponse(String toolboxNa * } *
* - * @param toolboxName The name of the toolbox to update. + * @param name The name of the toolbox to update. * @param updateToolboxRequest The updateToolboxRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -340,15 +361,15 @@ public Mono> getToolboxVersionWithResponse(String toolboxNa */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateToolboxWithResponse(String toolboxName, BinaryData updateToolboxRequest, + public Mono> updateToolboxWithResponse(String name, BinaryData updateToolboxRequest, RequestOptions requestOptions) { - return this.serviceClient.updateToolboxWithResponseAsync(toolboxName, updateToolboxRequest, requestOptions); + return this.serviceClient.updateToolboxWithResponseAsync(name, updateToolboxRequest, requestOptions); } /** * Delete a toolbox and all its versions. * - * @param toolboxName The name of the toolbox to delete. + * @param name The name of the toolbox to delete. * @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. @@ -358,14 +379,14 @@ public Mono> updateToolboxWithResponse(String toolboxName, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteToolboxWithResponse(String toolboxName, RequestOptions requestOptions) { - return this.serviceClient.deleteToolboxWithResponseAsync(toolboxName, requestOptions); + public Mono> deleteToolboxWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteToolboxWithResponseAsync(name, requestOptions); } /** * Delete a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -376,18 +397,20 @@ public Mono> deleteToolboxWithResponse(String toolboxName, Reques */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteToolboxVersionWithResponse(String toolboxName, String version, + public Mono> deleteToolboxVersionWithResponse(String name, String version, RequestOptions requestOptions) { - return this.serviceClient.deleteToolboxVersionWithResponseAsync(toolboxName, version, requestOptions); + return this.serviceClient.deleteToolboxVersionWithResponseAsync(name, version, requestOptions); } /** * Create a new version of a toolbox. If the toolbox does not exist, it will be created. * - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param tools The list of tools to include in this version. * @param description A human-readable description of the toolbox. * @param metadata Arbitrary key-value metadata to associate with the toolbox. + * @param skills The list of skill sources to include in this version. A skill reference specifies a skill name and + * optionally a version. If version is omitted, the skill's default version is used. * @param policies Policy configuration for this toolbox version. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -399,16 +422,17 @@ public Mono> deleteToolboxVersionWithResponse(String toolboxName, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createToolboxVersion(String toolboxName, List tools, String description, - Map metadata, ToolboxPolicies policies) { + public Mono createToolboxVersion(String name, List tools, String description, + Map metadata, List skills, ToolboxPolicies policies) { // Generated convenience method for createToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); CreateToolboxVersionRequest createToolboxVersionRequestObj = new CreateToolboxVersionRequest(tools).setDescription(description) .setMetadata(metadata) + .setSkills(skills) .setPolicies(policies); BinaryData createToolboxVersionRequest = BinaryData.fromObject(createToolboxVersionRequestObj); - return createToolboxVersionWithResponse(toolboxName, createToolboxVersionRequest, requestOptions) + return createToolboxVersionWithResponse(name, createToolboxVersionRequest, requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ToolboxVersionDetails.class)); } @@ -416,7 +440,7 @@ public Mono createToolboxVersion(String toolboxName, List /** * Create a new version of a toolbox. If the toolbox does not exist, it will be created. * - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param tools The list of tools to include in this version. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -428,12 +452,12 @@ public Mono createToolboxVersion(String toolboxName, List */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createToolboxVersion(String toolboxName, List tools) { + public Mono createToolboxVersion(String name, List tools) { // Generated convenience method for createToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); CreateToolboxVersionRequest createToolboxVersionRequestObj = new CreateToolboxVersionRequest(tools); BinaryData createToolboxVersionRequest = BinaryData.fromObject(createToolboxVersionRequestObj); - return createToolboxVersionWithResponse(toolboxName, createToolboxVersionRequest, requestOptions) + return createToolboxVersionWithResponse(name, createToolboxVersionRequest, requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ToolboxVersionDetails.class)); } @@ -441,7 +465,7 @@ public Mono createToolboxVersion(String toolboxName, List /** * Retrieve a toolbox. * - * @param toolboxName The name of the toolbox to retrieve. + * @param name The name of the toolbox to retrieve. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -452,10 +476,10 @@ public Mono createToolboxVersion(String toolboxName, List */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getToolbox(String toolboxName) { + public Mono getToolbox(String name) { // Generated convenience method for getToolboxWithResponse RequestOptions requestOptions = new RequestOptions(); - return getToolboxWithResponse(toolboxName, requestOptions).flatMap(FluxUtil::toMono) + return getToolboxWithResponse(name, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ToolboxDetails.class)); } @@ -545,7 +569,7 @@ public PagedFlux listToolboxes() { /** * List all versions of a toolbox. * - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 20. * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` @@ -566,7 +590,7 @@ public PagedFlux listToolboxes() { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listToolboxVersions(String toolboxName, Integer limit, PageOrder order, + public PagedFlux listToolboxVersions(String name, Integer limit, PageOrder order, String after, String before) { // Generated convenience method for listToolboxVersions RequestOptions requestOptions = new RequestOptions(); @@ -582,7 +606,7 @@ public PagedFlux listToolboxVersions(String toolboxName, if (before != null) { requestOptions.addQueryParam("before", before, false); } - PagedFlux pagedFluxResponse = listToolboxVersions(toolboxName, requestOptions); + PagedFlux pagedFluxResponse = listToolboxVersions(name, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) @@ -601,7 +625,7 @@ public PagedFlux listToolboxVersions(String toolboxName, /** * List all versions of a toolbox. * - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -612,10 +636,10 @@ public PagedFlux listToolboxVersions(String toolboxName, */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listToolboxVersions(String toolboxName) { + public PagedFlux listToolboxVersions(String name) { // Generated convenience method for listToolboxVersions RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listToolboxVersions(toolboxName, requestOptions); + PagedFlux pagedFluxResponse = listToolboxVersions(name, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) @@ -634,7 +658,7 @@ public PagedFlux listToolboxVersions(String toolboxName) /** * Retrieve a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to retrieve. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -646,17 +670,17 @@ public PagedFlux listToolboxVersions(String toolboxName) */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getToolboxVersion(String toolboxName, String version) { + public Mono getToolboxVersion(String name, String version) { // Generated convenience method for getToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return getToolboxVersionWithResponse(toolboxName, version, requestOptions).flatMap(FluxUtil::toMono) + return getToolboxVersionWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ToolboxVersionDetails.class)); } /** * Update a toolbox to point to a specific version. * - * @param toolboxName The name of the toolbox to update. + * @param name The name of the toolbox to update. * @param defaultVersion The version identifier that the toolbox should point to. When set, the toolbox's default * version will resolve to this version instead of the latest. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -669,19 +693,19 @@ public Mono getToolboxVersion(String toolboxName, String */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateToolbox(String toolboxName, String defaultVersion) { + public Mono updateToolbox(String name, String defaultVersion) { // Generated convenience method for updateToolboxWithResponse RequestOptions requestOptions = new RequestOptions(); UpdateToolboxRequest updateToolboxRequestObj = new UpdateToolboxRequest(defaultVersion); BinaryData updateToolboxRequest = BinaryData.fromObject(updateToolboxRequestObj); - return updateToolboxWithResponse(toolboxName, updateToolboxRequest, requestOptions).flatMap(FluxUtil::toMono) + return updateToolboxWithResponse(name, updateToolboxRequest, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(ToolboxDetails.class)); } /** * Delete a toolbox and all its versions. * - * @param toolboxName The name of the toolbox to delete. + * @param name The name of the toolbox to delete. * @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. @@ -692,16 +716,16 @@ public Mono updateToolbox(String toolboxName, String defaultVers */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteToolbox(String toolboxName) { + public Mono deleteToolbox(String name) { // Generated convenience method for deleteToolboxWithResponse RequestOptions requestOptions = new RequestOptions(); - return deleteToolboxWithResponse(toolboxName, requestOptions).flatMap(FluxUtil::toMono); + return deleteToolboxWithResponse(name, requestOptions).flatMap(FluxUtil::toMono); } /** * Delete a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -713,9 +737,9 @@ public Mono deleteToolbox(String toolboxName) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteToolboxVersion(String toolboxName, String version) { + public Mono deleteToolboxVersion(String name, String version) { // Generated convenience method for deleteToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return deleteToolboxVersionWithResponse(toolboxName, version, requestOptions).flatMap(FluxUtil::toMono); + return deleteToolboxVersionWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono); } } 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 890d5d655491..2be515c98fd3 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 @@ -10,6 +10,7 @@ import com.azure.ai.agents.models.Tool; import com.azure.ai.agents.models.ToolboxDetails; import com.azure.ai.agents.models.ToolboxPolicies; +import com.azure.ai.agents.models.ToolboxSkill; import com.azure.ai.agents.models.ToolboxVersionDetails; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; @@ -58,7 +59,12 @@ public final class ToolboxesClient { * } * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -85,7 +91,12 @@ public final class ToolboxesClient { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -97,7 +108,7 @@ public final class ToolboxesClient { * } *
* - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param createToolboxVersionRequest The createToolboxVersionRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -108,10 +119,9 @@ public final class ToolboxesClient { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createToolboxVersionWithResponse(String toolboxName, - BinaryData createToolboxVersionRequest, RequestOptions requestOptions) { - return this.serviceClient.createToolboxVersionWithResponse(toolboxName, createToolboxVersionRequest, - requestOptions); + public Response createToolboxVersionWithResponse(String name, BinaryData createToolboxVersionRequest, + RequestOptions requestOptions) { + return this.serviceClient.createToolboxVersionWithResponse(name, createToolboxVersionRequest, requestOptions); } /** @@ -128,7 +138,7 @@ public Response createToolboxVersionWithResponse(String toolboxName, * } *
* - * @param toolboxName The name of the toolbox to retrieve. + * @param name The name of the toolbox to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -138,8 +148,8 @@ public Response createToolboxVersionWithResponse(String toolboxName, */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getToolboxWithResponse(String toolboxName, RequestOptions requestOptions) { - return this.serviceClient.getToolboxWithResponse(toolboxName, requestOptions); + public Response getToolboxWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getToolboxWithResponse(name, requestOptions); } /** @@ -226,7 +236,12 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -238,7 +253,7 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * } *
* - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -248,8 +263,8 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listToolboxVersions(String toolboxName, RequestOptions requestOptions) { - return this.serviceClient.listToolboxVersions(toolboxName, requestOptions); + public PagedIterable listToolboxVersions(String name, RequestOptions requestOptions) { + return this.serviceClient.listToolboxVersions(name, requestOptions); } /** @@ -269,7 +284,12 @@ public PagedIterable listToolboxVersions(String toolboxName, Request * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -281,7 +301,7 @@ public PagedIterable listToolboxVersions(String toolboxName, Request * } *
* - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -292,9 +312,9 @@ public PagedIterable listToolboxVersions(String toolboxName, Request */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getToolboxVersionWithResponse(String toolboxName, String version, + public Response getToolboxVersionWithResponse(String name, String version, RequestOptions requestOptions) { - return this.serviceClient.getToolboxVersionWithResponse(toolboxName, version, requestOptions); + return this.serviceClient.getToolboxVersionWithResponse(name, version, requestOptions); } /** @@ -321,7 +341,7 @@ public Response getToolboxVersionWithResponse(String toolboxName, St * } *
* - * @param toolboxName The name of the toolbox to update. + * @param name The name of the toolbox to update. * @param updateToolboxRequest The updateToolboxRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -332,15 +352,15 @@ public Response getToolboxVersionWithResponse(String toolboxName, St */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateToolboxWithResponse(String toolboxName, BinaryData updateToolboxRequest, + public Response updateToolboxWithResponse(String name, BinaryData updateToolboxRequest, RequestOptions requestOptions) { - return this.serviceClient.updateToolboxWithResponse(toolboxName, updateToolboxRequest, requestOptions); + return this.serviceClient.updateToolboxWithResponse(name, updateToolboxRequest, requestOptions); } /** * Delete a toolbox and all its versions. * - * @param toolboxName The name of the toolbox to delete. + * @param name The name of the toolbox to delete. * @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. @@ -350,14 +370,14 @@ public Response updateToolboxWithResponse(String toolboxName, Binary */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteToolboxWithResponse(String toolboxName, RequestOptions requestOptions) { - return this.serviceClient.deleteToolboxWithResponse(toolboxName, requestOptions); + public Response deleteToolboxWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.deleteToolboxWithResponse(name, requestOptions); } /** * Delete a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -368,18 +388,19 @@ public Response deleteToolboxWithResponse(String toolboxName, RequestOptio */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteToolboxVersionWithResponse(String toolboxName, String version, - RequestOptions requestOptions) { - return this.serviceClient.deleteToolboxVersionWithResponse(toolboxName, version, requestOptions); + public Response deleteToolboxVersionWithResponse(String name, String version, RequestOptions requestOptions) { + return this.serviceClient.deleteToolboxVersionWithResponse(name, version, requestOptions); } /** * Create a new version of a toolbox. If the toolbox does not exist, it will be created. * - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param tools The list of tools to include in this version. * @param description A human-readable description of the toolbox. * @param metadata Arbitrary key-value metadata to associate with the toolbox. + * @param skills The list of skill sources to include in this version. A skill reference specifies a skill name and + * optionally a version. If version is omitted, the skill's default version is used. * @param policies Policy configuration for this toolbox version. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -391,23 +412,24 @@ public Response deleteToolboxVersionWithResponse(String toolboxName, Strin */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ToolboxVersionDetails createToolboxVersion(String toolboxName, List tools, String description, - Map metadata, ToolboxPolicies policies) { + public ToolboxVersionDetails createToolboxVersion(String name, List tools, String description, + Map metadata, List skills, ToolboxPolicies policies) { // Generated convenience method for createToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); CreateToolboxVersionRequest createToolboxVersionRequestObj = new CreateToolboxVersionRequest(tools).setDescription(description) .setMetadata(metadata) + .setSkills(skills) .setPolicies(policies); BinaryData createToolboxVersionRequest = BinaryData.fromObject(createToolboxVersionRequestObj); - return createToolboxVersionWithResponse(toolboxName, createToolboxVersionRequest, requestOptions).getValue() + return createToolboxVersionWithResponse(name, createToolboxVersionRequest, requestOptions).getValue() .toObject(ToolboxVersionDetails.class); } /** * Create a new version of a toolbox. If the toolbox does not exist, it will be created. * - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param tools The list of tools to include in this version. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -419,19 +441,19 @@ public ToolboxVersionDetails createToolboxVersion(String toolboxName, List */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ToolboxVersionDetails createToolboxVersion(String toolboxName, List tools) { + public ToolboxVersionDetails createToolboxVersion(String name, List tools) { // Generated convenience method for createToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); CreateToolboxVersionRequest createToolboxVersionRequestObj = new CreateToolboxVersionRequest(tools); BinaryData createToolboxVersionRequest = BinaryData.fromObject(createToolboxVersionRequestObj); - return createToolboxVersionWithResponse(toolboxName, createToolboxVersionRequest, requestOptions).getValue() + return createToolboxVersionWithResponse(name, createToolboxVersionRequest, requestOptions).getValue() .toObject(ToolboxVersionDetails.class); } /** * Retrieve a toolbox. * - * @param toolboxName The name of the toolbox to retrieve. + * @param name The name of the toolbox to retrieve. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -442,10 +464,10 @@ public ToolboxVersionDetails createToolboxVersion(String toolboxName, List */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ToolboxDetails getToolbox(String toolboxName) { + public ToolboxDetails getToolbox(String name) { // Generated convenience method for getToolboxWithResponse RequestOptions requestOptions = new RequestOptions(); - return getToolboxWithResponse(toolboxName, requestOptions).getValue().toObject(ToolboxDetails.class); + return getToolboxWithResponse(name, requestOptions).getValue().toObject(ToolboxDetails.class); } /** @@ -512,7 +534,7 @@ public PagedIterable listToolboxes() { /** * List all versions of a toolbox. * - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 20. * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` @@ -533,7 +555,7 @@ public PagedIterable listToolboxes() { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listToolboxVersions(String toolboxName, Integer limit, PageOrder order, + public PagedIterable listToolboxVersions(String name, Integer limit, PageOrder order, String after, String before) { // Generated convenience method for listToolboxVersions RequestOptions requestOptions = new RequestOptions(); @@ -549,14 +571,14 @@ public PagedIterable listToolboxVersions(String toolboxNa if (before != null) { requestOptions.addQueryParam("before", before, false); } - return serviceClient.listToolboxVersions(toolboxName, requestOptions) + return serviceClient.listToolboxVersions(name, requestOptions) .mapPage(bodyItemValue -> bodyItemValue.toObject(ToolboxVersionDetails.class)); } /** * List all versions of a toolbox. * - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -567,17 +589,17 @@ public PagedIterable listToolboxVersions(String toolboxNa */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listToolboxVersions(String toolboxName) { + public PagedIterable listToolboxVersions(String name) { // Generated convenience method for listToolboxVersions RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listToolboxVersions(toolboxName, requestOptions) + return serviceClient.listToolboxVersions(name, requestOptions) .mapPage(bodyItemValue -> bodyItemValue.toObject(ToolboxVersionDetails.class)); } /** * Retrieve a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to retrieve. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -589,17 +611,17 @@ public PagedIterable listToolboxVersions(String toolboxNa */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ToolboxVersionDetails getToolboxVersion(String toolboxName, String version) { + public ToolboxVersionDetails getToolboxVersion(String name, String version) { // Generated convenience method for getToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return getToolboxVersionWithResponse(toolboxName, version, requestOptions).getValue() + return getToolboxVersionWithResponse(name, version, requestOptions).getValue() .toObject(ToolboxVersionDetails.class); } /** * Update a toolbox to point to a specific version. * - * @param toolboxName The name of the toolbox to update. + * @param name The name of the toolbox to update. * @param defaultVersion The version identifier that the toolbox should point to. When set, the toolbox's default * version will resolve to this version instead of the latest. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -612,19 +634,19 @@ public ToolboxVersionDetails getToolboxVersion(String toolboxName, String versio */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public ToolboxDetails updateToolbox(String toolboxName, String defaultVersion) { + public ToolboxDetails updateToolbox(String name, String defaultVersion) { // Generated convenience method for updateToolboxWithResponse RequestOptions requestOptions = new RequestOptions(); UpdateToolboxRequest updateToolboxRequestObj = new UpdateToolboxRequest(defaultVersion); BinaryData updateToolboxRequest = BinaryData.fromObject(updateToolboxRequestObj); - return updateToolboxWithResponse(toolboxName, updateToolboxRequest, requestOptions).getValue() + return updateToolboxWithResponse(name, updateToolboxRequest, requestOptions).getValue() .toObject(ToolboxDetails.class); } /** * Delete a toolbox and all its versions. * - * @param toolboxName The name of the toolbox to delete. + * @param name The name of the toolbox to delete. * @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. @@ -634,16 +656,16 @@ public ToolboxDetails updateToolbox(String toolboxName, String defaultVersion) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteToolbox(String toolboxName) { + public void deleteToolbox(String name) { // Generated convenience method for deleteToolboxWithResponse RequestOptions requestOptions = new RequestOptions(); - deleteToolboxWithResponse(toolboxName, requestOptions).getValue(); + deleteToolboxWithResponse(name, requestOptions).getValue(); } /** * Delete a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. @@ -654,9 +676,9 @@ public void deleteToolbox(String toolboxName) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteToolboxVersion(String toolboxName, String version) { + public void deleteToolboxVersion(String name, String version) { // Generated convenience method for deleteToolboxVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - deleteToolboxVersionWithResponse(toolboxName, version, requestOptions).getValue(); + deleteToolboxVersionWithResponse(name, version, requestOptions).getValue(); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentSessionFilesImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentSessionFilesImpl.java index 2bca3680c34d..a1eecc11b04d 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentSessionFilesImpl.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentSessionFilesImpl.java @@ -23,12 +23,19 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import reactor.core.publisher.Mono; /** @@ -72,93 +79,93 @@ public AgentsServiceVersion getServiceVersion() { @Host("{endpoint}") @ServiceInterface(name = "AgentsClientAgentSessionFiles") public interface AgentSessionFilesService { - @Put("/agents/{agent_name}/endpoint/sessions/{session_id}/files/content") + @Put("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> uploadSessionFile(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, @QueryParam("path") String path, @HeaderParam("Content-Type") String contentType, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData content, RequestOptions requestOptions, Context context); - @Put("/agents/{agent_name}/endpoint/sessions/{session_id}/files/content") + @Put("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response uploadSessionFileSync(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, @QueryParam("path") String path, @HeaderParam("Content-Type") String contentType, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, @BodyParam("application/octet-stream") BinaryData content, RequestOptions requestOptions, Context context); - @Get("/agents/{agent_name}/endpoint/sessions/{session_id}/files/content") + @Get("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> downloadSessionFile(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/agents/{agent_name}/endpoint/sessions/{session_id}/files/content") + @Get("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files/content") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response downloadSessionFileSync(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/agents/{agent_name}/endpoint/sessions/{session_id}/files") + @Get("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSessionFiles(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, - @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Mono> listSessionFiles(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Get("/agents/{agent_name}/endpoint/sessions/{session_id}/files") + @Get("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSessionFilesSync(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, - @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + Response listSessionFilesSync(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); - @Delete("/agents/{agent_name}/endpoint/sessions/{session_id}/files") + @Delete("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteSessionFile(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); - @Delete("/agents/{agent_name}/endpoint/sessions/{session_id}/files") + @Delete("/agents/{agent_name}/endpoint/sessions/{agent_session_id}/files") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSessionFileSync(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @PathParam("agent_name") String agentName, @PathParam("agent_session_id") String agentSessionId, @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); } @@ -172,7 +179,10 @@ Response deleteSessionFileSync(@HostParam("endpoint") String endpoint, * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -195,7 +205,7 @@ Response deleteSessionFileSync(@HostParam("endpoint") String endpoint, *
* * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The destination file path within the sandbox, relative to the session home directory. * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -207,12 +217,12 @@ Response deleteSessionFileSync(@HostParam("endpoint") String endpoint, * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> uploadSessionFileWithResponseAsync(String agentName, String sessionId, + public Mono> uploadSessionFileWithResponseAsync(String agentName, String agentSessionId, String path, BinaryData content, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.uploadSessionFile(this.client.getEndpoint(), agentName, sessionId, path, + return FluxUtil.withContext( + context -> service.uploadSessionFile(this.client.getEndpoint(), agentName, agentSessionId, path, contentType, this.client.getServiceVersion().getVersion(), accept, content, requestOptions, context)); } @@ -225,7 +235,10 @@ public Mono> uploadSessionFileWithResponseAsync(String agen * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -248,7 +261,7 @@ public Mono> uploadSessionFileWithResponseAsync(String agen *
* * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The destination file path within the sandbox, relative to the session home directory. * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. @@ -259,11 +272,11 @@ public Mono> uploadSessionFileWithResponseAsync(String agen * @return response from uploading a file to a session sandbox along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response uploadSessionFileWithResponse(String agentName, String sessionId, String path, + public Response uploadSessionFileWithResponse(String agentName, String agentSessionId, String path, BinaryData content, RequestOptions requestOptions) { final String contentType = "application/octet-stream"; final String accept = "application/json"; - return service.uploadSessionFileSync(this.client.getEndpoint(), agentName, sessionId, path, contentType, + return service.uploadSessionFileSync(this.client.getEndpoint(), agentName, agentSessionId, path, contentType, this.client.getServiceVersion().getVersion(), accept, content, requestOptions, Context.NONE); } @@ -275,7 +288,10 @@ public Response uploadSessionFileWithResponse(String agentName, Stri * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -287,7 +303,7 @@ public Response uploadSessionFileWithResponse(String agentName, Stri *
* * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file path to download from the sandbox, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -297,11 +313,11 @@ public Response uploadSessionFileWithResponse(String agentName, Stri * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadSessionFileWithResponseAsync(String agentName, String sessionId, + public Mono> downloadSessionFileWithResponseAsync(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { final String accept = "application/octet-stream"; return FluxUtil.withContext(context -> service.downloadSessionFile(this.client.getEndpoint(), agentName, - sessionId, path, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + agentSessionId, path, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -312,7 +328,10 @@ public Mono> downloadSessionFileWithResponseAsync(String ag * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -324,7 +343,7 @@ public Mono> downloadSessionFileWithResponseAsync(String ag *
* * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file path to download from the sandbox, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -334,23 +353,49 @@ public Mono> downloadSessionFileWithResponseAsync(String ag * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadSessionFileWithResponse(String agentName, String sessionId, String path, + public Response downloadSessionFileWithResponse(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { final String accept = "application/octet-stream"; - return service.downloadSessionFileSync(this.client.getEndpoint(), agentName, sessionId, path, + return service.downloadSessionFileSync(this.client.getEndpoint(), agentName, agentSessionId, path, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pathStringNoThe directory path to list, relative to the session home + * directory. Defaults to the home directory if not provided.
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * * * + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -358,48 +403,70 @@ public Response downloadSessionFileWithResponse(String agentName, St *
      * {@code
      * {
-     *     path: String (Required)
-     *     entries (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             size: long (Required)
-     *             is_directory: boolean (Required)
-     *             modified_time: OffsetDateTime (Required)
-     *         }
-     *     ]
+     *     name: String (Required)
+     *     size: long (Required)
+     *     is_directory: boolean (Required)
+     *     modified_time: long (Required)
      * }
      * }
      * 
* * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @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 response from listing a directory in a session sandbox along with {@link Response} on successful - * completion of {@link Mono}. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSessionFilesWithResponseAsync(String agentName, String sessionId, String path, + private Mono> listSessionFilesSinglePageAsync(String agentName, String agentSessionId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSessionFiles(this.client.getEndpoint(), agentName, sessionId, - path, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil + .withContext(context -> service.listSessionFiles(this.client.getEndpoint(), agentName, agentSessionId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "entries"), null, null)); } /** * List files and directories at a given path in the session sandbox. * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pathStringNoThe directory path to list, relative to the session home + * directory. Defaults to the home directory if not provided.
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * * * + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -407,35 +474,163 @@ public Mono> getSessionFilesWithResponseAsync(String agentN *
      * {@code
      * {
-     *     path: String (Required)
-     *     entries (Required): [
-     *          (Required){
-     *             name: String (Required)
-     *             size: long (Required)
-     *             is_directory: boolean (Required)
-     *             modified_time: OffsetDateTime (Required)
-     *         }
-     *     ]
+     *     name: String (Required)
+     *     size: long (Required)
+     *     is_directory: boolean (Required)
+     *     modified_time: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param agentSessionId The session ID. + * @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 paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionFilesAsync(String agentName, String agentSessionId, + RequestOptions requestOptions) { + return new PagedFlux<>(() -> listSessionFilesSinglePageAsync(agentName, agentSessionId, requestOptions)); + } + + /** + * List files and directories at a given path in the session sandbox. + * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pathStringNoThe directory path to list, relative to the session home + * directory. Defaults to the home directory if not provided.
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     size: long (Required)
+     *     is_directory: boolean (Required)
+     *     modified_time: long (Required)
      * }
      * }
      * 
* * @param agentName The name of the agent. - * @param sessionId The session ID. - * @param path The directory path to list, relative to the session home directory. + * @param agentSessionId The session ID. * @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 response from listing a directory in a session sandbox along with {@link Response}. + * @return the response body along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSessionFilesWithResponse(String agentName, String sessionId, String path, + private PagedResponse listSessionFilesSinglePage(String agentName, String agentSessionId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSessionFilesSync(this.client.getEndpoint(), agentName, sessionId, path, + Response res = service.listSessionFilesSync(this.client.getEndpoint(), agentName, agentSessionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "entries"), null, null); + } + + /** + * List files and directories at a given path in the session sandbox. + * Returns only the immediate children of the specified directory (non-recursive). + * If path is not provided, lists the session home directory. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
pathStringNoThe directory path to list, relative to the session home + * directory. Defaults to the home directory if not provided.
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     size: long (Required)
+     *     is_directory: boolean (Required)
+     *     modified_time: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param agentSessionId The session ID. + * @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 paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessionFiles(String agentName, String agentSessionId, + RequestOptions requestOptions) { + return new PagedIterable<>(() -> listSessionFilesSinglePage(agentName, agentSessionId, requestOptions)); } /** @@ -445,8 +640,8 @@ public Response getSessionFilesWithResponse(String agentName, String * * * - * + * *
Query Parameters
NameTypeRequiredDescription
recursiveBooleanNoWhether to recursively delete directory contents. Defaults - * to false.
recursiveBooleanNoWhether to recursively delete directory contents. The + * service defaults to `false` if a value is not specified by the caller.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

@@ -455,12 +650,15 @@ public Response getSessionFilesWithResponse(String agentName, String * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file or directory path to delete, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -470,10 +668,10 @@ public Response getSessionFilesWithResponse(String agentName, String * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSessionFileWithResponseAsync(String agentName, String sessionId, String path, + public Mono> deleteSessionFileWithResponseAsync(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { return FluxUtil.withContext(context -> service.deleteSessionFile(this.client.getEndpoint(), agentName, - sessionId, path, this.client.getServiceVersion().getVersion(), requestOptions, context)); + agentSessionId, path, this.client.getServiceVersion().getVersion(), requestOptions, context)); } /** @@ -483,8 +681,8 @@ public Mono> deleteSessionFileWithResponseAsync(String agentName, * * * - * + * *
Query Parameters
NameTypeRequiredDescription
recursiveBooleanNoWhether to recursively delete directory contents. Defaults - * to false.
recursiveBooleanNoWhether to recursively delete directory contents. The + * service defaults to `false` if a value is not specified by the caller.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

@@ -493,12 +691,15 @@ public Mono> deleteSessionFileWithResponseAsync(String agentName, * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". + * x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user. * * You can add these to a request with {@link RequestOptions#addHeader} * * @param agentName The name of the agent. - * @param sessionId The session ID. + * @param agentSessionId The session ID. * @param path The file or directory path to delete, relative to the session home directory. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -508,9 +709,28 @@ public Mono> deleteSessionFileWithResponseAsync(String agentName, * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSessionFileWithResponse(String agentName, String sessionId, String path, + public Response deleteSessionFileWithResponse(String agentName, String agentSessionId, String path, RequestOptions requestOptions) { - return service.deleteSessionFileSync(this.client.getEndpoint(), agentName, sessionId, path, + return service.deleteSessionFileSync(this.client.getEndpoint(), agentName, agentSessionId, path, this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } } 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 9131220953cb..6ba5d31bdc93 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 @@ -121,6 +121,32 @@ Response createAgentSync(@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createAgentRequest, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy + @Post("/agents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createAgentFromCode(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @HeaderParam("x-ms-agent-name") String agentName, + @HeaderParam("x-ms-code-zip-sha256") String codeZipSha256, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/agents") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createAgentFromCodeSync(@HostParam("endpoint") String endpoint, + @HeaderParam("content-type") String contentType, @HeaderParam("x-ms-agent-name") String agentName, + @HeaderParam("x-ms-code-zip-sha256") String codeZipSha256, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + @Post("/agents/{agent_name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -145,6 +171,32 @@ Response updateAgentSync(@HostParam("endpoint") String endpoint, @BodyParam("application/json") BinaryData updateAgentRequest, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy + @Post("/agents/{agent_name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateAgentFromCode(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @HeaderParam("content-type") String contentType, + @HeaderParam("x-ms-code-zip-sha256") String codeZipSha256, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/agents/{agent_name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateAgentFromCodeSync(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @HeaderParam("content-type") String contentType, + @HeaderParam("x-ms-code-zip-sha256") String codeZipSha256, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + @Post("/agents:import") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -369,6 +421,52 @@ Response updateAgentDetailsSync(@HostParam("endpoint") String endpoi @BodyParam("application/merge-patch+json") BinaryData patchAgentObjectRequest, RequestOptions requestOptions, Context context); + // @Multipart not supported by RestProxy + @Post("/agents/{agent_name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createAgentVersionFromCode(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @HeaderParam("content-type") String contentType, + @HeaderParam("x-ms-code-zip-sha256") String codeZipSha256, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/agents/{agent_name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createAgentVersionFromCodeSync(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @HeaderParam("content-type") String contentType, + @HeaderParam("x-ms-code-zip-sha256") String codeZipSha256, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + + @Get("/agents/{agent_name}/code:download") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> downloadAgentCode(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/agents/{agent_name}/code:download") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response downloadAgentCodeSync(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Post("/agents/{agent_name}/endpoint/sessions") @ExpectedResponses({ 201 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -376,10 +474,10 @@ Response updateAgentDetailsSync(@HostParam("endpoint") String endpoi @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createSession(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @HeaderParam("x-session-isolation-key") String isolationKey, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createSessionRequest, - RequestOptions requestOptions, Context context); + @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createSessionRequest, RequestOptions requestOptions, + Context context); @Post("/agents/{agent_name}/endpoint/sessions") @ExpectedResponses({ 201 }) @@ -388,10 +486,10 @@ Mono> createSession(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createSessionSync(@HostParam("endpoint") String endpoint, - @PathParam("agent_name") String agentName, @HeaderParam("x-session-isolation-key") String isolationKey, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createSessionRequest, - RequestOptions requestOptions, Context context); + @PathParam("agent_name") String agentName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createSessionRequest, RequestOptions requestOptions, + Context context); @Get("/agents/{agent_name}/endpoint/sessions/{session_id}") @ExpectedResponses({ 200 }) @@ -423,8 +521,7 @@ Response getSessionSync(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteSession(@HostParam("endpoint") String endpoint, @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, - @HeaderParam("x-session-isolation-key") String isolationKey, @QueryParam("api-version") String apiVersion, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Delete("/agents/{agent_name}/endpoint/sessions/{session_id}") @ExpectedResponses({ 204 }) @@ -434,8 +531,27 @@ Mono> deleteSession(@HostParam("endpoint") String endpoint, @UnexpectedResponseExceptionType(HttpResponseException.class) Response deleteSessionSync(@HostParam("endpoint") String endpoint, @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, - @HeaderParam("x-session-isolation-key") String isolationKey, @QueryParam("api-version") String apiVersion, - RequestOptions requestOptions, Context context); + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + + @Post("/agents/{agent_name}/endpoint/sessions/{session_id}:stop") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> stopSession(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + + @Post("/agents/{agent_name}/endpoint/sessions/{session_id}:stop") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response stopSessionSync(@HostParam("endpoint") String endpoint, + @PathParam("agent_name") String agentName, @PathParam("session_id") String sessionId, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Get("/agents/{agent_name}/endpoint/sessions") @ExpectedResponses({ 200 }) @@ -479,6 +595,240 @@ Response getSessionLogStreamSync(@HostParam("endpoint") String endpo @PathParam("session_id") String sessionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + @Post("/agent_optimization_jobs") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOptimizationJob(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData inputs, + RequestOptions requestOptions, Context context); + + @Post("/agent_optimization_jobs") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createOptimizationJobSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData inputs, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOptimizationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOptimizationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listOptimizationJobs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listOptimizationJobsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/agent_optimization_jobs/{jobId}:cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cancelOptimizationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/agent_optimization_jobs/{jobId}:cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response cancelOptimizationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/agent_optimization_jobs/{jobId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteOptimizationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + + @Delete("/agent_optimization_jobs/{jobId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteOptimizationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listOptimizationCandidates(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listOptimizationCandidatesSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOptimizationCandidate(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOptimizationCandidateSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}/config") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOptimizationCandidateConfig(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}/config") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOptimizationCandidateConfigSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}/results") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOptimizationCandidateResults(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}/results") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOptimizationCandidateResultsSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getOptimizationCandidateFile(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/agent_optimization_jobs/{jobId}/candidates/{candidateId}/files") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getOptimizationCandidateFileSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("path") String path, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/agent_optimization_jobs/{jobId}/candidates/{candidateId}:promote") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> promoteOptimizationCandidate(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData candidateRequest, + RequestOptions requestOptions, Context context); + + @Post("/agent_optimization_jobs/{jobId}/candidates/{candidateId}:promote") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response promoteOptimizationCandidateSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @PathParam("candidateId") String candidateId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData candidateRequest, + RequestOptions requestOptions, Context context); + @Get("/openai/v1/conversations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -520,11 +870,12 @@ Response listAgentConversationsSync(@HostParam("endpoint") String en * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -546,7 +897,7 @@ Response listAgentConversationsSync(@HostParam("endpoint") String en * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -615,11 +966,12 @@ public Mono> getAgentWithResponseAsync(String agentName, Re * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -641,7 +993,7 @@ public Mono> getAgentWithResponseAsync(String agentName, Re * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -696,7 +1048,8 @@ public Response getAgentWithResponse(String agentName, RequestOption * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -710,7 +1063,7 @@ public Response getAgentWithResponse(String agentName, RequestOption * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -728,7 +1081,7 @@ public Response getAgentWithResponse(String agentName, RequestOption * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -777,11 +1130,12 @@ public Response getAgentWithResponse(String agentName, RequestOption * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -803,7 +1157,7 @@ public Response getAgentWithResponse(String agentName, RequestOption * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -861,7 +1215,8 @@ public Mono> createAgentWithResponseAsync(BinaryData create * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -875,7 +1230,7 @@ public Mono> createAgentWithResponseAsync(BinaryData create * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -893,7 +1248,7 @@ public Mono> createAgentWithResponseAsync(BinaryData create * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -942,11 +1297,12 @@ public Mono> createAgentWithResponseAsync(BinaryData create * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -968,7 +1324,7 @@ public Mono> createAgentWithResponseAsync(BinaryData create * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -1017,39 +1373,140 @@ public Response createAgentWithResponse(BinaryData createAgentReques } /** - * Updates the agent by adding a new version if there are any changes to the agent definition. - * If no changes, returns the existing agent version. + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. *

Header Parameters

* * * * + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

+ *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Optional): {
-     *         String: String (Required)
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
      *     }
-     *     description: String (Optional)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
      *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
      *     }
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
      *     }
      * }
      * }
      * 
* + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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 requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAgentFromCodeWithResponseAsync(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createAgentFromCode(this.client.getEndpoint(), contentType, agentName, + codeZipSha256, this.client.getServiceVersion().getVersion(), accept, content, requestOptions, context)); + } + + /** + * Creates a new code-based agent. Uploads the code zip and creates the agent in a single call. + * The agent name is provided in the `x-ms-agent-name` header since POST /agents has no name in the URL path. + * The SHA-256 hex digest of the zip is provided in the `x-ms-code-zip-sha256` header for integrity and dedup. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -1070,11 +1527,12 @@ public Response createAgentWithResponse(BinaryData createAgentReques
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1096,7 +1554,7 @@ public Response createAgentWithResponse(BinaryData createAgentReques
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -1128,23 +1586,25 @@ public Response createAgentWithResponse(BinaryData createAgentReques
      * }
      * 
* - * @param agentName The name of the agent to retrieve. - * @param updateAgentRequest The updateAgentRequest parameter. + * @param agentName The unique name that identifies the agent. Max 63 chars, must start and end with alphanumeric, + * 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 requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAgentWithResponseAsync(String agentName, BinaryData updateAgentRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; + public Response createAgentFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateAgent(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentRequest, requestOptions, - context)); + return service.createAgentFromCodeSync(this.client.getEndpoint(), contentType, agentName, codeZipSha256, + this.client.getServiceVersion().getVersion(), accept, content, requestOptions, Context.NONE); } /** @@ -1156,7 +1616,8 @@ public Mono> updateAgentWithResponseAsync(String agentName, * NameTypeRequiredDescription * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview". + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -1169,7 +1630,7 @@ public Mono> updateAgentWithResponseAsync(String agentName, * } * description: String (Optional) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } @@ -1201,11 +1662,12 @@ public Mono> updateAgentWithResponseAsync(String agentName, * description: String (Optional) * created_at: long (Required) * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) + * kind: String(prompt/hosted/workflow/external) (Required) * rai_config (Optional): { * rai_policy_name: String (Required) * } * } + * status: String(creating/active/failed/deleting/deleted) (Optional) * instance_identity (Optional): { * principal_id: String (Required) * client_id: String (Required) @@ -1227,7 +1689,7 @@ public Mono> updateAgentWithResponseAsync(String agentName, * ] * } * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional) * ] * authorization_schemes (Optional): [ * (Optional){ @@ -1266,33 +1728,48 @@ public Mono> updateAgentWithResponseAsync(String agentName, * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAgentWithResponse(String agentName, BinaryData updateAgentRequest, + public Mono> updateAgentWithResponseAsync(String agentName, BinaryData updateAgentRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updateAgentSync(this.client.getEndpoint(), agentName, + return FluxUtil.withContext(context -> service.updateAgent(this.client.getEndpoint(), agentName, this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentRequest, requestOptions, - Context.NONE); + context)); } /** - * Creates an agent from a manifest. + * Updates the agent by adding a new version if there are any changes to the agent definition. + * If no changes, returns the existing agent version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
      * {@code
      * {
-     *     name: String (Required)
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
      *     description: String (Optional)
-     *     manifest_id: String (Required)
-     *     parameter_values (Required): {
-     *         String: BinaryData (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
      *     }
      * }
      * }
@@ -1318,11 +1795,12 @@ public Response updateAgentWithResponse(String agentName, BinaryData
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1344,7 +1822,7 @@ public Response updateAgentWithResponse(String agentName, BinaryData
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -1376,44 +1854,41 @@ public Response updateAgentWithResponse(String agentName, BinaryData
      * }
      * 
* - * @param createAgentFromManifestRequest The createAgentFromManifestRequest parameter. + * @param agentName The name of the agent to retrieve. + * @param updateAgentRequest The updateAgentRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAgentFromManifestWithResponseAsync( - BinaryData createAgentFromManifestRequest, RequestOptions requestOptions) { + public Response updateAgentWithResponse(String agentName, BinaryData updateAgentRequest, + RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAgentFromManifest(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), contentType, accept, createAgentFromManifestRequest, - requestOptions, context)); + return service.updateAgentSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentRequest, requestOptions, + Context.NONE); } /** - * Creates an agent from a manifest. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     name: String (Required)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     manifest_id: String (Required)
-     *     parameter_values (Required): {
-     *         String: BinaryData (Required)
-     *     }
-     * }
-     * }
-     * 
- * + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -1434,11 +1909,12 @@ public Mono> createAgentFromManifestWithResponseAsync(
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1460,7 +1936,7 @@ public Mono> createAgentFromManifestWithResponseAsync(
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -1492,44 +1968,46 @@ public Mono> createAgentFromManifestWithResponseAsync(
      * }
      * 
* - * @param createAgentFromManifestRequest The createAgentFromManifestRequest parameter. + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAgentFromManifestWithResponse(BinaryData createAgentFromManifestRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; + public Mono> updateAgentFromCodeWithResponseAsync(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return service.createAgentFromManifestSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), contentType, accept, createAgentFromManifestRequest, - requestOptions, Context.NONE); + return FluxUtil + .withContext(context -> service.updateAgentFromCode(this.client.getEndpoint(), agentName, contentType, + codeZipSha256, this.client.getServiceVersion().getVersion(), accept, content, requestOptions, context)); } /** - * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. - * If no changes, returns the existing agent version. - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     manifest_id: String (Required)
-     *     parameter_values (Required): {
-     *         String: BinaryData (Required)
-     *     }
-     * }
-     * }
-     * 
- * + * Updates a code-based agent by uploading new code and creating a new version. + * If the code and definition are unchanged (matched by x-ms-code-zip-sha256 header), returns the existing version. + * The request body is multipart/form-data with a JSON metadata part and a binary code part (part order is + * irrelevant). + * Maximum upload size is 250 MB. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -1550,11 +2028,12 @@ public Response createAgentFromManifestWithResponse(BinaryData creat
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1576,7 +2055,7 @@ public Response createAgentFromManifestWithResponse(BinaryData creat
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -1608,33 +2087,37 @@ public Response createAgentFromManifestWithResponse(BinaryData creat
      * }
      * 
* - * @param agentName The name of the agent to update. - * @param updateAgentFromManifestRequest The updateAgentFromManifestRequest parameter. + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAgentFromManifestWithResponseAsync(String agentName, - BinaryData updateAgentFromManifestRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; + public Response updateAgentFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateAgentFromManifest(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentFromManifestRequest, - requestOptions, context)); + return service.updateAgentFromCodeSync(this.client.getEndpoint(), agentName, contentType, codeZipSha256, + this.client.getServiceVersion().getVersion(), accept, content, requestOptions, Context.NONE); } /** - * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. - * If no changes, returns the existing agent version. + * Creates an agent from a manifest. *

Request Body Schema

* *
      * {@code
      * {
+     *     name: String (Required)
      *     metadata (Optional): {
      *         String: String (Required)
      *     }
@@ -1667,11 +2150,12 @@ public Mono> updateAgentFromManifestWithResponseAsync(Strin
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1693,7 +2177,7 @@ public Mono> updateAgentFromManifestWithResponseAsync(Strin
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -1725,108 +2209,44 @@ public Mono> updateAgentFromManifestWithResponseAsync(Strin
      * }
      * 
* - * @param agentName The name of the agent to update. - * @param updateAgentFromManifestRequest The updateAgentFromManifestRequest parameter. + * @param createAgentFromManifestRequest The createAgentFromManifestRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAgentFromManifestWithResponse(String agentName, - BinaryData updateAgentFromManifestRequest, RequestOptions requestOptions) { + public Mono> createAgentFromManifestWithResponseAsync( + BinaryData createAgentFromManifestRequest, RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.updateAgentFromManifestSync(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentFromManifestRequest, - requestOptions, Context.NONE); + return FluxUtil.withContext(context -> service.createAgentFromManifest(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, createAgentFromManifestRequest, + requestOptions, context)); } /** - * Deletes an agent. - *

Response Body Schema

+ * Creates an agent from a manifest. + *

Request Body Schema

* *
      * {@code
      * {
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     name: String (Required)
-     *     deleted: boolean (Required)
-     * }
-     * }
-     * 
- * - * @param agentName The name of the agent to delete. - * @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 a deleted agent Object along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> internalDeleteAgentWithResponseAsync(String agentName, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.internalDeleteAgent(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Deletes an agent. - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     name: String (Required)
-     *     deleted: boolean (Required)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     manifest_id: String (Required)
+     *     parameter_values (Required): {
+     *         String: BinaryData (Required)
+     *     }
      * }
      * }
      * 
* - * @param agentName The name of the agent to delete. - * @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 a deleted agent Object along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response internalDeleteAgentWithResponse(String agentName, RequestOptions requestOptions) { - final String accept = "application/json"; - return service.internalDeleteAgentSync(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - } - - /** - * Returns the list of all agents. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. - * Allowed values: "prompt", "hosted", "workflow".
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
@@ -1847,11 +2267,12 @@ public Response internalDeleteAgentWithResponse(String agentName, Re
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1873,7 +2294,7 @@ public Response internalDeleteAgentWithResponse(String agentName, Re
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -1905,48 +2326,44 @@ public Response internalDeleteAgentWithResponse(String agentName, Re
      * }
      * 
* + * @param createAgentFromManifestRequest The createAgentFromManifestRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAgentsSinglePageAsync(RequestOptions requestOptions) { + public Response createAgentFromManifestWithResponse(BinaryData createAgentFromManifestRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAgents(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "data"), null, null)); + return service.createAgentFromManifestSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, createAgentFromManifestRequest, + requestOptions, Context.NONE); } /** - * Returns the list of all agents. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. - * Allowed values: "prompt", "hosted", "workflow".
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. + * If no changes, returns the existing agent version. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     manifest_id: String (Required)
+     *     parameter_values (Required): {
+     *         String: BinaryData (Required)
+     *     }
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
@@ -1967,11 +2384,12 @@ private Mono> listAgentsSinglePageAsync(RequestOptions
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -1993,7 +2411,7 @@ private Mono> listAgentsSinglePageAsync(RequestOptions
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -2025,42 +2443,45 @@ private Mono> listAgentsSinglePageAsync(RequestOptions
      * }
      * 
* + * @param agentName The name of the agent to update. + * @param updateAgentFromManifestRequest The updateAgentFromManifestRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAgentsAsync(RequestOptions requestOptions) { - return new PagedFlux<>(() -> listAgentsSinglePageAsync(requestOptions)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateAgentFromManifestWithResponseAsync(String agentName, + BinaryData updateAgentFromManifestRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateAgentFromManifest(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentFromManifestRequest, + requestOptions, context)); } /** - * Returns the list of all agents. - *

Query Parameters

- * - * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. - * Allowed values: "prompt", "hosted", "workflow".
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Updates the agent from a manifest by adding a new version if there are any changes to the agent definition. + * If no changes, returns the existing agent version. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     manifest_id: String (Required)
+     *     parameter_values (Required): {
+     *         String: BinaryData (Required)
+     *     }
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
@@ -2081,11 +2502,12 @@ public PagedFlux listAgentsAsync(RequestOptions requestOptions) {
      *             description: String (Optional)
      *             created_at: long (Required)
      *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
      *                 rai_config (Optional): {
      *                     rai_policy_name: String (Required)
      *                 }
      *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
      *             instance_identity (Optional): {
      *                 principal_id: String (Required)
      *                 client_id: String (Required)
@@ -2107,7 +2529,7 @@ public PagedFlux listAgentsAsync(RequestOptions requestOptions) {
      *             ]
      *         }
      *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -2139,44 +2561,36 @@ public PagedFlux listAgentsAsync(RequestOptions requestOptions) {
      * }
      * 
* + * @param agentName The name of the agent to update. + * @param updateAgentFromManifestRequest The updateAgentFromManifestRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items along with {@link PagedResponse}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAgentsSinglePage(RequestOptions requestOptions) { + public Response updateAgentFromManifestWithResponse(String agentName, + BinaryData updateAgentFromManifestRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listAgentsSync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "data"), null, null); + return service.updateAgentFromManifestSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, updateAgentFromManifestRequest, + requestOptions, Context.NONE); } /** - * Returns the list of all agents. + * Deletes an agent. For hosted agents, if any version has active sessions, the request + * is rejected with HTTP 409 unless `force` is set to true. When force is true, all + * associated sessions are cascade-deleted along with the agent and its versions. *

Query Parameters

* * * - * - * - * - * - * + * *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. - * Allowed values: "prompt", "hosted", "workflow".
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the agent even if + * its versions have active sessions, cascading deletion to all associated sessions. The service defaults to `false` + * if a value is not specified by the caller. This value is not relevant for other Agent types.
* You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

@@ -2185,47 +2599,140 @@ private PagedResponse listAgentsSinglePage(RequestOptions requestOpt * {@code * { * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required) - * id: String (Required) * name: String (Required) - * versions (Required): { - * latest (Required): { - * metadata (Required): { - * String: String (Required) - * } - * object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required) - * id: String (Required) - * name: String (Required) - * version: String (Required) - * description: String (Optional) - * created_at: long (Required) - * definition (Required): { - * kind: String(prompt/hosted/workflow) (Required) - * rai_config (Optional): { - * rai_policy_name: String (Required) - * } - * } - * instance_identity (Optional): { - * principal_id: String (Required) - * client_id: String (Required) - * } - * blueprint (Optional): (recursive schema, see blueprint above) - * blueprint_reference (Optional): { - * type: String(ManagedAgentIdentityBlueprint) (Required) - * } - * agent_guid: String (Optional) - * } - * } - * agent_endpoint (Optional): { - * version_selector (Optional): { - * version_selection_rules (Optional, Required on create): [ - * (Optional, Required on create){ - * type: String(FixedRatio) (Required) - * agent_version: String (Optional, Required on create) - * } - * ] - * } - * protocols (Optional): [ - * String(activity/responses/a2a/invocations) (Optional) + * deleted: boolean (Required) + * } + * } + *
+ * + * @param agentName The name of the agent to delete. + * @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 a deleted agent Object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> internalDeleteAgentWithResponseAsync(String agentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.internalDeleteAgent(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Deletes an agent. For hosted agents, if any version has active sessions, the request + * is rejected with HTTP 409 unless `force` is set to true. When force is true, all + * associated sessions are cascade-deleted along with the agent and its versions. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the agent even if + * its versions have active sessions, cascading deletion to all associated sessions. The service defaults to `false` + * if a value is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to delete. + * @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 a deleted agent Object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response internalDeleteAgentWithResponse(String agentName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.internalDeleteAgentSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Returns the list of all agents. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. + * Allowed values: "prompt", "hosted", "workflow", "external".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
      *         ]
      *         authorization_schemes (Optional): [
      *              (Optional){
@@ -2262,277 +2769,2528 @@ private PagedResponse listAgentsSinglePage(RequestOptions requestOpt
      * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
      * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
      * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
-     * @return the response data for a requested list of items as paginated response with {@link PagedIterable}.
+     * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion
+     * of {@link Mono}.
      */
-    @ServiceMethod(returns = ReturnType.COLLECTION)
-    public PagedIterable listAgents(RequestOptions requestOptions) {
-        return new PagedIterable<>(() -> listAgentsSinglePage(requestOptions));
+    @ServiceMethod(returns = ReturnType.SINGLE)
+    private Mono> listAgentsSinglePageAsync(RequestOptions requestOptions) {
+        final String accept = "application/json";
+        return FluxUtil
+            .withContext(context -> service.listAgents(this.client.getEndpoint(),
+                this.client.getServiceVersion().getVersion(), accept, requestOptions, context))
+            .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
+                getValues(res.getValue(), "data"), null, null));
     }
 
     /**
-     * Create a new agent version.
-     * 

Header Parameters

+ * Returns the list of all agents. + *

Query Parameters

* - * + * * - * + * + * + * + * + * *
Header ParametersQuery Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
kindStringNoFilter agents by kind. If not provided, all agents are returned. + * Allowed values: "prompt", "hosted", "workflow", "external".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
-     *         }
-     *     }
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
-     *     }
-     * }
-     * }
-     * 
- * + * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
      *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
      *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
      *         }
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
      *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
      *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAgentsAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listAgentsSinglePageAsync(requestOptions)); + } + + /** + * Returns the list of all agents. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. + * Allowed values: "prompt", "hosted", "workflow", "external".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAgentsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listAgentsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * Returns the list of all agents. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoFilter agents by kind. If not provided, all agents are returned. + * Allowed values: "prompt", "hosted", "workflow", "external".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAgents(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listAgentsSinglePage(requestOptions)); + } + + /** + * Create a new agent version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param createAgentVersionRequest The createAgentVersionRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAgentVersionWithResponseAsync(String agentName, + BinaryData createAgentVersionRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createAgentVersion(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, createAgentVersionRequest, + requestOptions, context)); + } + + /** + * Create a new agent version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param createAgentVersionRequest The createAgentVersionRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAgentVersionWithResponse(String agentName, BinaryData createAgentVersionRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createAgentVersionSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, createAgentVersionRequest, + requestOptions, Context.NONE); + } + + /** + * Create a new agent version from a manifest. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     manifest_id: String (Required)
+     *     parameter_values (Required): {
+     *         String: BinaryData (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param createAgentVersionFromManifestRequest The createAgentVersionFromManifestRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAgentVersionFromManifestWithResponseAsync(String agentName, + BinaryData createAgentVersionFromManifestRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createAgentVersionFromManifest(this.client.getEndpoint(), + agentName, this.client.getServiceVersion().getVersion(), contentType, accept, + createAgentVersionFromManifestRequest, requestOptions, context)); + } + + /** + * Create a new agent version from a manifest. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     description: String (Optional)
+     *     manifest_id: String (Required)
+     *     parameter_values (Required): {
+     *         String: BinaryData (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param createAgentVersionFromManifestRequest The createAgentVersionFromManifestRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAgentVersionFromManifestWithResponse(String agentName, + BinaryData createAgentVersionFromManifestRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createAgentVersionFromManifestSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, createAgentVersionFromManifestRequest, + requestOptions, Context.NONE); + } + + /** + * Retrieves a specific version of an agent. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve. + * @param agentVersion The version of the agent to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getAgentVersionDetailsWithResponseAsync(String agentName, String agentVersion, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getAgentVersionDetails(this.client.getEndpoint(), agentName, + agentVersion, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Retrieves a specific version of an agent. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve. + * @param agentVersion The version of the agent to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getAgentVersionDetailsWithResponse(String agentName, String agentVersion, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getAgentVersionDetailsSync(this.client.getEndpoint(), agentName, agentVersion, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Deletes a specific version of an agent. For hosted agents, if the version has active + * sessions, the request is rejected with HTTP 409 unless `force` is set to true. When + * force is true, all sessions associated with this version are cascade-deleted. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the version even if + * it has active sessions, cascading deletion to all associated sessions. The service defaults to `false` if a value + * is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to delete. + * @param agentVersion The version of the agent to delete. + * @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 a deleted agent version Object along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> internalDeleteAgentVersionWithResponseAsync(String agentName, String agentVersion, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.internalDeleteAgentVersion(this.client.getEndpoint(), agentName, + agentVersion, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Deletes a specific version of an agent. For hosted agents, if the version has active + * sessions, the request is rejected with HTTP 409 unless `force` is set to true. When + * force is true, all sessions associated with this version are cascade-deleted. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoFor Hosted Agents, if `true`, force-deletes the version even if + * it has active sessions, cascading deletion to all associated sessions. The service defaults to `false` if a value + * is not specified by the caller. This value is not relevant for other Agent types.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to delete. + * @param agentVersion The version of the agent to delete. + * @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 a deleted agent version Object along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response internalDeleteAgentVersionWithResponse(String agentName, String agentVersion, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.internalDeleteAgentVersionSync(this.client.getEndpoint(), agentName, agentVersion, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Returns the list of versions of an agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve versions for. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listAgentVersionsSinglePageAsync(String agentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listAgentVersions(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * Returns the list of versions of an agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve versions for. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAgentVersionsAsync(String agentName, RequestOptions requestOptions) { + return new PagedFlux<>(() -> listAgentVersionsSinglePageAsync(agentName, requestOptions)); + } + + /** + * Returns the list of versions of an agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve versions for. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listAgentVersionsSinglePage(String agentName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listAgentVersionsSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * Returns the list of versions of an agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve versions for. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAgentVersions(String agentName, RequestOptions requestOptions) { + return new PagedIterable<>(() -> listAgentVersionsSinglePage(agentName, requestOptions)); + } + + /** + * Updates an agent endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve. + * @param patchAgentObjectRequest The patchAgentObjectRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateAgentDetailsWithResponseAsync(String agentName, + BinaryData patchAgentObjectRequest, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateAgentDetails(this.client.getEndpoint(), agentName, + contentType, this.client.getServiceVersion().getVersion(), accept, patchAgentObjectRequest, requestOptions, + context)); + } + + /** + * Updates an agent endpoint. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     versions (Required): {
+     *         latest (Required): {
+     *             metadata (Required): {
+     *                 String: String (Required)
+     *             }
+     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *             id: String (Required)
+     *             name: String (Required)
+     *             version: String (Required)
+     *             description: String (Optional)
+     *             created_at: long (Required)
+     *             definition (Required): {
+     *                 kind: String(prompt/hosted/workflow/external) (Required)
+     *                 rai_config (Optional): {
+     *                     rai_policy_name: String (Required)
+     *                 }
+     *             }
+     *             status: String(creating/active/failed/deleting/deleted) (Optional)
+     *             instance_identity (Optional): {
+     *                 principal_id: String (Required)
+     *                 client_id: String (Required)
+     *             }
+     *             blueprint (Optional): (recursive schema, see blueprint above)
+     *             blueprint_reference (Optional): {
+     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             }
+     *             agent_guid: String (Optional)
+     *         }
+     *     }
+     *     agent_endpoint (Optional): {
+     *         version_selector (Optional): {
+     *             version_selection_rules (Optional, Required on create): [
+     *                  (Optional, Required on create){
+     *                     type: String(FixedRatio) (Required)
+     *                     agent_version: String (Optional, Required on create)
+     *                 }
+     *             ]
+     *         }
+     *         protocols (Optional): [
+     *             String(activity/responses/a2a/mcp/invocations/invocations_ws) (Optional)
+     *         ]
+     *         authorization_schemes (Optional): [
+     *              (Optional){
+     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *             }
+     *         ]
+     *     }
+     *     instance_identity (Optional): (recursive schema, see instance_identity above)
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
+     *     agent_card (Optional): {
+     *         version: String (Optional, Required on create)
+     *         description: String (Optional)
+     *         skills (Optional, Required on create): [
+     *              (Optional, Required on create){
+     *                 id: String (Optional, Required on create)
+     *                 name: String (Optional, Required on create)
+     *                 description: String (Optional)
+     *                 tags (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *                 examples (Optional): [
+     *                     String (Optional)
+     *                 ]
+     *             }
+     *         ]
+     *     }
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to retrieve. + * @param patchAgentObjectRequest The patchAgentObjectRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateAgentDetailsWithResponse(String agentName, BinaryData patchAgentObjectRequest, + RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String accept = "application/json"; + return service.updateAgentDetailsSync(this.client.getEndpoint(), agentName, contentType, + this.client.getServiceVersion().getVersion(), accept, patchAgentObjectRequest, requestOptions, + Context.NONE); + } + + /** + * The createAgentVersionFromCode operation. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createAgentVersionFromCodeWithResponseAsync(String agentName, + String codeZipSha256, BinaryData content, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.createAgentVersionFromCode(this.client.getEndpoint(), agentName, contentType, + codeZipSha256, this.client.getServiceVersion().getVersion(), accept, content, requestOptions, context)); + } + + /** + * The createAgentVersionFromCode operation. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     metadata (Required): {
+     *         String: String (Required)
+     *     }
+     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
+     *     id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     created_at: long (Required)
+     *     definition (Required): {
+     *         kind: String(prompt/hosted/workflow/external) (Required)
+     *         rai_config (Optional): {
+     *             rai_policy_name: String (Required)
+     *         }
+     *     }
+     *     status: String(creating/active/failed/deleting/deleted) (Optional)
+     *     instance_identity (Optional): {
+     *         principal_id: String (Required)
+     *         client_id: String (Required)
+     *     }
+     *     blueprint (Optional): (recursive schema, see blueprint above)
+     *     blueprint_reference (Optional): {
+     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     }
+     *     agent_guid: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. + * - Must start and end with alphanumeric characters, + * - Can contain hyphens in the middle + * - Must not exceed 63 characters. + * @param codeZipSha256 SHA-256 hex digest of the uploaded code zip. Used for change detection (dedup) and integrity + * verification. + * @param content The content parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createAgentVersionFromCodeWithResponse(String agentName, String codeZipSha256, + BinaryData content, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.createAgentVersionFromCodeSync(this.client.getEndpoint(), agentName, contentType, codeZipSha256, + this.client.getServiceVersion().getVersion(), accept, content, requestOptions, Context.NONE); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
agent_versionStringNoThe version of the agent whose code zip should be + * downloaded. + * If omitted, the latest version's code zip is returned.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> downloadAgentCodeWithResponseAsync(String agentName, + RequestOptions requestOptions) { + final String accept = "application/zip"; + return FluxUtil.withContext(context -> service.downloadAgentCode(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Download the code zip for a code-based hosted agent. + * Returns the previously-uploaded zip (`application/zip`). + * + * If `agent_version` is supplied, returns that version's code zip; otherwise + * returns the latest version's code zip. + * + * The SHA-256 digest of the returned bytes matches the `content_hash` on the + * resolved version's `code_configuration`. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
agent_versionStringNoThe version of the agent whose code zip should be + * downloaded. + * If omitted, the latest version's code zip is returned.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response downloadAgentCodeWithResponse(String agentName, RequestOptions requestOptions) { + final String accept = "application/zip"; + return service.downloadAgentCodeSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * 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. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Optional)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to create a session for. + * @param createSessionRequest The createSessionRequest parameter. + * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createSessionWithResponseAsync(String agentName, BinaryData createSessionRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createSession(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, createSessionRequest, requestOptions, + context)); + } + + /** + * 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. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Optional)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent to create a session for. + * @param createSessionRequest The createSessionRequest parameter. + * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createSessionWithResponse(String agentName, BinaryData createSessionRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSessionSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), contentType, accept, createSessionRequest, requestOptions, + Context.NONE); + } + + /** + * Retrieves a session by ID. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSessionWithResponseAsync(String agentName, String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getSession(this.client.getEndpoint(), agentName, sessionId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Retrieves a session by ID. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSessionWithResponse(String agentName, String sessionId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getSessionSync(this.client.getEndpoint(), agentName, sessionId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSessionWithResponseAsync(String agentName, String sessionId, + RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteSession(this.client.getEndpoint(), agentName, sessionId, + this.client.getServiceVersion().getVersion(), requestOptions, context)); + } + + /** + * Deletes a session synchronously. + * Returns 204 No Content when the session is deleted or does not exist. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSessionWithResponse(String agentName, String sessionId, RequestOptions requestOptions) { + return service.deleteSessionSync(this.client.getEndpoint(), agentName, sessionId, + this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> stopSessionWithResponseAsync(String agentName, String sessionId, + RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.stopSession(this.client.getEndpoint(), agentName, sessionId, + this.client.getServiceVersion().getVersion(), requestOptions, context)); + } + + /** + * Stops a session. + * Returns 204 No Content when the stop succeeds. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param agentName The name of the agent. + * @param sessionId The session identifier. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response stopSessionWithResponse(String agentName, String sessionId, RequestOptions requestOptions) { + return service.stopSessionSync(this.client.getEndpoint(), agentName, sessionId, + this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + } + + /** + * Returns a list of sessions for the specified agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSessionsSinglePageAsync(String agentName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSessions(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * Returns a list of sessions for the specified agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSessionsAsync(String agentName, RequestOptions requestOptions) { + return new PagedFlux<>(() -> listSessionsSinglePageAsync(agentName, requestOptions)); + } + + /** + * Returns a list of sessions for the specified agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
+     *     }
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
+     * }
+     * }
+     * 
+ * + * @param agentName The name of the agent. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSessionsSinglePage(String agentName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listSessionsSync(this.client.getEndpoint(), agentName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * Returns a list of sessions for the specified agent. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_session_id: String (Required)
+     *     version_indicator (Required): {
+     *         type: String(version_ref) (Required)
      *     }
-     *     agent_guid: String (Optional)
+     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     created_at: long (Required)
+     *     last_accessed_at: long (Required)
+     *     expires_at: long (Required)
      * }
      * }
      * 
* - * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. - * - Must start and end with alphanumeric characters, - * - Can contain hyphens in the middle - * - Must not exceed 63 characters. - * @param createAgentVersionRequest The createAgentVersionRequest parameter. + * @param agentName The name of the agent. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAgentVersionWithResponseAsync(String agentName, - BinaryData createAgentVersionRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAgentVersion(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), contentType, accept, createAgentVersionRequest, - requestOptions, context)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSessions(String agentName, RequestOptions requestOptions) { + return new PagedIterable<>(() -> listSessionsSinglePage(agentName, requestOptions)); } /** - * Create a new agent version. + * Streams console logs (stdout / stderr) for a specific hosted agent session + * as a Server-Sent Events (SSE) stream. + * + * Each SSE frame contains: + * - `event`: always `"log"` + * - `data`: a plain-text log line (currently JSON-formatted, but the schema + * is not contractual and may include additional keys or change format + * over time — clients should treat it as an opaque string) + * + * Example SSE frames: + * ``` + * event: log + * data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port + * 8088"} + * + * event: log + * data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + * + * event: log + * data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + * + * event: log + * data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + * ``` + * + * The stream remains open until the client disconnects or the server + * terminates the connection. Clients should handle reconnection as needed. *

Header Parameters

* * * * + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
-     *         }
-     *     }
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
-     *     }
-     * }
-     * }
-     * 
- * *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
-     *         }
-     *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
-     *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
-     *     }
-     *     agent_guid: String (Optional)
+     *     event: String(log) (Required)
+     *     data: String (Required)
      * }
      * }
      * 
* - * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. - * - Must start and end with alphanumeric characters, - * - Can contain hyphens in the middle - * - Must not exceed 63 characters. - * @param createAgentVersionRequest The createAgentVersionRequest parameter. + * @param agentName The name of the hosted agent. + * @param agentVersion The version of the agent. + * @param sessionId The session ID (maps to an ADC sandbox). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return a single Server-Sent Event frame emitted by the hosted agent session log stream. + * + * Each frame contains an `event` field identifying the event type and a `data` + * field carrying the payload as plain text along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAgentVersionWithResponse(String agentName, BinaryData createAgentVersionRequest, - RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return service.createAgentVersionSync(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), contentType, accept, createAgentVersionRequest, - requestOptions, Context.NONE); + public Mono> getSessionLogStreamWithResponseAsync(String agentName, String agentVersion, + String sessionId, RequestOptions requestOptions) { + final String accept = "text/event-stream"; + return FluxUtil.withContext(context -> service.getSessionLogStream(this.client.getEndpoint(), agentName, + agentVersion, sessionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Create a new agent version from a manifest. - *

Request Body Schema

+ * Streams console logs (stdout / stderr) for a specific hosted agent session + * as a Server-Sent Events (SSE) stream. * - *
-     * {@code
-     * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     manifest_id: String (Required)
-     *     parameter_values (Required): {
-     *         String: BinaryData (Required)
-     *     }
-     * }
-     * }
-     * 
+ * Each SSE frame contains: + * - `event`: always `"log"` + * - `data`: a plain-text log line (currently JSON-formatted, but the schema + * is not contractual and may include additional keys or change format + * over time — clients should treat it as an opaque string) + * + * Example SSE frames: + * ``` + * event: log + * data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port + * 8088"} + * + * event: log + * data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + * + * event: log + * data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + * + * event: log + * data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} + * ``` * + * The stream remains open until the client disconnects or the server + * terminates the connection. Clients should handle reconnection as needed. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", + * "WorkflowAgents=V1Preview", "AgentEndpoints=V1Preview", "CodeAgents=V1Preview", + * "ExternalAgents=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
-     *         }
-     *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
-     *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
-     *     }
-     *     agent_guid: String (Optional)
+     *     event: String(log) (Required)
+     *     data: String (Required)
      * }
      * }
      * 
* - * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. - * - Must start and end with alphanumeric characters, - * - Can contain hyphens in the middle - * - Must not exceed 63 characters. - * @param createAgentVersionFromManifestRequest The createAgentVersionFromManifestRequest parameter. + * @param agentName The name of the hosted agent. + * @param agentVersion The version of the agent. + * @param sessionId The session ID (maps to an ADC sandbox). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return a single Server-Sent Event frame emitted by the hosted agent session log stream. + * + * Each frame contains an `event` field identifying the event type and a `data` + * field carrying the payload as plain text along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createAgentVersionFromManifestWithResponseAsync(String agentName, - BinaryData createAgentVersionFromManifestRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createAgentVersionFromManifest(this.client.getEndpoint(), - agentName, this.client.getServiceVersion().getVersion(), contentType, accept, - createAgentVersionFromManifestRequest, requestOptions, context)); + public Response getSessionLogStreamWithResponse(String agentName, String agentVersion, String sessionId, + RequestOptions requestOptions) { + final String accept = "text/event-stream"; + return service.getSessionLogStreamSync(this.client.getEndpoint(), agentName, agentVersion, sessionId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Create a new agent version from a manifest. + * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

* *
      * {@code
      * {
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     description: String (Optional)
-     *     manifest_id: String (Required)
-     *     parameter_values (Required): {
-     *         String: BinaryData (Required)
+     *     agent (Required): {
+     *         agent_name: String (Required)
+     *         agent_version: String (Optional)
+     *     }
+     *     train_dataset_reference (Required): {
+     *         name: String (Required)
+     *         version: String (Optional)
+     *     }
+     *     validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *     evaluators (Optional): [
+     *         String (Optional)
+     *     ]
+     *     options (Optional): {
+     *         max_iterations: Integer (Optional)
+     *         optimization_config (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         eval_model: String (Optional)
+     *         optimization_model: String (Optional)
+     *         evaluation_level: String(turn/conversation) (Optional)
      *     }
      * }
      * }
@@ -2543,226 +5301,656 @@ public Mono> createAgentVersionFromManifestWithResponseAsyn
      * 
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
      *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
      *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
-     *     agent_guid: String (Optional)
      * }
      * }
      * 
* - * @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent. - * - Must start and end with alphanumeric characters, - * - Can contain hyphens in the middle - * - Must not exceed 63 characters. - * @param createAgentVersionFromManifestRequest The createAgentVersionFromManifestRequest parameter. + * @param inputs The optimization job inputs. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createAgentVersionFromManifestWithResponse(String agentName, - BinaryData createAgentVersionFromManifestRequest, RequestOptions requestOptions) { + public Mono> createOptimizationJobWithResponseAsync(BinaryData inputs, + RequestOptions requestOptions) { final String contentType = "application/json"; final String accept = "application/json"; - return service.createAgentVersionFromManifestSync(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), contentType, accept, createAgentVersionFromManifestRequest, - requestOptions, Context.NONE); + return FluxUtil.withContext(context -> service.createOptimizationJob(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, inputs, requestOptions, context)); } /** - * Retrieves a specific version of an agent. - *

Response Body Schema

+ * Creates an agent optimization job. + * + * Create an optimization job. Returns 201 with the queued job. Honours `Operation-Id` for idempotent retry. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
+     *     agent (Required): {
+     *         agent_name: String (Required)
+     *         agent_version: String (Optional)
+     *     }
+     *     train_dataset_reference (Required): {
+     *         name: String (Required)
+     *         version: String (Optional)
+     *     }
+     *     validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *     evaluators (Optional): [
+     *         String (Optional)
+     *     ]
+     *     options (Optional): {
+     *         max_iterations: Integer (Optional)
+     *         optimization_config (Optional): {
+     *             String: BinaryData (Required)
      *         }
+     *         eval_model: String (Optional)
+     *         optimization_model: String (Optional)
+     *         evaluation_level: String(turn/conversation) (Optional)
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
-     *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
-     *     }
-     *     agent_guid: String (Optional)
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve. - * @param agentVersion The version of the agent to retrieve. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getAgentVersionDetailsWithResponseAsync(String agentName, String agentVersion, - RequestOptions requestOptions) { - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getAgentVersionDetails(this.client.getEndpoint(), agentName, - agentVersion, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); - } - - /** - * Retrieves a specific version of an agent. *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: 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)
      *         }
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
-     *     agent_guid: String (Optional)
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve. - * @param agentVersion The version of the agent to retrieve. + * @param inputs The optimization job inputs. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getAgentVersionDetailsWithResponse(String agentName, String agentVersion, - RequestOptions requestOptions) { + public Response createOptimizationJobWithResponse(BinaryData inputs, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return service.getAgentVersionDetailsSync(this.client.getEndpoint(), agentName, agentVersion, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.createOptimizationJobSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, inputs, requestOptions, Context.NONE); } /** - * Deletes a specific version of an agent. + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     deleted: boolean (Required)
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
      * }
      * }
      * 
* - * @param agentName The name of the agent to delete. - * @param agentVersion The version of the agent to delete. + * @param jobId The ID of the job. * @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 a deleted agent version Object along with {@link Response} on successful completion of {@link Mono}. + * @return info about an agent optimization job. + * + * Get an optimization job by id along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> internalDeleteAgentVersionWithResponseAsync(String agentName, String agentVersion, - RequestOptions requestOptions) { + public Mono> getOptimizationJobWithResponseAsync(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.internalDeleteAgentVersion(this.client.getEndpoint(), agentName, - agentVersion, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getOptimizationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Deletes a specific version of an agent. + * Get info about an agent optimization job. + * + * Get an optimization job by id. Returns 202 while in progress, 200 when terminal. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     deleted: boolean (Required)
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
+     *     }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
+     *     }
      * }
      * }
      * 
* - * @param agentName The name of the agent to delete. - * @param agentVersion The version of the agent to delete. + * @param jobId The ID of the job. * @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 a deleted agent version Object along with {@link Response}. + * @return info about an agent optimization job. + * + * Get an optimization job by id along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response internalDeleteAgentVersionWithResponse(String agentName, String agentVersion, - RequestOptions requestOptions) { + public Response getOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.internalDeleteAgentVersionSync(this.client.getEndpoint(), agentName, agentVersion, + return service.getOptimizationJobSync(this.client.getEndpoint(), jobId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Returns the list of versions of an agent. + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. *

Query Parameters

* * @@ -2781,42 +5969,148 @@ public Response internalDeleteAgentVersionWithResponse(String agentN * defines your place in the list. * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + * *
Query Parameters
statusStringNoFilter to jobs in this lifecycle state. Allowed values: + * "queued", "in_progress", "succeeded", "failed", "cancelled".
agent_nameStringNoFilter to jobs targeting this agent name.
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
      *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
      *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
-     *     agent_guid: String (Optional)
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve versions for. * @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. @@ -2826,18 +6120,19 @@ public Response internalDeleteAgentVersionWithResponse(String agentN * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAgentVersionsSinglePageAsync(String agentName, - RequestOptions requestOptions) { + private Mono> listOptimizationJobsSinglePageAsync(RequestOptions requestOptions) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listAgentVersions(this.client.getEndpoint(), agentName, + .withContext(context -> service.listOptimizationJobs(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "data"), null, null)); } /** - * Returns the list of versions of an agent. + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. *

Query Parameters

* * @@ -2856,42 +6151,148 @@ private Mono> listAgentVersionsSinglePageAsync(String * defines your place in the list. * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + * *
Query Parameters
statusStringNoFilter to jobs in this lifecycle state. Allowed values: + * "queued", "in_progress", "succeeded", "failed", "cancelled".
agent_nameStringNoFilter to jobs targeting this agent name.
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: 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)
      *         }
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
-     *     agent_guid: String (Optional)
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve versions for. * @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. @@ -2900,12 +6301,14 @@ private Mono> listAgentVersionsSinglePageAsync(String * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAgentVersionsAsync(String agentName, RequestOptions requestOptions) { - return new PagedFlux<>(() -> listAgentVersionsSinglePageAsync(agentName, requestOptions)); + public PagedFlux listOptimizationJobsAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listOptimizationJobsSinglePageAsync(requestOptions)); } /** - * Returns the list of versions of an agent. + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. *

Query Parameters

* * @@ -2924,42 +6327,148 @@ public PagedFlux listAgentVersionsAsync(String agentName, RequestOpt * defines your place in the list. * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + * *
Query Parameters
statusStringNoFilter to jobs in this lifecycle state. Allowed values: + * "queued", "in_progress", "succeeded", "failed", "cancelled".
agent_nameStringNoFilter to jobs targeting this agent name.
* You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: 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)
      *         }
      *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
+     *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
+     *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
-     *     agent_guid: String (Optional)
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve versions for. * @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. @@ -2968,16 +6477,18 @@ public PagedFlux listAgentVersionsAsync(String agentName, RequestOpt * @return the response data for a requested list of items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listAgentVersionsSinglePage(String agentName, RequestOptions requestOptions) { + private PagedResponse listOptimizationJobsSinglePage(RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listAgentVersionsSync(this.client.getEndpoint(), agentName, + Response res = service.listOptimizationJobsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "data"), null, null); } /** - * Returns the list of versions of an agent. + * Returns a list of agent optimization jobs. + * + * List optimization jobs. Supports cursor pagination and optional status / agent_name filters. *

Query Parameters

* * @@ -2996,497 +6507,801 @@ private PagedResponse listAgentVersionsSinglePage(String agentName, * defines your place in the list. * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + * *
Query Parameters
statusStringNoFilter to jobs in this lifecycle state. Allowed values: + * "queued", "in_progress", "succeeded", "failed", "cancelled".
agent_nameStringNoFilter to jobs targeting this agent name.
* You can add these to a request with {@link RequestOptions#addQueryParam} - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     metadata (Required): {
-     *         String: String (Required)
-     *     }
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     id: String (Required)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     created_at: long (Required)
-     *     definition (Required): {
-     *         kind: String(prompt/hosted/workflow) (Required)
-     *         rai_config (Optional): {
-     *             rai_policy_name: String (Required)
-     *         }
-     *     }
-     *     instance_identity (Optional): {
-     *         principal_id: String (Required)
-     *         client_id: String (Required)
-     *     }
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): {
-     *         type: String(ManagedAgentIdentityBlueprint) (Required)
-     *     }
-     *     agent_guid: String (Optional)
-     * }
-     * }
-     * 
- * - * @param agentName The name of the agent to retrieve versions for. - * @param requestOptions The options to configure the HTTP request before HTTP client sends it. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAgentVersions(String agentName, RequestOptions requestOptions) { - return new PagedIterable<>(() -> listAgentVersionsSinglePage(agentName, requestOptions)); - } - - /** - * Updates an agent endpoint. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

+ *

Response Body Schema

* *
      * {@code
      * {
-     *     agent_endpoint (Optional): {
-     *         version_selector (Optional): {
-     *             version_selection_rules (Optional, Required on create): [
-     *                  (Optional, Required on create){
-     *                     type: String(FixedRatio) (Required)
-     *                     agent_version: String (Optional, Required on create)
-     *                 }
-     *             ]
-     *         }
-     *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
-     *         ]
-     *         authorization_schemes (Optional): [
-     *              (Optional){
-     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
-     *             }
+     *     id: 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)
+     *         }
      *     }
-     *     agent_card (Optional): {
-     *         version: String (Optional, Required on create)
-     *         description: String (Optional)
-     *         skills (Optional, Required on create): [
-     *              (Optional, Required on create){
-     *                 id: String (Optional, Required on create)
-     *                 name: String (Optional, Required on create)
-     *                 description: String (Optional)
-     *                 tags (Optional): [
-     *                     String (Optional)
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
      *                 ]
-     *                 examples (Optional): [
-     *                     String (Optional)
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
      *                 ]
      *             }
-     *         ]
-     *     }
-     * }
-     * }
-     * 
- * - *

Response Body Schema

- * - *
-     * {@code
-     * {
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *     id: String (Required)
-     *     name: String (Required)
-     *     versions (Required): {
-     *         latest (Required): {
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
-     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *             id: String (Required)
-     *             name: String (Required)
-     *             version: String (Required)
-     *             description: String (Optional)
-     *             created_at: long (Required)
-     *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
-     *                 rai_config (Optional): {
-     *                     rai_policy_name: String (Required)
-     *                 }
-     *             }
-     *             instance_identity (Optional): {
-     *                 principal_id: String (Required)
-     *                 client_id: String (Required)
-     *             }
-     *             blueprint (Optional): (recursive schema, see blueprint above)
-     *             blueprint_reference (Optional): {
-     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
      *             }
-     *             agent_guid: String (Optional)
-     *         }
-     *     }
-     *     agent_endpoint (Optional): {
-     *         version_selector (Optional): {
-     *             version_selection_rules (Optional, Required on create): [
-     *                  (Optional, Required on create){
-     *                     type: String(FixedRatio) (Required)
-     *                     agent_version: String (Optional, Required on create)
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
      *                 }
      *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
      *         }
-     *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
      *         ]
-     *         authorization_schemes (Optional): [
-     *              (Optional){
-     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
      *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
      *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     instance_identity (Optional): (recursive schema, see instance_identity above)
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
-     *     agent_card (Optional): {
-     *         version: String (Optional, Required on create)
-     *         description: String (Optional)
-     *         skills (Optional, Required on create): [
-     *              (Optional, Required on create){
-     *                 id: String (Optional, Required on create)
-     *                 name: String (Optional, Required on create)
-     *                 description: String (Optional)
-     *                 tags (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 examples (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *             }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
      *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve. - * @param patchAgentObjectRequest The patchAgentObjectRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateAgentDetailsWithResponseAsync(String agentName, - BinaryData patchAgentObjectRequest, RequestOptions requestOptions) { - final String contentType = "application/merge-patch+json"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateAgentDetails(this.client.getEndpoint(), agentName, - contentType, this.client.getServiceVersion().getVersion(), accept, patchAgentObjectRequest, requestOptions, - context)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listOptimizationJobs(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listOptimizationJobsSinglePage(requestOptions)); } /** - * Updates an agent endpoint. + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

+ *

Response Body Schema

* *
      * {@code
      * {
-     *     agent_endpoint (Optional): {
-     *         version_selector (Optional): {
-     *             version_selection_rules (Optional, Required on create): [
-     *                  (Optional, Required on create){
-     *                     type: String(FixedRatio) (Required)
-     *                     agent_version: String (Optional, Required on create)
+     *     id: 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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
      *                 }
      *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
      *         }
-     *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
      *         ]
-     *         authorization_schemes (Optional): [
-     *              (Optional){
-     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
      *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
      *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     agent_card (Optional): {
-     *         version: String (Optional, Required on create)
-     *         description: String (Optional)
-     *         skills (Optional, Required on create): [
-     *              (Optional, Required on create){
-     *                 id: String (Optional, Required on create)
-     *                 name: String (Optional, Required on create)
-     *                 description: String (Optional)
-     *                 tags (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 examples (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *             }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
      *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
      * }
      * }
      * 
* + * @param jobId The ID of the job to cancel. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelOptimizationJobWithResponseAsync(String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.cancelOptimizationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Cancels an agent optimization job. + * + * Request cancellation. Idempotent on terminal states. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
      * {
-     *     object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
      *     id: String (Required)
-     *     name: String (Required)
-     *     versions (Required): {
-     *         latest (Required): {
-     *             metadata (Required): {
-     *                 String: String (Required)
-     *             }
-     *             object: String(agent/agent.version/agent.deleted/agent.version.deleted/agent.container) (Required)
-     *             id: String (Required)
+     *     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)
+     *         }
+     *     }
+     *     result (Optional): {
+     *         baseline (Optional): {
+     *             candidate_id: String (Optional)
      *             name: String (Required)
-     *             version: String (Required)
-     *             description: String (Optional)
-     *             created_at: long (Required)
-     *             definition (Required): {
-     *                 kind: String(prompt/hosted/workflow) (Required)
-     *                 rai_config (Optional): {
-     *                     rai_policy_name: String (Required)
-     *                 }
-     *             }
-     *             instance_identity (Optional): {
-     *                 principal_id: String (Required)
-     *                 client_id: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
      *             }
-     *             blueprint (Optional): (recursive schema, see blueprint above)
-     *             blueprint_reference (Optional): {
-     *                 type: String(ManagedAgentIdentityBlueprint) (Required)
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
      *             }
-     *             agent_guid: String (Optional)
-     *         }
-     *     }
-     *     agent_endpoint (Optional): {
-     *         version_selector (Optional): {
-     *             version_selection_rules (Optional, Required on create): [
-     *                  (Optional, Required on create){
-     *                     type: String(FixedRatio) (Required)
-     *                     agent_version: String (Optional, Required on create)
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
      *                 }
      *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
      *         }
-     *         protocols (Optional): [
-     *             String(activity/responses/a2a/invocations) (Optional)
+     *         best (Optional): (recursive schema, see best above)
+     *         candidates (Optional): [
+     *             (recursive schema, see above)
      *         ]
-     *         authorization_schemes (Optional): [
-     *              (Optional){
-     *                 type: String(Entra/BotService/BotServiceRbac) (Required)
+     *         options (Optional): {
+     *             max_iterations: Integer (Optional)
+     *             optimization_config (Optional): {
+     *                 String: BinaryData (Required)
      *             }
+     *             eval_model: String (Optional)
+     *             optimization_model: String (Optional)
+     *             evaluation_level: String(turn/conversation) (Optional)
+     *         }
+     *         warnings (Optional): [
+     *             String (Optional)
      *         ]
+     *         all_target_attributes_failed: Boolean (Optional)
      *     }
-     *     instance_identity (Optional): (recursive schema, see instance_identity above)
-     *     blueprint (Optional): (recursive schema, see blueprint above)
-     *     blueprint_reference (Optional): (recursive schema, see blueprint_reference above)
-     *     agent_card (Optional): {
-     *         version: String (Optional, Required on create)
-     *         description: String (Optional)
-     *         skills (Optional, Required on create): [
-     *              (Optional, Required on create){
-     *                 id: String (Optional, Required on create)
-     *                 name: String (Optional, Required on create)
-     *                 description: String (Optional)
-     *                 tags (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *                 examples (Optional): [
-     *                     String (Optional)
-     *                 ]
-     *             }
+     *     inputs (Optional): {
+     *         agent (Required): {
+     *             agent_name: String (Required)
+     *             agent_version: String (Optional)
+     *         }
+     *         train_dataset_reference (Required): {
+     *             name: String (Required)
+     *             version: String (Optional)
+     *         }
+     *         validation_dataset_reference (Optional): (recursive schema, see validation_dataset_reference above)
+     *         evaluators (Optional): [
+     *             String (Optional)
      *         ]
+     *         options (Optional): (recursive schema, see options above)
+     *     }
+     *     created_at: long (Required)
+     *     updated_at: Long (Optional)
+     *     progress (Optional): {
+     *         current_iteration: int (Required)
+     *         best_score: double (Required)
+     *         elapsed_seconds: double (Required)
+     *     }
+     *     dataset (Optional): {
+     *         name: String (Optional)
+     *         version: String (Optional)
+     *         task_count: int (Required)
+     *         is_inline: boolean (Required)
      *     }
      * }
      * }
      * 
* - * @param agentName The name of the agent to retrieve. - * @param patchAgentObjectRequest The patchAgentObjectRequest parameter. + * @param jobId The ID of the job to cancel. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @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}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateAgentDetailsWithResponse(String agentName, BinaryData patchAgentObjectRequest, - RequestOptions requestOptions) { - final String contentType = "application/merge-patch+json"; + public Response cancelOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.updateAgentDetailsSync(this.client.getEndpoint(), agentName, contentType, - this.client.getServiceVersion().getVersion(), accept, patchAgentObjectRequest, requestOptions, - Context.NONE); + return service.cancelOptimizationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * 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. + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoWhen true, force-delete even if the job is in a non-terminal + * state.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteOptimizationJobWithResponseAsync(String jobId, RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteOptimizationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), requestOptions, context)); + } + + /** + * Deletes an agent optimization job. + * + * Delete the job and its candidate artifacts. Cancels first if non-terminal. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
forceBooleanNoWhen true, force-delete even if the job is in a non-terminal + * state.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteOptimizationJobWithResponse(String jobId, RequestOptions requestOptions) { + return service.deleteOptimizationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + } + + /** + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     agent_session_id: String (Optional)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     * }
-     * }
-     * 
- * *

Response Body Schema

* *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     data (Required): [
+     *          (Required){
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Optional)
+     *     last_id: String (Optional)
+     *     has_more: boolean (Required)
      * }
      * }
      * 
* - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param createSessionRequest The createSessionRequest parameter. + * @param jobId The optimization job id. * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with - * {@link Response} on successful completion of {@link Mono}. + * @return the response data for a requested list of items along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSessionWithResponseAsync(String agentName, String isolationKey, - BinaryData createSessionRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; + public Mono> listOptimizationCandidatesWithResponseAsync(String jobId, + RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createSession(this.client.getEndpoint(), agentName, isolationKey, - this.client.getServiceVersion().getVersion(), contentType, accept, createSessionRequest, requestOptions, - context)); + return FluxUtil.withContext(context -> service.listOptimizationCandidates(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * 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. + * Returns a list of candidates for an optimization job. + * + * List candidates produced by a job. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} - *

Request Body Schema

- * - *
-     * {@code
-     * {
-     *     agent_session_id: String (Optional)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     * }
-     * }
-     * 
- * *

Response Body Schema

* *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     data (Required): [
+     *          (Required){
+     *             candidate_id: String (Optional)
+     *             name: String (Required)
+     *             config (Required): {
+     *                 agent_name: String (Optional)
+     *                 agent_version: String (Optional)
+     *                 model: String (Optional)
+     *                 system_prompt: String (Optional)
+     *                 skills (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *                 tools (Optional): [
+     *                      (Optional){
+     *                         String: BinaryData (Required)
+     *                     }
+     *                 ]
+     *             }
+     *             mutations (Required): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             avg_score: double (Required)
+     *             avg_tokens: double (Required)
+     *             pass_rate: double (Required)
+     *             task_scores (Required): [
+     *                  (Required){
+     *                     task_name: String (Required)
+     *                     query: String (Optional)
+     *                     scores (Required): {
+     *                         String: double (Required)
+     *                     }
+     *                     composite_score: double (Required)
+     *                     tokens: long (Required)
+     *                     duration_seconds: double (Required)
+     *                     passed: boolean (Required)
+     *                     error_message: String (Optional)
+     *                     rationales (Optional): {
+     *                         String: String (Required)
+     *                     }
+     *                     response: String (Optional)
+     *                     run_id: String (Optional)
+     *                 }
+     *             ]
+     *             is_pareto_optimal: boolean (Required)
+     *             eval_id: String (Optional)
+     *             eval_run_id: String (Optional)
+     *             promotion (Optional): {
+     *                 promoted_at: long (Required)
+     *                 agent_name: String (Required)
+     *                 agent_version: String (Required)
+     *             }
+     *         }
+     *     ]
+     *     first_id: String (Optional)
+     *     last_id: String (Optional)
+     *     has_more: boolean (Required)
      * }
      * }
      * 
* - * @param agentName The name of the agent to create a session for. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @param createSessionRequest The createSessionRequest parameter. + * @param jobId The optimization job id. * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with - * {@link Response}. + * @return the response data for a requested list of items along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSessionWithResponse(String agentName, String isolationKey, - BinaryData createSessionRequest, RequestOptions requestOptions) { - final String contentType = "application/json"; + public Response listOptimizationCandidatesWithResponse(String jobId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.createSessionSync(this.client.getEndpoint(), agentName, isolationKey, - this.client.getServiceVersion().getVersion(), contentType, accept, createSessionRequest, requestOptions, - Context.NONE); + return service.listOptimizationCandidatesSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Retrieves a session by ID. + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -3494,45 +7309,63 @@ public Response createSessionWithResponse(String agentName, String i *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     candidate_id: String (Required)
+     *     job_id: String (Required)
+     *     candidate_name: String (Required)
+     *     status: String (Required)
+     *     score: Double (Optional)
+     *     has_results: boolean (Required)
      *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     updated_at: long (Required)
+     *     promotion (Optional): {
+     *         promoted_at: long (Required)
+     *         agent_name: String (Required)
+     *         agent_version: String (Required)
+     *     }
+     *     files (Required): [
+     *          (Required){
+     *             path: String (Required)
+     *             type: String (Required)
+     *             size_bytes: long (Required)
+     *         }
+     *     ]
      * }
      * }
      * 
* - * @param agentName The name of the agent. - * @param sessionId The session identifier. + * @param jobId The optimization job id. + * @param candidateId The candidate id. * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with - * {@link Response} on successful completion of {@link Mono}. + * @return a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSessionWithResponseAsync(String agentName, String sessionId, + public Mono> getOptimizationCandidateWithResponseAsync(String jobId, String candidateId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSession(this.client.getEndpoint(), agentName, sessionId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getOptimizationCandidate(this.client.getEndpoint(), jobId, + candidateId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Retrieves a session by ID. + * Get a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -3540,127 +7373,118 @@ public Mono> getSessionWithResponseAsync(String agentName, *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
+     *     candidate_id: String (Required)
+     *     job_id: String (Required)
+     *     candidate_name: String (Required)
+     *     status: String (Required)
+     *     score: Double (Optional)
+     *     has_results: boolean (Required)
      *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     updated_at: long (Required)
+     *     promotion (Optional): {
+     *         promoted_at: long (Required)
+     *         agent_name: String (Required)
+     *         agent_version: String (Required)
+     *     }
+     *     files (Required): [
+     *          (Required){
+     *             path: String (Required)
+     *             type: String (Required)
+     *             size_bytes: long (Required)
+     *         }
+     *     ]
      * }
      * }
      * 
* - * @param agentName The name of the agent. - * @param sessionId The session identifier. + * @param jobId The optimization job id. + * @param candidateId The candidate id. * @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 an agent session providing a long-lived compute sandbox for hosted agent invocations along with - * {@link Response}. + * @return a candidate by id. + * + * Get a single candidate's metadata, manifest, and promotion info along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSessionWithResponse(String agentName, String sessionId, + public Response getOptimizationCandidateWithResponse(String jobId, String candidateId, RequestOptions requestOptions) { final String accept = "application/json"; - return service.getSessionSync(this.client.getEndpoint(), agentName, sessionId, + return service.getOptimizationCandidateSync(this.client.getEndpoint(), jobId, candidateId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. - *

Header Parameters

- * - * - * - * - *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
- * You can add these to a request with {@link RequestOptions#addHeader} + * Get candidate deploy config. * - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. - * @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 Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSessionWithResponseAsync(String agentName, String sessionId, String isolationKey, - RequestOptions requestOptions) { - return FluxUtil.withContext(context -> service.deleteSession(this.client.getEndpoint(), agentName, sessionId, - isolationKey, this.client.getServiceVersion().getVersion(), requestOptions, context)); - } - - /** - * Deletes a session synchronously. - * Returns 204 No Content when the session is deleted or does not exist. + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

* - * @param agentName The name of the agent. - * @param sessionId The session identifier. - * @param isolationKey Isolation key used by the agent endpoint to enforce session ownership for session-mutating - * operations. + *
+     * {@code
+     * {
+     *     instructions: String (Optional)
+     *     model: String (Optional)
+     *     temperature: Double (Optional)
+     *     skills (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param jobId The optimization job id. + * @param candidateId The candidate id. * @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 Response}. + * @return candidate deploy config. + * + * Get the candidate's deploy config JSON along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSessionWithResponse(String agentName, String sessionId, String isolationKey, + public Mono> getOptimizationCandidateConfigWithResponseAsync(String jobId, String candidateId, RequestOptions requestOptions) { - return service.deleteSessionSync(this.client.getEndpoint(), agentName, sessionId, isolationKey, - this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getOptimizationCandidateConfig(this.client.getEndpoint(), jobId, + candidateId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Returns a list of sessions for the specified agent. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get candidate deploy config. + * + * Get the candidate's deploy config JSON. Used to compose `agents.create_version(...)` from a candidate. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -3668,67 +7492,55 @@ public Response deleteSessionWithResponse(String agentName, String session *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     instructions: String (Optional)
+     *     model: String (Optional)
+     *     temperature: Double (Optional)
+     *     skills (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
+     *     tools (Optional): [
+     *          (Optional){
+     *             String: BinaryData (Required)
+     *         }
+     *     ]
      * }
      * }
      * 
* - * @param agentName The name of the agent. + * @param jobId The optimization job id. + * @param candidateId The candidate id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return candidate deploy config. + * + * Get the candidate's deploy config JSON along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSessionsSinglePageAsync(String agentName, + public Response getOptimizationCandidateConfigWithResponse(String jobId, String candidateId, RequestOptions requestOptions) { final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listSessions(this.client.getEndpoint(), agentName, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "data"), null, null)); + return service.getOptimizationCandidateConfigSync(this.client.getEndpoint(), jobId, candidateId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Returns a list of sessions for the specified agent. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -3736,60 +7548,63 @@ private Mono> listSessionsSinglePageAsync(String agent *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     candidate_id: String (Required)
+     *     results (Required): [
+     *          (Required){
+     *             task_name: String (Required)
+     *             query: String (Optional)
+     *             scores (Required): {
+     *                 String: double (Required)
+     *             }
+     *             composite_score: double (Required)
+     *             tokens: long (Required)
+     *             duration_seconds: double (Required)
+     *             passed: boolean (Required)
+     *             error_message: String (Optional)
+     *             rationales (Optional): {
+     *                 String: String (Required)
+     *             }
+     *             response: String (Optional)
+     *             run_id: String (Optional)
+     *         }
+     *     ]
      * }
      * }
      * 
* - * @param agentName The name of the agent. + * @param jobId The optimization job id. + * @param candidateId The candidate id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + * @return candidate evaluation results. + * + * Get full per-task evaluation results for a candidate along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSessionsAsync(String agentName, RequestOptions requestOptions) { - return new PagedFlux<>(() -> listSessionsSinglePageAsync(agentName, requestOptions)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationCandidateResultsWithResponseAsync(String jobId, String candidateId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getOptimizationCandidateResults(this.client.getEndpoint(), jobId, + candidateId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Returns a list of sessions for the specified agent. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get candidate evaluation results. + * + * Get full per-task evaluation results for a candidate. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -3797,232 +7612,255 @@ public PagedFlux listSessionsAsync(String agentName, RequestOptions *
      * {@code
      * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
+     *     candidate_id: String (Required)
+     *     results (Required): [
+     *          (Required){
+     *             task_name: String (Required)
+     *             query: String (Optional)
+     *             scores (Required): {
+     *                 String: double (Required)
+     *             }
+     *             composite_score: double (Required)
+     *             tokens: long (Required)
+     *             duration_seconds: double (Required)
+     *             passed: boolean (Required)
+     *             error_message: String (Optional)
+     *             rationales (Optional): {
+     *                 String: String (Required)
+     *             }
+     *             response: String (Optional)
+     *             run_id: String (Optional)
+     *         }
+     *     ]
      * }
      * }
      * 
* - * @param agentName The name of the agent. + * @param jobId The optimization job id. + * @param candidateId The candidate id. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items along with {@link PagedResponse}. + * @return candidate evaluation results. + * + * Get full per-task evaluation results for a candidate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSessionsSinglePage(String agentName, RequestOptions requestOptions) { + public Response getOptimizationCandidateResultsWithResponse(String jobId, String candidateId, + RequestOptions requestOptions) { final String accept = "application/json"; - Response res = service.listSessionsSync(this.client.getEndpoint(), agentName, + return service.getOptimizationCandidateResultsSync(this.client.getEndpoint(), jobId, candidateId, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "data"), null, null); } /** - * Returns a list of sessions for the specified agent. - *

Query Parameters

- * - * - * - * - * - * - * - *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range - * between 1 and 100, and the - * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` - * for ascending order and`desc` - * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that - * defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
- * You can add these to a request with {@link RequestOptions#addQueryParam} + * Get a candidate file. + * + * Stream a specific file from the candidate's blob directory. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
-     * {
-     *     agent_session_id: String (Required)
-     *     version_indicator (Required): {
-     *         type: String(version_ref) (Required)
-     *     }
-     *     status: String(creating/active/idle/updating/failed/deleting/deleted/expired) (Required)
-     *     created_at: long (Required)
-     *     last_accessed_at: long (Required)
-     *     expires_at: long (Required)
-     * }
+     * BinaryData
      * }
      * 
* - * @param agentName The name of the agent. + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + * @return a candidate file. + * + * Stream a specific file from the candidate's blob directory along with {@link Response} on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSessions(String agentName, RequestOptions requestOptions) { - return new PagedIterable<>(() -> listSessionsSinglePage(agentName, requestOptions)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getOptimizationCandidateFileWithResponseAsync(String jobId, String candidateId, + String path, RequestOptions requestOptions) { + final String accept = "application/octet-stream"; + return FluxUtil.withContext(context -> service.getOptimizationCandidateFile(this.client.getEndpoint(), jobId, + candidateId, path, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Streams console logs (stdout / stderr) for a specific hosted agent session - * as a Server-Sent Events (SSE) stream. - * - * Each SSE frame contains: - * - `event`: always `"log"` - * - `data`: a plain-text log line (currently JSON-formatted, but the schema - * is not contractual and may include additional keys or change format - * over time — clients should treat it as an opaque string) - * - * Example SSE frames: - * ``` - * event: log - * data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port - * 8088"} - * - * event: log - * data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} - * - * event: log - * data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} - * - * event: log - * data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} - * ``` + * Get a candidate file. * - * The stream remains open until the client disconnects or the server - * terminates the connection. Clients should handle reconnection as needed. + * Stream a specific file from the candidate's blob directory. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
      * {@code
-     * {
-     *     event: String(log) (Required)
-     *     data: String (Required)
-     * }
+     * BinaryData
      * }
      * 
* - * @param agentName The name of the hosted agent. - * @param agentVersion The version of the agent. - * @param sessionId The session ID (maps to an ADC sandbox). + * @param jobId The optimization job id. + * @param candidateId The candidate id. + * @param path Relative path of the file to download (e.g. 'files/examples.jsonl'). * @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 a single Server-Sent Event frame emitted by the hosted agent session log stream. + * @return a candidate file. * - * Each frame contains an `event` field identifying the event type and a `data` - * field carrying the payload as plain text along with {@link Response} on successful completion of {@link Mono}. + * Stream a specific file from the candidate's blob directory along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSessionLogStreamWithResponseAsync(String agentName, String agentVersion, - String sessionId, RequestOptions requestOptions) { - final String accept = "text/event-stream"; - return FluxUtil.withContext(context -> service.getSessionLogStream(this.client.getEndpoint(), agentName, - agentVersion, sessionId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + public Response getOptimizationCandidateFileWithResponse(String jobId, String candidateId, String path, + RequestOptions requestOptions) { + final String accept = "application/octet-stream"; + return service.getOptimizationCandidateFileSync(this.client.getEndpoint(), jobId, candidateId, path, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Streams console logs (stdout / stderr) for a specific hosted agent session - * as a Server-Sent Events (SSE) stream. + * Promote a candidate. * - * Each SSE frame contains: - * - `event`: always `"log"` - * - `data`: a plain-text log line (currently JSON-formatted, but the schema - * is not contractual and may include additional keys or change format - * over time — clients should treat it as an opaque string) + * Promotes a candidate, recording the deployment timestamp and target agent version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

* - * Example SSE frames: - * ``` - * event: log - * data: {"timestamp":"2026-03-10T09:33:17.121Z","stream":"stdout","message":"Starting FoundryCBAgent server on port - * 8088"} + *
+     * {@code
+     * {
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
* - * event: log - * data: {"timestamp":"2026-03-10T09:33:17.130Z","stream":"stderr","message":"INFO: Application startup complete."} + *

Response Body Schema

* - * event: log - * data: {"timestamp":"2026-03-10T09:34:52.714Z","stream":"status","message":"Successfully connected to container"} + *
+     * {@code
+     * {
+     *     candidate_id: String (Required)
+     *     status: String (Required)
+     *     promoted_at: long (Required)
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
* - * event: log - * data: {"timestamp":"2026-03-10T09:35:52.714Z","stream":"status","message":"No logs since last 60 seconds"} - * ``` + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. + * @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 response after successfully promoting a candidate along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> promoteOptimizationCandidateWithResponseAsync(String jobId, String candidateId, + BinaryData candidateRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.promoteOptimizationCandidate(this.client.getEndpoint(), jobId, + candidateId, this.client.getServiceVersion().getVersion(), contentType, accept, candidateRequest, + requestOptions, context)); + } + + /** + * Promote a candidate. * - * The stream remains open until the client disconnects or the server - * terminates the connection. Clients should handle reconnection as needed. + * Promotes a candidate, recording the deployment timestamp and target agent version. *

Header Parameters

* * * * + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview - * operations or modifying persisted preview resources. Allowed values: "HostedAgents=V1Preview", - * "WorkflowAgents=V1Preview", "ContainerAgents=V1Preview", "AgentEndpoints=V1Preview".
* You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     event: String(log) (Required)
-     *     data: String (Required)
+     *     candidate_id: String (Required)
+     *     status: String (Required)
+     *     promoted_at: long (Required)
+     *     agent_name: String (Required)
+     *     agent_version: String (Required)
      * }
      * }
      * 
* - * @param agentName The name of the hosted agent. - * @param agentVersion The version of the agent. - * @param sessionId The session ID (maps to an ADC sandbox). + * @param jobId The optimization job id. + * @param candidateId The candidate id to promote. + * @param candidateRequest Promotion details. * @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 a single Server-Sent Event frame emitted by the hosted agent session log stream. - * - * Each frame contains an `event` field identifying the event type and a `data` - * field carrying the payload as plain text along with {@link Response}. + * @return response after successfully promoting a candidate along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSessionLogStreamWithResponse(String agentName, String agentVersion, String sessionId, - RequestOptions requestOptions) { - final String accept = "text/event-stream"; - return service.getSessionLogStreamSync(this.client.getEndpoint(), agentName, agentVersion, sessionId, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + public Response promoteOptimizationCandidateWithResponse(String jobId, String candidateId, + BinaryData candidateRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.promoteOptimizationCandidateSync(this.client.getEndpoint(), jobId, candidateId, + this.client.getServiceVersion().getVersion(), contentType, accept, candidateRequest, requestOptions, + Context.NONE); } /** @@ -4051,6 +7889,14 @@ public Response getSessionLogStreamWithResponse(String agentName, St * only items associated with the specified agent ID will be returned. * * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -4112,6 +7958,14 @@ private Mono> listAgentConversationsSinglePageAsync(Re
      * only items associated with the specified agent ID will be returned.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -4167,6 +8021,14 @@ public PagedFlux listAgentConversationsAsync(RequestOptions requestO
      * only items associated with the specified agent ID will be returned.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
@@ -4226,6 +8088,14 @@ private PagedResponse listAgentConversationsSinglePage(RequestOption
      * only items associated with the specified agent ID will be returned.
      * 
      * You can add these to a request with {@link RequestOptions#addQueryParam}
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
x-ms-user-isolation-keyStringNoOpaque per-user isolation key used to scope + * endpoint-scoped data (responses, conversations, sessions) to a specific end user.
+ * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

* *
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/JsonMergePatchHelper.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/JsonMergePatchHelper.java
index 4532d5025766..3a94b150ab01 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/JsonMergePatchHelper.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/JsonMergePatchHelper.java
@@ -6,8 +6,8 @@
 
 import com.azure.ai.agents.models.AgentCard;
 import com.azure.ai.agents.models.AgentCardSkill;
-import com.azure.ai.agents.models.AgentEndpoint;
 import com.azure.ai.agents.models.AgentEndpointAuthorizationScheme;
+import com.azure.ai.agents.models.AgentEndpointConfig;
 import com.azure.ai.agents.models.IsolationKeySource;
 import com.azure.ai.agents.models.UpdateAgentDetailsOptions;
 import com.azure.ai.agents.models.VersionSelectionRule;
@@ -17,20 +17,21 @@
  * This is the Helper class to enable json merge patch serialization for a model.
  */
 public class JsonMergePatchHelper {
-    private static AgentEndpointAccessor agentEndpointAccessor;
+    private static AgentEndpointConfigAccessor agentEndpointConfigAccessor;
 
-    public interface AgentEndpointAccessor {
-        AgentEndpoint prepareModelForJsonMergePatch(AgentEndpoint agentEndpoint, boolean jsonMergePatchEnabled);
+    public interface AgentEndpointConfigAccessor {
+        AgentEndpointConfig prepareModelForJsonMergePatch(AgentEndpointConfig agentEndpointConfig,
+            boolean jsonMergePatchEnabled);
 
-        boolean isJsonMergePatch(AgentEndpoint agentEndpoint);
+        boolean isJsonMergePatch(AgentEndpointConfig agentEndpointConfig);
     }
 
-    public static void setAgentEndpointAccessor(AgentEndpointAccessor accessor) {
-        agentEndpointAccessor = accessor;
+    public static void setAgentEndpointConfigAccessor(AgentEndpointConfigAccessor accessor) {
+        agentEndpointConfigAccessor = accessor;
     }
 
-    public static AgentEndpointAccessor getAgentEndpointAccessor() {
-        return agentEndpointAccessor;
+    public static AgentEndpointConfigAccessor getAgentEndpointConfigAccessor() {
+        return agentEndpointConfigAccessor;
     }
 
     private static VersionSelectorAccessor versionSelectorAccessor;
diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java
index 9e78a3c93a4d..0f02c67b8e02 100644
--- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java
+++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java
@@ -117,7 +117,7 @@ Response createMemoryStoreSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> updateMemoryStore(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateMemoryStoreRequest,
             RequestOptions requestOptions, Context context);
@@ -129,7 +129,7 @@ Mono> updateMemoryStore(@HostParam("endpoint") String endpo
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response updateMemoryStoreSync(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateMemoryStoreRequest,
             RequestOptions requestOptions, Context context);
@@ -141,7 +141,7 @@ Response updateMemoryStoreSync(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getMemoryStore(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
@@ -151,9 +151,10 @@ Mono> getMemoryStore(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getMemoryStoreSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name,
-            @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion,
-            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+        Response getMemoryStoreSync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+            RequestOptions requestOptions, Context context);
 
         @Get("/memory_stores")
         @ExpectedResponses({ 200 })
@@ -182,7 +183,7 @@ Response listMemoryStoresSync(@HostParam("endpoint") String endpoint
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> internalDeleteMemoryStore(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
@@ -193,7 +194,7 @@ Mono> internalDeleteMemoryStore(@HostParam("endpoint") Stri
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response internalDeleteMemoryStoreSync(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
             RequestOptions requestOptions, Context context);
 
@@ -204,7 +205,7 @@ Response internalDeleteMemoryStoreSync(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> internalSearchMemories(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData searchMemoriesRequest,
             RequestOptions requestOptions, Context context);
@@ -216,7 +217,7 @@ Mono> internalSearchMemories(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response internalSearchMemoriesSync(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData searchMemoriesRequest,
             RequestOptions requestOptions, Context context);
@@ -228,7 +229,7 @@ Response internalSearchMemoriesSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> internalUpdateMemories(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateMemoriesRequest,
             RequestOptions requestOptions, Context context);
@@ -240,7 +241,7 @@ Mono> internalUpdateMemories(@HostParam("endpoint") String
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response internalUpdateMemoriesSync(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateMemoriesRequest,
             RequestOptions requestOptions, Context context);
@@ -252,8 +253,8 @@ Response internalUpdateMemoriesSync(@HostParam("endpoint") String en
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> getUpdateResult(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @PathParam("update_id") String updateId,
-            @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("update_id") String updateId, @QueryParam("api-version") String apiVersion,
             @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Get("/memory_stores/{name}/updates/{update_id}")
@@ -262,10 +263,10 @@ Mono> getUpdateResult(@HostParam("endpoint") String endpoin
         @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
-        Response getUpdateResultSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name,
-            @PathParam("update_id") String updateId, @HeaderParam("Foundry-Features") String foundryFeatures,
-            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
-            RequestOptions requestOptions, Context context);
+        Response getUpdateResultSync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("update_id") String updateId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
 
         @Post("/memory_stores/{name}:delete_scope")
         @ExpectedResponses({ 200 })
@@ -274,7 +275,7 @@ Response getUpdateResultSync(@HostParam("endpoint") String endpoint,
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Mono> internalDeleteScope(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData deleteScopeRequest,
             RequestOptions requestOptions, Context context);
@@ -286,10 +287,128 @@ Mono> internalDeleteScope(@HostParam("endpoint") String end
         @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
         @UnexpectedResponseExceptionType(HttpResponseException.class)
         Response internalDeleteScopeSync(@HostParam("endpoint") String endpoint,
-            @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
             @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
             @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData deleteScopeRequest,
             RequestOptions requestOptions, Context context);
+
+        @Post("/memory_stores/{name}/items")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Mono> createMemory(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createMemoryRequest,
+            RequestOptions requestOptions, Context context);
+
+        @Post("/memory_stores/{name}/items")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Response createMemorySync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType,
+            @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createMemoryRequest,
+            RequestOptions requestOptions, Context context);
+
+        @Post("/memory_stores/{name}/items/{memory_id}")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Mono> updateMemory(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("memory_id") String memoryId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData updateMemoryRequest, RequestOptions requestOptions,
+            Context context);
+
+        @Post("/memory_stores/{name}/items/{memory_id}")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Response updateMemorySync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("memory_id") String memoryId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData updateMemoryRequest, RequestOptions requestOptions,
+            Context context);
+
+        @Get("/memory_stores/{name}/items/{memory_id}")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Mono> getMemory(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("memory_id") String memoryId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+        @Get("/memory_stores/{name}/items/{memory_id}")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Response getMemorySync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("memory_id") String memoryId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+        @Post("/memory_stores/{name}/items:list")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Mono> listMemories(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData listMemoriesRequest, RequestOptions requestOptions,
+            Context context);
+
+        @Post("/memory_stores/{name}/items:list")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Response listMemoriesSync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept,
+            @BodyParam("application/json") BinaryData listMemoriesRequest, RequestOptions requestOptions,
+            Context context);
+
+        @Delete("/memory_stores/{name}/items/{memory_id}")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Mono> internalDeleteMemory(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("memory_id") String memoryId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
+
+        @Delete("/memory_stores/{name}/items/{memory_id}")
+        @ExpectedResponses({ 200 })
+        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
+        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
+        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
+        @UnexpectedResponseExceptionType(HttpResponseException.class)
+        Response internalDeleteMemorySync(@HostParam("endpoint") String endpoint,
+            @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name,
+            @PathParam("memory_id") String memoryId, @QueryParam("api-version") String apiVersion,
+            @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context);
     }
 
     /**
@@ -316,7 +435,7 @@ Response internalDeleteScopeSync(@HostParam("endpoint") String endpo
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -376,7 +495,7 @@ public Mono> createMemoryStoreWithResponseAsync(BinaryData
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -431,7 +550,7 @@ public Response createMemoryStoreWithResponse(BinaryData createMemor
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -463,9 +582,9 @@ public Mono> updateMemoryStoreWithResponseAsync(String name
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.updateMemoryStore(this.client.getEndpoint(), name,
-            foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept,
-            updateMemoryStoreRequest, requestOptions, context));
+        return FluxUtil.withContext(context -> service.updateMemoryStore(this.client.getEndpoint(), foundryFeatures,
+            name, this.client.getServiceVersion().getVersion(), contentType, accept, updateMemoryStoreRequest,
+            requestOptions, context));
     }
 
     /**
@@ -488,7 +607,7 @@ public Mono> updateMemoryStoreWithResponseAsync(String name
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -519,7 +638,7 @@ public Response updateMemoryStoreWithResponse(String name, BinaryDat
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return service.updateMemoryStoreSync(this.client.getEndpoint(), name, foundryFeatures,
+        return service.updateMemoryStoreSync(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), contentType, accept, updateMemoryStoreRequest, requestOptions,
             Context.NONE);
     }
@@ -531,7 +650,7 @@ public Response updateMemoryStoreWithResponse(String name, BinaryDat
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -560,7 +679,7 @@ public Response updateMemoryStoreWithResponse(String name, BinaryDat
     public Mono> getMemoryStoreWithResponseAsync(String name, RequestOptions requestOptions) {
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getMemoryStore(this.client.getEndpoint(), name, foundryFeatures,
+        return FluxUtil.withContext(context -> service.getMemoryStore(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
     }
 
@@ -571,7 +690,7 @@ public Mono> getMemoryStoreWithResponseAsync(String name, R
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -599,7 +718,7 @@ public Mono> getMemoryStoreWithResponseAsync(String name, R
     public Response getMemoryStoreWithResponse(String name, RequestOptions requestOptions) {
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String accept = "application/json";
-        return service.getMemoryStoreSync(this.client.getEndpoint(), name, foundryFeatures,
+        return service.getMemoryStoreSync(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
     }
 
@@ -630,7 +749,7 @@ public Response getMemoryStoreWithResponse(String name, RequestOptio
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -692,7 +811,7 @@ private Mono> listMemoryStoresSinglePageAsync(RequestO
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -747,7 +866,7 @@ public PagedFlux listMemoryStoresAsync(RequestOptions requestOptions
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -807,7 +926,7 @@ private PagedResponse listMemoryStoresSinglePage(RequestOptions requ
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     id: String (Required)
      *     created_at: long (Required)
      *     updated_at: long (Required)
@@ -842,7 +961,7 @@ public PagedIterable listMemoryStores(RequestOptions requestOptions)
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     deleted: boolean (Required)
      * }
@@ -862,8 +981,8 @@ public Mono> internalDeleteMemoryStoreWithResponseAsync(Str
         RequestOptions requestOptions) {
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.internalDeleteMemoryStore(this.client.getEndpoint(), name,
-            foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.internalDeleteMemoryStore(this.client.getEndpoint(),
+            foundryFeatures, name, this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
     }
 
     /**
@@ -873,7 +992,7 @@ public Mono> internalDeleteMemoryStoreWithResponseAsync(Str
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     deleted: boolean (Required)
      * }
@@ -892,7 +1011,7 @@ public Mono> internalDeleteMemoryStoreWithResponseAsync(Str
     public Response internalDeleteMemoryStoreWithResponse(String name, RequestOptions requestOptions) {
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String accept = "application/json";
-        return service.internalDeleteMemoryStoreSync(this.client.getEndpoint(), name, foundryFeatures,
+        return service.internalDeleteMemoryStoreSync(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
     }
 
@@ -905,9 +1024,7 @@ public Response internalDeleteMemoryStoreWithResponse(String name, R
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_search_id: String (Optional)
      *     options (Optional): {
@@ -926,7 +1043,7 @@ public Response internalDeleteMemoryStoreWithResponse(String name, R
      *     memories (Required): [
      *          (Required){
      *             memory_item (Required): {
-     *                 kind: String(user_profile/chat_summary) (Required)
+     *                 kind: String(user_profile/chat_summary/procedural) (Required)
      *                 memory_id: String (Required)
      *                 updated_at: long (Required)
      *                 scope: String (Required)
@@ -965,9 +1082,9 @@ public Mono> internalSearchMemoriesWithResponseAsync(String
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.internalSearchMemories(this.client.getEndpoint(), name,
-            foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, searchMemoriesRequest,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.internalSearchMemories(this.client.getEndpoint(),
+            foundryFeatures, name, this.client.getServiceVersion().getVersion(), contentType, accept,
+            searchMemoriesRequest, requestOptions, context));
     }
 
     /**
@@ -979,9 +1096,7 @@ public Mono> internalSearchMemoriesWithResponseAsync(String
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_search_id: String (Optional)
      *     options (Optional): {
@@ -1000,7 +1115,7 @@ public Mono> internalSearchMemoriesWithResponseAsync(String
      *     memories (Required): [
      *          (Required){
      *             memory_item (Required): {
-     *                 kind: String(user_profile/chat_summary) (Required)
+     *                 kind: String(user_profile/chat_summary/procedural) (Required)
      *                 memory_id: String (Required)
      *                 updated_at: long (Required)
      *                 scope: String (Required)
@@ -1039,7 +1154,7 @@ public Response internalSearchMemoriesWithResponse(String name, Bina
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return service.internalSearchMemoriesSync(this.client.getEndpoint(), name, foundryFeatures,
+        return service.internalSearchMemoriesSync(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), contentType, accept, searchMemoriesRequest, requestOptions,
             Context.NONE);
     }
@@ -1053,9 +1168,7 @@ public Response internalSearchMemoriesWithResponse(String name, Bina
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -1076,7 +1189,7 @@ public Response internalSearchMemoriesWithResponse(String name, Bina
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1132,9 +1245,9 @@ private Mono> internalUpdateMemoriesWithResponseAsync(Strin
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.internalUpdateMemories(this.client.getEndpoint(), name,
-            foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, updateMemoriesRequest,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.internalUpdateMemories(this.client.getEndpoint(),
+            foundryFeatures, name, this.client.getServiceVersion().getVersion(), contentType, accept,
+            updateMemoriesRequest, requestOptions, context));
     }
 
     /**
@@ -1146,9 +1259,7 @@ private Mono> internalUpdateMemoriesWithResponseAsync(Strin
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -1169,7 +1280,7 @@ private Mono> internalUpdateMemoriesWithResponseAsync(Strin
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1224,7 +1335,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return service.internalUpdateMemoriesSync(this.client.getEndpoint(), name, foundryFeatures,
+        return service.internalUpdateMemoriesSync(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), contentType, accept, updateMemoriesRequest, requestOptions,
             Context.NONE);
     }
@@ -1238,9 +1349,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -1261,7 +1370,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1337,9 +1446,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -1360,7 +1467,7 @@ private Response internalUpdateMemoriesWithResponse(String name, Bin
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1435,9 +1542,7 @@ public SyncPoller b
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -1458,7 +1563,7 @@ public SyncPoller b
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1532,9 +1637,7 @@ public PollerFlux beginInternalUpdateMemoriesAsync(Strin
      * {
      *     scope: String (Required)
      *     items (Optional): [
-     *          (Optional){
-     *             type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required)
-     *         }
+     *         BinaryData (Optional)
      *     ]
      *     previous_update_id: String (Optional)
      *     update_delay: Integer (Optional)
@@ -1555,7 +1658,7 @@ public PollerFlux beginInternalUpdateMemoriesAsync(Strin
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1635,7 +1738,7 @@ public SyncPoller beginInternalUpdateMemories(String nam
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1689,8 +1792,8 @@ public Mono> getUpdateResultWithResponseAsync(String name,
         RequestOptions requestOptions) {
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.getUpdateResult(this.client.getEndpoint(), name, updateId,
-            foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
+        return FluxUtil.withContext(context -> service.getUpdateResult(this.client.getEndpoint(), foundryFeatures, name,
+            updateId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context));
     }
 
     /**
@@ -1708,7 +1811,7 @@ public Mono> getUpdateResultWithResponseAsync(String name,
      *              (Required){
      *                 kind: String(create/update/delete) (Required)
      *                 memory_item (Required): {
-     *                     kind: String(user_profile/chat_summary) (Required)
+     *                     kind: String(user_profile/chat_summary/procedural) (Required)
      *                     memory_id: String (Required)
      *                     updated_at: long (Required)
      *                     scope: String (Required)
@@ -1762,7 +1865,7 @@ public Response getUpdateResultWithResponse(String name, String upda
         RequestOptions requestOptions) {
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String accept = "application/json";
-        return service.getUpdateResultSync(this.client.getEndpoint(), name, updateId, foundryFeatures,
+        return service.getUpdateResultSync(this.client.getEndpoint(), foundryFeatures, name, updateId,
             this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE);
     }
 
@@ -1783,7 +1886,7 @@ public Response getUpdateResultWithResponse(String name, String upda
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     scope: String (Required)
      *     deleted: boolean (Required)
@@ -1807,9 +1910,9 @@ public Mono> internalDeleteScopeWithResponseAsync(String na
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return FluxUtil.withContext(context -> service.internalDeleteScope(this.client.getEndpoint(), name,
-            foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, deleteScopeRequest,
-            requestOptions, context));
+        return FluxUtil.withContext(context -> service.internalDeleteScope(this.client.getEndpoint(), foundryFeatures,
+            name, this.client.getServiceVersion().getVersion(), contentType, accept, deleteScopeRequest, requestOptions,
+            context));
     }
 
     /**
@@ -1829,7 +1932,7 @@ public Mono> internalDeleteScopeWithResponseAsync(String na
      * 
      * {@code
      * {
-     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted) (Required)
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
      *     name: String (Required)
      *     scope: String (Required)
      *     deleted: boolean (Required)
@@ -1852,11 +1955,603 @@ public Response internalDeleteScopeWithResponse(String name, BinaryD
         final String foundryFeatures = "MemoryStores=V1Preview";
         final String contentType = "application/json";
         final String accept = "application/json";
-        return service.internalDeleteScopeSync(this.client.getEndpoint(), name, foundryFeatures,
+        return service.internalDeleteScopeSync(this.client.getEndpoint(), foundryFeatures, name,
             this.client.getServiceVersion().getVersion(), contentType, accept, deleteScopeRequest, requestOptions,
             Context.NONE);
     }
 
+    /**
+     * Create a memory item in a memory store.
+     * 

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     *     content: String (Required)
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param createMemoryRequest The createMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createMemoryWithResponseAsync(String name, BinaryData createMemoryRequest, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createMemory(this.client.getEndpoint(), foundryFeatures, name, + this.client.getServiceVersion().getVersion(), contentType, accept, createMemoryRequest, requestOptions, + context)); + } + + /** + * Create a memory item in a memory store. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     *     content: String (Required)
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param createMemoryRequest The createMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createMemoryWithResponse(String name, BinaryData createMemoryRequest, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createMemorySync(this.client.getEndpoint(), foundryFeatures, name, + this.client.getServiceVersion().getVersion(), contentType, accept, createMemoryRequest, requestOptions, + Context.NONE); + } + + /** + * Update a memory item in a memory store. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to update. + * @param updateMemoryRequest The updateMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateMemoryWithResponseAsync(String name, String memoryId, + BinaryData updateMemoryRequest, RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateMemory(this.client.getEndpoint(), foundryFeatures, name, + memoryId, this.client.getServiceVersion().getVersion(), contentType, accept, updateMemoryRequest, + requestOptions, context)); + } + + /** + * Update a memory item in a memory store. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to update. + * @param updateMemoryRequest The updateMemoryRequest parameter. + * @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 a single memory item stored in the memory store, containing content and metadata along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateMemoryWithResponse(String name, String memoryId, BinaryData updateMemoryRequest, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateMemorySync(this.client.getEndpoint(), foundryFeatures, name, memoryId, + this.client.getServiceVersion().getVersion(), contentType, accept, updateMemoryRequest, requestOptions, + Context.NONE); + } + + /** + * Retrieve a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single memory item stored in the memory store, containing content and metadata along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMemoryWithResponseAsync(String name, String memoryId, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getMemory(this.client.getEndpoint(), foundryFeatures, name, + memoryId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Retrieve a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single memory item stored in the memory store, containing content and metadata along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMemoryWithResponse(String name, String memoryId, RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String accept = "application/json"; + return service.getMemorySync(this.client.getEndpoint(), foundryFeatures, name, memoryId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * List all memory items in a memory store. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoThe kind of the memory item. Allowed values: "user_profile", + * "chat_summary", "procedural".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param listMemoriesRequest The listMemoriesRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMemoriesSinglePageAsync(String name, BinaryData listMemoriesRequest, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMemories(this.client.getEndpoint(), foundryFeatures, name, + this.client.getServiceVersion().getVersion(), accept, listMemoriesRequest, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * List all memory items in a memory store. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoThe kind of the memory item. Allowed values: "user_profile", + * "chat_summary", "procedural".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param listMemoriesRequest The listMemoriesRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMemoriesAsync(String name, BinaryData listMemoriesRequest, + RequestOptions requestOptions) { + return new PagedFlux<>(() -> listMemoriesSinglePageAsync(name, listMemoriesRequest, requestOptions)); + } + + /** + * List all memory items in a memory store. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoThe kind of the memory item. Allowed values: "user_profile", + * "chat_summary", "procedural".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param listMemoriesRequest The listMemoriesRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listMemoriesSinglePage(String name, BinaryData listMemoriesRequest, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String accept = "application/json"; + Response res = service.listMemoriesSync(this.client.getEndpoint(), foundryFeatures, name, + this.client.getServiceVersion().getVersion(), accept, listMemoriesRequest, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * List all memory items in a memory store. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoThe kind of the memory item. Allowed values: "user_profile", + * "chat_summary", "procedural".
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     scope: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     kind: String(user_profile/chat_summary/procedural) (Required)
+     *     memory_id: String (Required)
+     *     updated_at: long (Required)
+     *     scope: String (Required)
+     *     content: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param listMemoriesRequest The listMemoriesRequest parameter. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMemories(String name, BinaryData listMemoriesRequest, + RequestOptions requestOptions) { + return new PagedIterable<>(() -> listMemoriesSinglePage(name, listMemoriesRequest, requestOptions)); + } + + /** + * Delete a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
+     *     memory_id: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @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 response for deleting a memory item from a memory store along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> internalDeleteMemoryWithResponseAsync(String name, String memoryId, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.internalDeleteMemory(this.client.getEndpoint(), foundryFeatures, + name, memoryId, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Delete a memory item from a memory store. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     object: String(memory_store/memory_store.deleted/memory_store.scope.deleted/memory_store.item.deleted) (Required)
+     *     memory_id: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the memory store. + * @param memoryId The ID of the memory item to delete. + * @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 response for deleting a memory item from a memory store along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response internalDeleteMemoryWithResponse(String name, String memoryId, + RequestOptions requestOptions) { + final String foundryFeatures = "MemoryStores=V1Preview"; + final String accept = "application/json"; + return service.internalDeleteMemorySync(this.client.getEndpoint(), foundryFeatures, name, memoryId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + private List getValues(BinaryData binaryData, String path) { try { Map obj = binaryData.toObject(Map.class); diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MultipartFormDataHelper.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MultipartFormDataHelper.java new file mode 100644 index 000000000000..5684c4aecd49 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MultipartFormDataHelper.java @@ -0,0 +1,209 @@ +// 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.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.UUID; + +// DO NOT modify this helper class + +public final class MultipartFormDataHelper { + /** + * Line separator for the multipart HTTP request. + */ + private static final String CRLF = "\r\n"; + + private static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + + /** + * Value to be used as part of the divider for the multipart requests. + */ + private final String boundary; + + /** + * The actual part separator in the request. This is obtained by prepending "--" to the "boundary". + */ + private final String partSeparator; + + /** + * The marker for the ending of a multipart request. This is obtained by post-pending "--" to the "partSeparator". + */ + private final String endMarker; + + /** + * Charset used for encoding the multipart HTTP request. + */ + private final Charset encoderCharset = StandardCharsets.UTF_8; + + private InputStream requestDataStream = new ByteArrayInputStream(new byte[0]); + private long requestLength = 0; + + private RequestOptions requestOptions; + private BinaryData requestBody; + + /** + * Default constructor used in the code. The boundary is a random value. + * + * @param requestOptions the RequestOptions to update + */ + public MultipartFormDataHelper(RequestOptions requestOptions) { + this(requestOptions, UUID.randomUUID().toString().substring(0, 16)); + } + + private MultipartFormDataHelper(RequestOptions requestOptions, String boundary) { + this.requestOptions = requestOptions; + this.boundary = boundary; + this.partSeparator = "--" + boundary; + this.endMarker = this.partSeparator + "--"; + } + + /** + * Gets the multipart HTTP request body. + * + * @return the BinaryData of the multipart HTTP request body + */ + public BinaryData getRequestBody() { + return requestBody; + } + + // text/plain + /** + * Formats a text/plain field for a multipart HTTP request. + * + * @param fieldName the field name + * @param value the value of the text/plain field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeTextField(String fieldName, String value) { + if (value != null) { + String serialized = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + + "\"" + CRLF + CRLF + value + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + // application/json + /** + * Formats a application/json field for a multipart HTTP request. + * + * @param fieldName the field name + * @param jsonObject the object of the application/json field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeJsonField(String fieldName, Object jsonObject) { + if (jsonObject != null) { + String serialized + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + CRLF + + "Content-Type: application/json" + CRLF + CRLF + BinaryData.fromObject(jsonObject) + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + /** + * Formats a file field for a multipart HTTP request. + * + * @param fieldName the field name + * @param file the BinaryData of the file + * @param contentType the content-type of the file + * @param filename the filename + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileField(String fieldName, BinaryData file, String contentType, + String filename) { + if (file != null) { + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + writeFileField(fieldName, file, contentType, filename); + } + return this; + } + + /** + * Formats a file field (potentially multiple files) for a multipart HTTP request. + * + * @param fieldName the field name + * @param files the List of BinaryData of the files + * @param contentTypes the List of content-type of the files + * @param filenames the List of filenames + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileFields(String fieldName, List files, + List contentTypes, List filenames) { + if (files != null) { + for (int i = 0; i < files.size(); ++i) { + BinaryData file = files.get(i); + String contentType = contentTypes.get(i); + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + String filename = filenames.get(i); + writeFileField(fieldName, file, contentType, filename); + } + } + return this; + } + + /** + * Ends the serialization of the multipart HTTP request. + * + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper end() { + byte[] data = endMarker.getBytes(encoderCharset); + appendBytes(data); + + requestBody = BinaryData.fromStream(requestDataStream, requestLength); + + requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "multipart/form-data; boundary=" + this.boundary) + .setHeader(HttpHeaderName.CONTENT_LENGTH, String.valueOf(requestLength)); + + return this; + } + + private void writeFileField(String fieldName, BinaryData file, String contentType, String filename) { + String contentDispositionFilename = ""; + if (!CoreUtils.isNullOrEmpty(filename)) { + contentDispositionFilename = "; filename=\"" + escapeName(filename) + "\""; + } + + // Multipart preamble + String fileFieldPreamble + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + + contentDispositionFilename + CRLF + "Content-Type: " + contentType + CRLF + CRLF; + byte[] data = fileFieldPreamble.getBytes(encoderCharset); + appendBytes(data); + + // Writing the file into the request as a byte stream + requestLength += file.getLength(); + requestDataStream = new SequenceInputStream(requestDataStream, file.toStream()); + + // CRLF + data = CRLF.getBytes(encoderCharset); + appendBytes(data); + } + + private void appendBytes(byte[] bytes) { + requestLength += bytes.length; + requestDataStream = new SequenceInputStream(requestDataStream, new ByteArrayInputStream(bytes)); + } + + private static String escapeName(String name) { + return name.replace("\n", "%0A").replace("\r", "%0D").replace("\"", "%22"); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OpenAIJsonHelper.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OpenAIJsonHelper.java index c7d15a77fcf2..53d1741f06fb 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OpenAIJsonHelper.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/OpenAIJsonHelper.java @@ -120,6 +120,21 @@ public static BinaryData toBinaryData(Object openAIObject) { } } + /** + * Converts a list of OpenAI SDK types to a list of BinaryData objects. + * + * @param The source OpenAI SDK type. + * @param openAIObjects The list of OpenAI SDK objects to convert. + * + * @return The equivalent list of BinaryData objects, or null if the input is null. + */ + public static List toBinaryDataList(List openAIObjects) { + if (openAIObjects == null) { + return null; + } + return openAIObjects.stream().map(obj -> toBinaryData(obj)).collect(Collectors.toList()); + } + /** * Deserializes {@link BinaryData} to an openai-java type using the openai-java ObjectMapper. * 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 e4645a7c1054..1a277fe21d91 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 @@ -80,51 +80,49 @@ public AgentsServiceVersion getServiceVersion() { @Host("{endpoint}") @ServiceInterface(name = "AgentsClientToolboxes") public interface ToolboxesService { - @Post("/toolboxes/{toolbox_name}/versions") + @Post("/toolboxes/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> createToolboxVersion(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createToolboxVersionRequest, RequestOptions requestOptions, Context context); - @Post("/toolboxes/{toolbox_name}/versions") + @Post("/toolboxes/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response createToolboxVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createToolboxVersionRequest, RequestOptions requestOptions, Context context); - @Get("/toolboxes/{toolbox_name}") + @Get("/toolboxes/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getToolbox(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> getToolbox(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/toolboxes/{toolbox_name}") + @Get("/toolboxes/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getToolboxSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response getToolboxSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/toolboxes") @ExpectedResponses({ 200 }) @@ -146,115 +144,114 @@ Response listToolboxesSync(@HostParam("endpoint") String endpoint, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/toolboxes/{toolbox_name}/versions") + @Get("/toolboxes/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> listToolboxVersions(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/toolboxes/{toolbox_name}/versions") + @Get("/toolboxes/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response listToolboxVersionsSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/toolboxes/{toolbox_name}/versions/{version}") + @Get("/toolboxes/{name}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> getToolboxVersion(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @PathParam("version") String version, + @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/toolboxes/{toolbox_name}/versions/{version}") + @Get("/toolboxes/{name}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Response getToolboxVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @PathParam("version") String version, + @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Patch("/toolboxes/{toolbox_name}") + @Patch("/toolboxes/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateToolbox(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateToolboxRequest, - RequestOptions requestOptions, Context context); + Mono> updateToolbox(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateToolboxRequest, RequestOptions requestOptions, + Context context); - @Patch("/toolboxes/{toolbox_name}") + @Patch("/toolboxes/{name}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateToolboxSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateToolboxRequest, - RequestOptions requestOptions, Context context); + Response updateToolboxSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData updateToolboxRequest, RequestOptions requestOptions, + Context context); - @Delete("/toolboxes/{toolbox_name}") + @Delete("/toolboxes/{name}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteToolbox(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + Mono> deleteToolbox(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); - @Delete("/toolboxes/{toolbox_name}") + @Delete("/toolboxes/{name}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteToolboxSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + Response deleteToolboxSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); - @Delete("/toolboxes/{toolbox_name}/versions/{version}") + @Delete("/toolboxes/{name}/versions/{version}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) Mono> deleteToolboxVersion(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @PathParam("version") String version, + @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); - @Delete("/toolboxes/{toolbox_name}/versions/{version}") + @Delete("/toolboxes/{name}/versions/{version}") @ExpectedResponses({ 204 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, - @PathParam("toolbox_name") String toolboxName, @PathParam("version") String version, - @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, - RequestOptions requestOptions, Context context); + Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @PathParam("version") String version, @HeaderParam("Foundry-Features") String foundryFeatures, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); } /** @@ -270,7 +267,12 @@ Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, * } * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -297,7 +299,12 @@ Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -309,7 +316,7 @@ Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, * } *
* - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param createToolboxVersionRequest The createToolboxVersionRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -319,12 +326,12 @@ Response deleteToolboxVersionSync(@HostParam("endpoint") String endpoint, * @return a specific version of a toolbox along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createToolboxVersionWithResponseAsync(String toolboxName, + public Mono> createToolboxVersionWithResponseAsync(String name, BinaryData createToolboxVersionRequest, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createToolboxVersion(this.client.getEndpoint(), toolboxName, + return FluxUtil.withContext(context -> service.createToolboxVersion(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, createToolboxVersionRequest, requestOptions, context)); } @@ -342,7 +349,12 @@ public Mono> createToolboxVersionWithResponseAsync(String t * } * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -369,7 +381,12 @@ public Mono> createToolboxVersionWithResponseAsync(String t * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -381,7 +398,7 @@ public Mono> createToolboxVersionWithResponseAsync(String t * } *
* - * @param toolboxName The name of the toolbox. If the toolbox does not exist, it will be created. + * @param name The name of the toolbox. If the toolbox does not exist, it will be created. * @param createToolboxVersionRequest The createToolboxVersionRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -391,12 +408,12 @@ public Mono> createToolboxVersionWithResponseAsync(String t * @return a specific version of a toolbox along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createToolboxVersionWithResponse(String toolboxName, - BinaryData createToolboxVersionRequest, RequestOptions requestOptions) { + public Response createToolboxVersionWithResponse(String name, BinaryData createToolboxVersionRequest, + RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; - return service.createToolboxVersionSync(this.client.getEndpoint(), toolboxName, foundryFeatures, + return service.createToolboxVersionSync(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, createToolboxVersionRequest, requestOptions, Context.NONE); } @@ -415,7 +432,7 @@ public Response createToolboxVersionWithResponse(String toolboxName, * } *
* - * @param toolboxName The name of the toolbox to retrieve. + * @param name The name of the toolbox to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -425,11 +442,11 @@ public Response createToolboxVersionWithResponse(String toolboxName, * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getToolboxWithResponseAsync(String toolboxName, RequestOptions requestOptions) { + public Mono> getToolboxWithResponseAsync(String name, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getToolbox(this.client.getEndpoint(), toolboxName, - foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getToolbox(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -446,7 +463,7 @@ public Mono> getToolboxWithResponseAsync(String toolboxName * } *
* - * @param toolboxName The name of the toolbox to retrieve. + * @param name The name of the toolbox to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. @@ -455,10 +472,10 @@ public Mono> getToolboxWithResponseAsync(String toolboxName * @return a toolbox that stores reusable tool definitions for agents along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getToolboxWithResponse(String toolboxName, RequestOptions requestOptions) { + public Response getToolboxWithResponse(String name, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String accept = "application/json"; - return service.getToolboxSync(this.client.getEndpoint(), toolboxName, foundryFeatures, + return service.getToolboxSync(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } @@ -695,7 +712,12 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -707,7 +729,7 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * } *
* - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -717,12 +739,12 @@ public PagedIterable listToolboxes(RequestOptions requestOptions) { * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listToolboxVersionsSinglePageAsync(String toolboxName, + private Mono> listToolboxVersionsSinglePageAsync(String name, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listToolboxVersions(this.client.getEndpoint(), toolboxName, foundryFeatures, + .withContext(context -> service.listToolboxVersions(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "data"), null, null)); @@ -765,7 +787,12 @@ private Mono> listToolboxVersionsSinglePageAsync(Strin * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -777,7 +804,7 @@ private Mono> listToolboxVersionsSinglePageAsync(Strin * } *
* - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -786,8 +813,8 @@ private Mono> listToolboxVersionsSinglePageAsync(Strin * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listToolboxVersionsAsync(String toolboxName, RequestOptions requestOptions) { - return new PagedFlux<>(() -> listToolboxVersionsSinglePageAsync(toolboxName, requestOptions)); + public PagedFlux listToolboxVersionsAsync(String name, RequestOptions requestOptions) { + return new PagedFlux<>(() -> listToolboxVersionsSinglePageAsync(name, requestOptions)); } /** @@ -827,7 +854,12 @@ public PagedFlux listToolboxVersionsAsync(String toolboxName, Reques * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -839,7 +871,7 @@ public PagedFlux listToolboxVersionsAsync(String toolboxName, Reques * } *
* - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -848,11 +880,11 @@ public PagedFlux listToolboxVersionsAsync(String toolboxName, Reques * @return the response data for a requested list of items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listToolboxVersionsSinglePage(String toolboxName, RequestOptions requestOptions) { + private PagedResponse listToolboxVersionsSinglePage(String name, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String accept = "application/json"; - Response res = service.listToolboxVersionsSync(this.client.getEndpoint(), toolboxName, - foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + Response res = service.listToolboxVersionsSync(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "data"), null, null); } @@ -894,7 +926,12 @@ private PagedResponse listToolboxVersionsSinglePage(String toolboxNa * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -906,7 +943,7 @@ private PagedResponse listToolboxVersionsSinglePage(String toolboxNa * } *
* - * @param toolboxName The name of the toolbox to list versions for. + * @param name The name of the toolbox to list versions for. * @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. @@ -915,8 +952,8 @@ private PagedResponse listToolboxVersionsSinglePage(String toolboxNa * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listToolboxVersions(String toolboxName, RequestOptions requestOptions) { - return new PagedIterable<>(() -> listToolboxVersionsSinglePage(toolboxName, requestOptions)); + public PagedIterable listToolboxVersions(String name, RequestOptions requestOptions) { + return new PagedIterable<>(() -> listToolboxVersionsSinglePage(name, requestOptions)); } /** @@ -936,7 +973,12 @@ public PagedIterable listToolboxVersions(String toolboxName, Request * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -948,7 +990,7 @@ public PagedIterable listToolboxVersions(String toolboxName, Request * } *
* - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -958,12 +1000,12 @@ public PagedIterable listToolboxVersions(String toolboxName, Request * @return a specific version of a toolbox along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getToolboxVersionWithResponseAsync(String toolboxName, String version, + public Mono> getToolboxVersionWithResponseAsync(String name, String version, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getToolboxVersion(this.client.getEndpoint(), toolboxName, - version, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.getToolboxVersion(this.client.getEndpoint(), name, version, + foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** @@ -983,7 +1025,12 @@ public Mono> getToolboxVersionWithResponseAsync(String tool * created_at: long (Required) * tools (Required): [ * (Required){ - * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * type: String(function/file_search/computer_use_preview/web_search/mcp/code_interpreter/image_generation/local_shell/shell/custom/web_search_preview/apply_patch/a2a_preview/bing_custom_search_preview/browser_automation_preview/fabric_dataagent_preview/sharepoint_grounding_preview/memory_search_preview/work_iq_preview/fabric_iq_preview/toolbox_search_preview/azure_ai_search/azure_function/bing_grounding/capture_structured_outputs/openapi) (Required) + * } + * ] + * skills (Optional): [ + * (Optional){ + * type: String (Required) * } * ] * policies (Optional): { @@ -995,7 +1042,7 @@ public Mono> getToolboxVersionWithResponseAsync(String tool * } *
* - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1005,11 +1052,11 @@ public Mono> getToolboxVersionWithResponseAsync(String tool * @return a specific version of a toolbox along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getToolboxVersionWithResponse(String toolboxName, String version, + public Response getToolboxVersionWithResponse(String name, String version, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String accept = "application/json"; - return service.getToolboxVersionSync(this.client.getEndpoint(), toolboxName, version, foundryFeatures, + return service.getToolboxVersionSync(this.client.getEndpoint(), name, version, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } @@ -1037,7 +1084,7 @@ public Response getToolboxVersionWithResponse(String toolboxName, St * } *
* - * @param toolboxName The name of the toolbox to update. + * @param name The name of the toolbox to update. * @param updateToolboxRequest The updateToolboxRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1048,14 +1095,14 @@ public Response getToolboxVersionWithResponse(String toolboxName, St * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateToolboxWithResponseAsync(String toolboxName, - BinaryData updateToolboxRequest, RequestOptions requestOptions) { + public Mono> updateToolboxWithResponseAsync(String name, BinaryData updateToolboxRequest, + RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateToolbox(this.client.getEndpoint(), toolboxName, - foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, updateToolboxRequest, - requestOptions, context)); + return FluxUtil.withContext(context -> service.updateToolbox(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), contentType, accept, updateToolboxRequest, requestOptions, + context)); } /** @@ -1082,7 +1129,7 @@ public Mono> updateToolboxWithResponseAsync(String toolboxN * } *
* - * @param toolboxName The name of the toolbox to update. + * @param name The name of the toolbox to update. * @param updateToolboxRequest The updateToolboxRequest parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1092,12 +1139,12 @@ public Mono> updateToolboxWithResponseAsync(String toolboxN * @return a toolbox that stores reusable tool definitions for agents along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateToolboxWithResponse(String toolboxName, BinaryData updateToolboxRequest, + public Response updateToolboxWithResponse(String name, BinaryData updateToolboxRequest, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; - return service.updateToolboxSync(this.client.getEndpoint(), toolboxName, foundryFeatures, + return service.updateToolboxSync(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, updateToolboxRequest, requestOptions, Context.NONE); } @@ -1105,7 +1152,7 @@ public Response updateToolboxWithResponse(String toolboxName, Binary /** * Delete a toolbox and all its versions. * - * @param toolboxName The name of the toolbox to delete. + * @param name The name of the toolbox to delete. * @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. @@ -1114,16 +1161,16 @@ public Response updateToolboxWithResponse(String toolboxName, Binary * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteToolboxWithResponseAsync(String toolboxName, RequestOptions requestOptions) { + public Mono> deleteToolboxWithResponseAsync(String name, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; - return FluxUtil.withContext(context -> service.deleteToolbox(this.client.getEndpoint(), toolboxName, - foundryFeatures, this.client.getServiceVersion().getVersion(), requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteToolbox(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), requestOptions, context)); } /** * Delete a toolbox and all its versions. * - * @param toolboxName The name of the toolbox to delete. + * @param name The name of the toolbox to delete. * @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. @@ -1132,16 +1179,16 @@ public Mono> deleteToolboxWithResponseAsync(String toolboxName, R * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteToolboxWithResponse(String toolboxName, RequestOptions requestOptions) { + public Response deleteToolboxWithResponse(String name, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; - return service.deleteToolboxSync(this.client.getEndpoint(), toolboxName, foundryFeatures, + return service.deleteToolboxSync(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); } /** * Delete a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1151,17 +1198,17 @@ public Response deleteToolboxWithResponse(String toolboxName, RequestOptio * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteToolboxVersionWithResponseAsync(String toolboxName, String version, + public Mono> deleteToolboxVersionWithResponseAsync(String name, String version, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; - return FluxUtil.withContext(context -> service.deleteToolboxVersion(this.client.getEndpoint(), toolboxName, - version, foundryFeatures, this.client.getServiceVersion().getVersion(), requestOptions, context)); + return FluxUtil.withContext(context -> service.deleteToolboxVersion(this.client.getEndpoint(), name, version, + foundryFeatures, this.client.getServiceVersion().getVersion(), requestOptions, context)); } /** * Delete a specific version of a toolbox. * - * @param toolboxName The name of the toolbox. + * @param name The name of the toolbox. * @param version The version identifier to delete. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. @@ -1171,10 +1218,9 @@ public Mono> deleteToolboxVersionWithResponseAsync(String toolbox * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteToolboxVersionWithResponse(String toolboxName, String version, - RequestOptions requestOptions) { + public Response deleteToolboxVersionWithResponse(String name, String version, RequestOptions requestOptions) { final String foundryFeatures = "Toolboxes=V1Preview"; - return service.deleteToolboxVersionSync(this.client.getEndpoint(), toolboxName, version, foundryFeatures, + return service.deleteToolboxVersionSync(this.client.getEndpoint(), name, version, foundryFeatures, this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/AnnotationType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/AnnotationType.java deleted file mode 100644 index 5503b79866c8..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/AnnotationType.java +++ /dev/null @@ -1,69 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for AnnotationType. - */ -public final class AnnotationType extends ExpandableStringEnum { - - /** - * Static value file_citation for AnnotationType. - */ - @Generated - public static final AnnotationType FILE_CITATION = fromString("file_citation"); - - /** - * Static value url_citation for AnnotationType. - */ - @Generated - public static final AnnotationType URL_CITATION = fromString("url_citation"); - - /** - * Static value container_file_citation for AnnotationType. - */ - @Generated - public static final AnnotationType CONTAINER_FILE_CITATION = fromString("container_file_citation"); - - /** - * Static value file_path for AnnotationType. - */ - @Generated - public static final AnnotationType FILE_PATH = fromString("file_path"); - - /** - * Creates a new instance of AnnotationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public AnnotationType() { - } - - /** - * Creates or finds a AnnotationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding AnnotationType. - */ - @Generated - public static AnnotationType fromString(String name) { - return fromString(name, AnnotationType.class); - } - - /** - * Gets known AnnotationType values. - * - * @return known AnnotationType values. - */ - @Generated - public static Collection values() { - return values(AnnotationType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallOutputStatusParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallOutputStatusParam.java deleted file mode 100644 index affc92d91a22..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallOutputStatusParam.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.implementation.models; - -/** - * Apply patch call output status - * - * Outcome values reported for apply_patch tool call outputs. - */ -public enum ApplyPatchCallOutputStatusParam { - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value failed. - */ - FAILED("failed"); - - /** - * The actual serialized value for a ApplyPatchCallOutputStatusParam instance. - */ - private final String value; - - ApplyPatchCallOutputStatusParam(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ApplyPatchCallOutputStatusParam instance. - * - * @param value the serialized value to parse. - * @return the parsed ApplyPatchCallOutputStatusParam object, or null if unable to parse. - */ - public static ApplyPatchCallOutputStatusParam fromString(String value) { - if (value == null) { - return null; - } - ApplyPatchCallOutputStatusParam[] items = ApplyPatchCallOutputStatusParam.values(); - for (ApplyPatchCallOutputStatusParam 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/implementation/models/ApplyPatchCallStatusParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallStatusParam.java deleted file mode 100644 index dab2af8712d3..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallStatusParam.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.implementation.models; - -/** - * Apply patch call status - * - * Status values reported for apply_patch tool calls. - */ -public enum ApplyPatchCallStatusParam { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"); - - /** - * The actual serialized value for a ApplyPatchCallStatusParam instance. - */ - private final String value; - - ApplyPatchCallStatusParam(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ApplyPatchCallStatusParam instance. - * - * @param value the serialized value to parse. - * @return the parsed ApplyPatchCallStatusParam object, or null if unable to parse. - */ - public static ApplyPatchCallStatusParam fromString(String value) { - if (value == null) { - return null; - } - ApplyPatchCallStatusParam[] items = ApplyPatchCallStatusParam.values(); - for (ApplyPatchCallStatusParam 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/implementation/models/ApplyPatchCreateFileOperationParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCreateFileOperationParam.java deleted file mode 100644 index e9cab9f61082..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCreateFileOperationParam.java +++ /dev/null @@ -1,129 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Apply patch create file operation - * - * Instruction for creating a new file via the apply_patch tool. - */ -@Immutable -public final class ApplyPatchCreateFileOperationParam extends ApplyPatchOperationParam { - - /* - * The type property. - */ - @Generated - private ApplyPatchOperationParamType type = ApplyPatchOperationParamType.CREATE_FILE; - - /* - * Path of the file to create relative to the workspace root. - */ - @Generated - private final String path; - - /* - * Unified diff content to apply when creating the file. - */ - @Generated - private final String diff; - - /** - * Creates an instance of ApplyPatchCreateFileOperationParam class. - * - * @param path the path value to set. - * @param diff the diff value to set. - */ - @Generated - public ApplyPatchCreateFileOperationParam(String path, String diff) { - this.path = path; - this.diff = diff; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ApplyPatchOperationParamType getType() { - return this.type; - } - - /** - * Get the path property: Path of the file to create relative to the workspace root. - * - * @return the path value. - */ - @Generated - public String getPath() { - return this.path; - } - - /** - * Get the diff property: Unified diff content to apply when creating the file. - * - * @return the diff value. - */ - @Generated - public String getDiff() { - return this.diff; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("path", this.path); - jsonWriter.writeStringField("diff", this.diff); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplyPatchCreateFileOperationParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplyPatchCreateFileOperationParam if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ApplyPatchCreateFileOperationParam. - */ - @Generated - public static ApplyPatchCreateFileOperationParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String path = null; - String diff = null; - ApplyPatchOperationParamType type = ApplyPatchOperationParamType.CREATE_FILE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("path".equals(fieldName)) { - path = reader.getString(); - } else if ("diff".equals(fieldName)) { - diff = reader.getString(); - } else if ("type".equals(fieldName)) { - type = ApplyPatchOperationParamType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ApplyPatchCreateFileOperationParam deserializedApplyPatchCreateFileOperationParam - = new ApplyPatchCreateFileOperationParam(path, diff); - deserializedApplyPatchCreateFileOperationParam.type = type; - return deserializedApplyPatchCreateFileOperationParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParamType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParamType.java deleted file mode 100644 index 38ffff4a51e5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParamType.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ApplyPatchOperationParamType. - */ -public final class ApplyPatchOperationParamType extends ExpandableStringEnum { - - /** - * Static value create_file for ApplyPatchOperationParamType. - */ - @Generated - public static final ApplyPatchOperationParamType CREATE_FILE = fromString("create_file"); - - /** - * Static value delete_file for ApplyPatchOperationParamType. - */ - @Generated - public static final ApplyPatchOperationParamType DELETE_FILE = fromString("delete_file"); - - /** - * Static value update_file for ApplyPatchOperationParamType. - */ - @Generated - public static final ApplyPatchOperationParamType UPDATE_FILE = fromString("update_file"); - - /** - * Creates a new instance of ApplyPatchOperationParamType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ApplyPatchOperationParamType() { - } - - /** - * Creates or finds a ApplyPatchOperationParamType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ApplyPatchOperationParamType. - */ - @Generated - public static ApplyPatchOperationParamType fromString(String name) { - return fromString(name, ApplyPatchOperationParamType.class); - } - - /** - * Gets known ApplyPatchOperationParamType values. - * - * @return known ApplyPatchOperationParamType values. - */ - @Generated - public static Collection values() { - return values(ApplyPatchOperationParamType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchUpdateFileOperationParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchUpdateFileOperationParam.java deleted file mode 100644 index 9e09e0f6d0e2..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchUpdateFileOperationParam.java +++ /dev/null @@ -1,129 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Apply patch update file operation - * - * Instruction for updating an existing file via the apply_patch tool. - */ -@Immutable -public final class ApplyPatchUpdateFileOperationParam extends ApplyPatchOperationParam { - - /* - * The type property. - */ - @Generated - private ApplyPatchOperationParamType type = ApplyPatchOperationParamType.UPDATE_FILE; - - /* - * Path of the file to update relative to the workspace root. - */ - @Generated - private final String path; - - /* - * Unified diff content to apply to the existing file. - */ - @Generated - private final String diff; - - /** - * Creates an instance of ApplyPatchUpdateFileOperationParam class. - * - * @param path the path value to set. - * @param diff the diff value to set. - */ - @Generated - public ApplyPatchUpdateFileOperationParam(String path, String diff) { - this.path = path; - this.diff = diff; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ApplyPatchOperationParamType getType() { - return this.type; - } - - /** - * Get the path property: Path of the file to update relative to the workspace root. - * - * @return the path value. - */ - @Generated - public String getPath() { - return this.path; - } - - /** - * Get the diff property: Unified diff content to apply to the existing file. - * - * @return the diff value. - */ - @Generated - public String getDiff() { - return this.diff; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("path", this.path); - jsonWriter.writeStringField("diff", this.diff); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ApplyPatchUpdateFileOperationParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ApplyPatchUpdateFileOperationParam if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ApplyPatchUpdateFileOperationParam. - */ - @Generated - public static ApplyPatchUpdateFileOperationParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String path = null; - String diff = null; - ApplyPatchOperationParamType type = ApplyPatchOperationParamType.UPDATE_FILE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("path".equals(fieldName)) { - path = reader.getString(); - } else if ("diff".equals(fieldName)) { - diff = reader.getString(); - } else if ("type".equals(fieldName)) { - type = ApplyPatchOperationParamType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ApplyPatchUpdateFileOperationParam deserializedApplyPatchUpdateFileOperationParam - = new ApplyPatchUpdateFileOperationParam(path, diff); - deserializedApplyPatchUpdateFileOperationParam.type = type; - return deserializedApplyPatchUpdateFileOperationParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ClickButtonType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ClickButtonType.java deleted file mode 100644 index c72b2b73a325..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ClickButtonType.java +++ /dev/null @@ -1,71 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for ClickButtonType. - */ -public enum ClickButtonType { - /** - * Enum value left. - */ - LEFT("left"), - - /** - * Enum value right. - */ - RIGHT("right"), - - /** - * Enum value wheel. - */ - WHEEL("wheel"), - - /** - * Enum value back. - */ - BACK("back"), - - /** - * Enum value forward. - */ - FORWARD("forward"); - - /** - * The actual serialized value for a ClickButtonType instance. - */ - private final String value; - - ClickButtonType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ClickButtonType instance. - * - * @param value the serialized value to parse. - * @return the parsed ClickButtonType object, or null if unable to parse. - */ - public static ClickButtonType fromString(String value) { - if (value == null) { - return null; - } - ClickButtonType[] items = ClickButtonType.values(); - for (ClickButtonType 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/implementation/models/ClickParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ClickParam.java deleted file mode 100644 index de460d563d14..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ClickParam.java +++ /dev/null @@ -1,151 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Click - * - * A click action. - */ -@Immutable -public final class ClickParam extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.CLICK; - - /* - * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - */ - @Generated - private final ClickButtonType button; - - /* - * The x-coordinate where the click occurred. - */ - @Generated - private final long x; - - /* - * The y-coordinate where the click occurred. - */ - @Generated - private final long y; - - /** - * Creates an instance of ClickParam class. - * - * @param button the button value to set. - * @param x the x value to set. - * @param y the y value to set. - */ - @Generated - public ClickParam(ClickButtonType button, long x, long y) { - this.button = button; - this.x = x; - this.y = y; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the button property: Indicates which mouse button was pressed during the click. One of `left`, `right`, - * `wheel`, `back`, or `forward`. - * - * @return the button value. - */ - @Generated - public ClickButtonType getButton() { - return this.button; - } - - /** - * Get the x property: The x-coordinate where the click occurred. - * - * @return the x value. - */ - @Generated - public long getX() { - return this.x; - } - - /** - * Get the y property: The y-coordinate where the click occurred. - * - * @return the y value. - */ - @Generated - public long getY() { - return this.y; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("button", this.button == null ? null : this.button.toString()); - jsonWriter.writeLongField("x", this.x); - jsonWriter.writeLongField("y", this.y); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ClickParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ClickParam if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ClickParam. - */ - @Generated - public static ClickParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ClickButtonType button = null; - long x = 0L; - long y = 0L; - ComputerActionType type = ComputerActionType.CLICK; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("button".equals(fieldName)) { - button = ClickButtonType.fromString(reader.getString()); - } else if ("x".equals(fieldName)) { - x = reader.getLong(); - } else if ("y".equals(fieldName)) { - y = reader.getLong(); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ClickParam deserializedClickParam = new ClickParam(button, x, y); - deserializedClickParam.type = type; - return deserializedClickParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputLogs.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputLogs.java deleted file mode 100644 index c127bc66e1db..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputLogs.java +++ /dev/null @@ -1,101 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Code interpreter output logs - * - * The logs output from the code interpreter. - */ -@Immutable -public final class CodeInterpreterOutputLogs implements JsonSerializable { - - /* - * The type of the output. Always `logs`. - */ - @Generated - private final String type = "logs"; - - /* - * The logs output from the code interpreter. - */ - @Generated - private final String logs; - - /** - * Creates an instance of CodeInterpreterOutputLogs class. - * - * @param logs the logs value to set. - */ - @Generated - public CodeInterpreterOutputLogs(String logs) { - this.logs = logs; - } - - /** - * Get the type property: The type of the output. Always `logs`. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the logs property: The logs output from the code interpreter. - * - * @return the logs value. - */ - @Generated - public String getLogs() { - return this.logs; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("logs", this.logs); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CodeInterpreterOutputLogs from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CodeInterpreterOutputLogs if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CodeInterpreterOutputLogs. - */ - @Generated - public static CodeInterpreterOutputLogs fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String logs = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("logs".equals(fieldName)) { - logs = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new CodeInterpreterOutputLogs(logs); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerAction.java deleted file mode 100644 index 46cc36efc0ea..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerAction.java +++ /dev/null @@ -1,121 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The ComputerAction model. - */ -@Immutable -public class ComputerAction implements JsonSerializable { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.fromString("ComputerAction"); - - /** - * Creates an instance of ComputerAction class. - */ - @Generated - public ComputerAction() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - public ComputerActionType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputerAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputerAction 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 ComputerAction. - */ - @Generated - public static ComputerAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - // Prepare for reading - readerToUse.nextToken(); - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("click".equals(discriminatorValue)) { - return ClickParam.fromJson(readerToUse.reset()); - } else if ("double_click".equals(discriminatorValue)) { - return DoubleClickAction.fromJson(readerToUse.reset()); - } else if ("drag".equals(discriminatorValue)) { - return DragParam.fromJson(readerToUse.reset()); - } else if ("keypress".equals(discriminatorValue)) { - return KeyPressAction.fromJson(readerToUse.reset()); - } else if ("move".equals(discriminatorValue)) { - return MoveParam.fromJson(readerToUse.reset()); - } else if ("screenshot".equals(discriminatorValue)) { - return ScreenshotParam.fromJson(readerToUse.reset()); - } else if ("scroll".equals(discriminatorValue)) { - return ScrollParam.fromJson(readerToUse.reset()); - } else if ("type".equals(discriminatorValue)) { - return TypeParam.fromJson(readerToUse.reset()); - } else if ("wait".equals(discriminatorValue)) { - return WaitParam.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static ComputerAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputerAction deserializedComputerAction = new ComputerAction(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedComputerAction.type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedComputerAction; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerActionType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerActionType.java deleted file mode 100644 index 8cea82c2e860..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerActionType.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ComputerActionType. - */ -public final class ComputerActionType extends ExpandableStringEnum { - - /** - * Static value click for ComputerActionType. - */ - @Generated - public static final ComputerActionType CLICK = fromString("click"); - - /** - * Static value double_click for ComputerActionType. - */ - @Generated - public static final ComputerActionType DOUBLE_CLICK = fromString("double_click"); - - /** - * Static value drag for ComputerActionType. - */ - @Generated - public static final ComputerActionType DRAG = fromString("drag"); - - /** - * Static value keypress for ComputerActionType. - */ - @Generated - public static final ComputerActionType KEYPRESS = fromString("keypress"); - - /** - * Static value move for ComputerActionType. - */ - @Generated - public static final ComputerActionType MOVE = fromString("move"); - - /** - * Static value screenshot for ComputerActionType. - */ - @Generated - public static final ComputerActionType SCREENSHOT = fromString("screenshot"); - - /** - * Static value scroll for ComputerActionType. - */ - @Generated - public static final ComputerActionType SCROLL = fromString("scroll"); - - /** - * Static value type for ComputerActionType. - */ - @Generated - public static final ComputerActionType TYPE = fromString("type"); - - /** - * Static value wait for ComputerActionType. - */ - @Generated - public static final ComputerActionType WAIT = fromString("wait"); - - /** - * Creates a new instance of ComputerActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ComputerActionType() { - } - - /** - * Creates or finds a ComputerActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ComputerActionType. - */ - @Generated - public static ComputerActionType fromString(String name) { - return fromString(name, ComputerActionType.class); - } - - /** - * Gets known ComputerActionType values. - * - * @return known ComputerActionType values. - */ - @Generated - public static Collection values() { - return values(ComputerActionType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerCallSafetyCheckParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerCallSafetyCheckParam.java deleted file mode 100644 index 32becec28f3a..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerCallSafetyCheckParam.java +++ /dev/null @@ -1,150 +0,0 @@ -// 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.implementation.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; - -/** - * A pending safety check for the computer call. - */ -@Fluent -public final class ComputerCallSafetyCheckParam implements JsonSerializable { - - /* - * The ID of the pending safety check. - */ - @Generated - private final String id; - - /* - * The code property. - */ - @Generated - private String code; - - /* - * The message property. - */ - @Generated - private String message; - - /** - * Creates an instance of ComputerCallSafetyCheckParam class. - * - * @param id the id value to set. - */ - @Generated - public ComputerCallSafetyCheckParam(String id) { - this.id = id; - } - - /** - * Get the id property: The ID of the pending safety check. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the code property: The code property. - * - * @return the code value. - */ - @Generated - public String getCode() { - return this.code; - } - - /** - * Set the code property: The code property. - * - * @param code the code value to set. - * @return the ComputerCallSafetyCheckParam object itself. - */ - @Generated - public ComputerCallSafetyCheckParam setCode(String code) { - this.code = code; - return this; - } - - /** - * Get the message property: The message property. - * - * @return the message value. - */ - @Generated - public String getMessage() { - return this.message; - } - - /** - * Set the message property: The message property. - * - * @param message the message value to set. - * @return the ComputerCallSafetyCheckParam object itself. - */ - @Generated - public ComputerCallSafetyCheckParam setMessage(String message) { - this.message = message; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeStringField("message", this.message); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputerCallSafetyCheckParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputerCallSafetyCheckParam if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ComputerCallSafetyCheckParam. - */ - @Generated - public static ComputerCallSafetyCheckParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String code = null; - String message = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("code".equals(fieldName)) { - code = reader.getString(); - } else if ("message".equals(fieldName)) { - message = reader.getString(); - } else { - reader.skipChildren(); - } - } - ComputerCallSafetyCheckParam deserializedComputerCallSafetyCheckParam - = new ComputerCallSafetyCheckParam(id); - deserializedComputerCallSafetyCheckParam.code = code; - deserializedComputerCallSafetyCheckParam.message = message; - return deserializedComputerCallSafetyCheckParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerScreenshotImage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerScreenshotImage.java deleted file mode 100644 index 295b9f12fff8..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ComputerScreenshotImage.java +++ /dev/null @@ -1,141 +0,0 @@ -// 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.implementation.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; - -/** - * A computer screenshot image used with the computer use tool. - */ -@Fluent -public final class ComputerScreenshotImage implements JsonSerializable { - - /* - * Specifies the event type. For a computer screenshot, this property is - * always set to `computer_screenshot`. - */ - @Generated - private final String type = "computer_screenshot"; - - /* - * The URL of the screenshot image. - */ - @Generated - private String imageUrl; - - /* - * The identifier of an uploaded file that contains the screenshot. - */ - @Generated - private String fileId; - - /** - * Creates an instance of ComputerScreenshotImage class. - */ - @Generated - public ComputerScreenshotImage() { - } - - /** - * Get the type property: Specifies the event type. For a computer screenshot, this property is - * always set to `computer_screenshot`. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the imageUrl property: The URL of the screenshot image. - * - * @return the imageUrl value. - */ - @Generated - public String getImageUrl() { - return this.imageUrl; - } - - /** - * Set the imageUrl property: The URL of the screenshot image. - * - * @param imageUrl the imageUrl value to set. - * @return the ComputerScreenshotImage object itself. - */ - @Generated - public ComputerScreenshotImage setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get the fileId property: The identifier of an uploaded file that contains the screenshot. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The identifier of an uploaded file that contains the screenshot. - * - * @param fileId the fileId value to set. - * @return the ComputerScreenshotImage object itself. - */ - @Generated - public ComputerScreenshotImage setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("image_url", this.imageUrl); - jsonWriter.writeStringField("file_id", this.fileId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputerScreenshotImage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputerScreenshotImage if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ComputerScreenshotImage. - */ - @Generated - public static ComputerScreenshotImage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ComputerScreenshotImage deserializedComputerScreenshotImage = new ComputerScreenshotImage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("image_url".equals(fieldName)) { - deserializedComputerScreenshotImage.imageUrl = reader.getString(); - } else if ("file_id".equals(fieldName)) { - deserializedComputerScreenshotImage.fileId = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedComputerScreenshotImage; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ContainerFileCitationBody.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ContainerFileCitationBody.java deleted file mode 100644 index 2d226de88ba3..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ContainerFileCitationBody.java +++ /dev/null @@ -1,196 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Container file citation - * - * A citation for a container file used to generate a model response. - */ -@Immutable -public final class ContainerFileCitationBody extends Annotation { - - /* - * The type property. - */ - @Generated - private AnnotationType type = AnnotationType.CONTAINER_FILE_CITATION; - - /* - * The ID of the container file. - */ - @Generated - private final String containerId; - - /* - * The ID of the file. - */ - @Generated - private final String fileId; - - /* - * The index of the first character of the container file citation in the message. - */ - @Generated - private final long startIndex; - - /* - * The index of the last character of the container file citation in the message. - */ - @Generated - private final long endIndex; - - /* - * The filename of the container file cited. - */ - @Generated - private final String filename; - - /** - * Creates an instance of ContainerFileCitationBody class. - * - * @param containerId the containerId value to set. - * @param fileId the fileId value to set. - * @param startIndex the startIndex value to set. - * @param endIndex the endIndex value to set. - * @param filename the filename value to set. - */ - @Generated - public ContainerFileCitationBody(String containerId, String fileId, long startIndex, long endIndex, - String filename) { - this.containerId = containerId; - this.fileId = fileId; - this.startIndex = startIndex; - this.endIndex = endIndex; - this.filename = filename; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public AnnotationType getType() { - return this.type; - } - - /** - * Get the containerId property: The ID of the container file. - * - * @return the containerId value. - */ - @Generated - public String getContainerId() { - return this.containerId; - } - - /** - * Get the fileId property: The ID of the file. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Get the startIndex property: The index of the first character of the container file citation in the message. - * - * @return the startIndex value. - */ - @Generated - public long getStartIndex() { - return this.startIndex; - } - - /** - * Get the endIndex property: The index of the last character of the container file citation in the message. - * - * @return the endIndex value. - */ - @Generated - public long getEndIndex() { - return this.endIndex; - } - - /** - * Get the filename property: The filename of the container file cited. - * - * @return the filename value. - */ - @Generated - public String getFilename() { - return this.filename; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("container_id", this.containerId); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeLongField("start_index", this.startIndex); - jsonWriter.writeLongField("end_index", this.endIndex); - jsonWriter.writeStringField("filename", this.filename); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ContainerFileCitationBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ContainerFileCitationBody if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ContainerFileCitationBody. - */ - @Generated - public static ContainerFileCitationBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String containerId = null; - String fileId = null; - long startIndex = 0L; - long endIndex = 0L; - String filename = null; - AnnotationType type = AnnotationType.CONTAINER_FILE_CITATION; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("container_id".equals(fieldName)) { - containerId = reader.getString(); - } else if ("file_id".equals(fieldName)) { - fileId = reader.getString(); - } else if ("start_index".equals(fieldName)) { - startIndex = reader.getLong(); - } else if ("end_index".equals(fieldName)) { - endIndex = reader.getLong(); - } else if ("filename".equals(fieldName)) { - filename = reader.getString(); - } else if ("type".equals(fieldName)) { - type = AnnotationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ContainerFileCitationBody deserializedContainerFileCitationBody - = new ContainerFileCitationBody(containerId, fileId, startIndex, endIndex, filename); - deserializedContainerFileCitationBody.type = type; - return deserializedContainerFileCitationBody; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CoordParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CoordParam.java deleted file mode 100644 index 3b2a18265a40..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CoordParam.java +++ /dev/null @@ -1,106 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Coordinate - * - * An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`. - */ -@Immutable -public final class CoordParam implements JsonSerializable { - - /* - * The x-coordinate. - */ - @Generated - private final long x; - - /* - * The y-coordinate. - */ - @Generated - private final long y; - - /** - * Creates an instance of CoordParam class. - * - * @param x the x value to set. - * @param y the y value to set. - */ - @Generated - public CoordParam(long x, long y) { - this.x = x; - this.y = y; - } - - /** - * Get the x property: The x-coordinate. - * - * @return the x value. - */ - @Generated - public long getX() { - return this.x; - } - - /** - * Get the y property: The y-coordinate. - * - * @return the y value. - */ - @Generated - public long getY() { - return this.y; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("x", this.x); - jsonWriter.writeLongField("y", this.y); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CoordParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CoordParam if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CoordParam. - */ - @Generated - public static CoordParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long x = 0L; - long y = 0L; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("x".equals(fieldName)) { - x = reader.getLong(); - } else if ("y".equals(fieldName)) { - y = reader.getLong(); - } else { - reader.skipChildren(); - } - } - return new CoordParam(x, y); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentFromCodeContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentFromCodeContent.java new file mode 100644 index 000000000000..15a9e5a1f8f0 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentFromCodeContent.java @@ -0,0 +1,61 @@ +// 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.implementation.models; + +import com.azure.ai.agents.models.CodeFileDetails; +import com.azure.ai.agents.models.CreateAgentVersionFromCodeMetadata; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; + +/** + * Multipart request body for creating a new code-based agent (POST /agents). Inherits from + * CreateAgentVersionFromCodeContent for future extensibility. + */ +@Immutable +public final class CreateAgentFromCodeContent { + + /* + * JSON metadata including description and hosted definition. + */ + @Generated + private final CreateAgentVersionFromCodeMetadata metadata; + + /* + * The code zip file (max 250 MB). + */ + @Generated + private final CodeFileDetails code; + + /** + * Creates an instance of CreateAgentFromCodeContent class. + * + * @param metadata the metadata value to set. + * @param code the code value to set. + */ + @Generated + public CreateAgentFromCodeContent(CreateAgentVersionFromCodeMetadata metadata, CodeFileDetails code) { + this.metadata = metadata; + this.code = code; + } + + /** + * Get the metadata property: JSON metadata including description and hosted definition. + * + * @return the metadata value. + */ + @Generated + public CreateAgentVersionFromCodeMetadata getMetadata() { + return this.metadata; + } + + /** + * Get the code property: The code zip file (max 250 MB). + * + * @return the code value. + */ + @Generated + public CodeFileDetails getCode() { + return this.code; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentOptions.java index 93b7ebfd645c..a260a1072b60 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentOptions.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentOptions.java @@ -7,7 +7,7 @@ import com.azure.ai.agents.models.AgentCard; import com.azure.ai.agents.models.AgentDefinition; import com.azure.ai.agents.models.AgentDefinitionOptInKeys; -import com.azure.ai.agents.models.AgentEndpoint; +import com.azure.ai.agents.models.AgentEndpointConfig; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import java.util.Map; @@ -66,7 +66,7 @@ public final class CreateAgentOptions { * An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent */ @Generated - private AgentEndpoint agentEndpoint; + private AgentEndpointConfig agentEndpoint; /* * Optional agent card for the agent @@ -218,23 +218,10 @@ public CreateAgentOptions setBlueprintReference(AgentBlueprintReference blueprin * @return the agentEndpoint value. */ @Generated - public AgentEndpoint getAgentEndpoint() { + public AgentEndpointConfig getAgentEndpoint() { return this.agentEndpoint; } - /** - * Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint - * configuration will be set for the agent. - * - * @param agentEndpoint the agentEndpoint value to set. - * @return the CreateAgentOptions object itself. - */ - @Generated - public CreateAgentOptions setAgentEndpoint(AgentEndpoint agentEndpoint) { - this.agentEndpoint = agentEndpoint; - return this; - } - /** * Get the agentCard property: Optional agent card for the agent. * @@ -256,4 +243,17 @@ public CreateAgentOptions setAgentCard(AgentCard agentCard) { this.agentCard = agentCard; return this; } + + /** + * Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint + * configuration will be set for the agent. + * + * @param agentEndpoint the agentEndpoint value to set. + * @return the CreateAgentOptions object itself. + */ + @Generated + public CreateAgentOptions setAgentEndpoint(AgentEndpointConfig agentEndpoint) { + this.agentEndpoint = agentEndpoint; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest.java index 114fd3919c62..d7389f2b4adc 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest.java @@ -6,7 +6,7 @@ import com.azure.ai.agents.models.AgentBlueprintReference; import com.azure.ai.agents.models.AgentCard; import com.azure.ai.agents.models.AgentDefinition; -import com.azure.ai.agents.models.AgentEndpoint; +import com.azure.ai.agents.models.AgentEndpointConfig; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -179,7 +179,7 @@ public static CreateAgentRequest fromJson(JsonReader jsonReader) throws IOExcept Map metadata = null; String description = null; AgentBlueprintReference blueprintReference = null; - AgentEndpoint agentEndpoint = null; + AgentEndpointConfig agentEndpoint = null; AgentCard agentCard = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -195,7 +195,7 @@ public static CreateAgentRequest fromJson(JsonReader jsonReader) throws IOExcept } else if ("blueprint_reference".equals(fieldName)) { blueprintReference = AgentBlueprintReference.fromJson(reader); } else if ("agent_endpoint".equals(fieldName)) { - agentEndpoint = AgentEndpoint.fromJson(reader); + agentEndpoint = AgentEndpointConfig.fromJson(reader); } else if ("agent_card".equals(fieldName)) { agentCard = AgentCard.fromJson(reader); } else { @@ -222,7 +222,7 @@ public static CreateAgentRequest fromJson(JsonReader jsonReader) throws IOExcept * An optional endpoint configuration. If not specified, a default endpoint configuration will be set for the agent */ @Generated - private AgentEndpoint agentEndpoint; + private AgentEndpointConfig agentEndpoint; /* * Optional agent card for the agent @@ -259,23 +259,10 @@ public CreateAgentRequest setBlueprintReference(AgentBlueprintReference blueprin * @return the agentEndpoint value. */ @Generated - public AgentEndpoint getAgentEndpoint() { + public AgentEndpointConfig getAgentEndpoint() { return this.agentEndpoint; } - /** - * Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint - * configuration will be set for the agent. - * - * @param agentEndpoint the agentEndpoint value to set. - * @return the CreateAgentRequest object itself. - */ - @Generated - public CreateAgentRequest setAgentEndpoint(AgentEndpoint agentEndpoint) { - this.agentEndpoint = agentEndpoint; - return this; - } - /** * Get the agentCard property: Optional agent card for the agent. * @@ -297,4 +284,17 @@ public CreateAgentRequest setAgentCard(AgentCard agentCard) { this.agentCard = agentCard; return this; } + + /** + * Set the agentEndpoint property: An optional endpoint configuration. If not specified, a default endpoint + * configuration will be set for the agent. + * + * @param agentEndpoint the agentEndpoint value to set. + * @return the CreateAgentRequest object itself. + */ + @Generated + public CreateAgentRequest setAgentEndpoint(AgentEndpointConfig agentEndpoint) { + this.agentEndpoint = agentEndpoint; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryRequest.java new file mode 100644 index 000000000000..2867b02b5a7e --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryRequest.java @@ -0,0 +1,127 @@ +// 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.implementation.models; + +import com.azure.ai.agents.models.MemoryItemKind; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreateMemoryRequest model. + */ +@Immutable +public final class CreateMemoryRequest implements JsonSerializable { + + /* + * The namespace that logically groups and isolates memories, such as a user ID. + */ + @Generated + private final String scope; + + /* + * The content of the memory. + */ + @Generated + private final String content; + + /* + * The kind of the memory item. + */ + @Generated + private final MemoryItemKind kind; + + /** + * Creates an instance of CreateMemoryRequest class. + * + * @param scope the scope value to set. + * @param content the content value to set. + * @param kind the kind value to set. + */ + @Generated + public CreateMemoryRequest(String scope, String content, MemoryItemKind kind) { + this.scope = scope; + this.content = content; + this.kind = kind; + } + + /** + * Get the scope property: The namespace that logically groups and isolates memories, such as a user ID. + * + * @return the scope value. + */ + @Generated + public String getScope() { + return this.scope; + } + + /** + * Get the content property: The content of the memory. + * + * @return the content value. + */ + @Generated + public String getContent() { + return this.content; + } + + /** + * Get the kind property: The kind of the memory item. + * + * @return the kind value. + */ + @Generated + public MemoryItemKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("content", this.content); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateMemoryRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateMemoryRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateMemoryRequest. + */ + @Generated + public static CreateMemoryRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String scope = null; + String content = null; + MemoryItemKind kind = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("scope".equals(fieldName)) { + scope = reader.getString(); + } else if ("content".equals(fieldName)) { + content = reader.getString(); + } else if ("kind".equals(fieldName)) { + kind = MemoryItemKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new CreateMemoryRequest(scope, content, kind); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateToolboxVersionRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateToolboxVersionRequest.java index 6812089a3ccf..10f0bcab21f7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateToolboxVersionRequest.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CreateToolboxVersionRequest.java @@ -5,6 +5,7 @@ import com.azure.ai.agents.models.Tool; import com.azure.ai.agents.models.ToolboxPolicies; +import com.azure.ai.agents.models.ToolboxSkill; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -141,6 +142,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("description", this.description); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("skills", this.skills, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("policies", this.policies); return jsonWriter.writeEndObject(); } @@ -160,6 +162,7 @@ public static CreateToolboxVersionRequest fromJson(JsonReader jsonReader) throws List tools = null; String description = null; Map metadata = null; + List skills = null; ToolboxPolicies policies = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -170,6 +173,8 @@ public static CreateToolboxVersionRequest fromJson(JsonReader jsonReader) throws description = reader.getString(); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); + } else if ("skills".equals(fieldName)) { + skills = reader.readArray(reader1 -> ToolboxSkill.fromJson(reader1)); } else if ("policies".equals(fieldName)) { policies = ToolboxPolicies.fromJson(reader); } else { @@ -180,8 +185,40 @@ public static CreateToolboxVersionRequest fromJson(JsonReader jsonReader) throws = new CreateToolboxVersionRequest(tools); deserializedCreateToolboxVersionRequest.description = description; deserializedCreateToolboxVersionRequest.metadata = metadata; + deserializedCreateToolboxVersionRequest.skills = skills; deserializedCreateToolboxVersionRequest.policies = policies; return deserializedCreateToolboxVersionRequest; }); } + + /* + * The list of skill sources to include in this version. A skill reference specifies a skill name and optionally a + * version. If version is omitted, the skill's default version is used. + */ + @Generated + private List skills; + + /** + * Get the skills property: The list of skill sources to include in this version. A skill reference specifies a + * skill name and optionally a version. If version is omitted, the skill's default version is used. + * + * @return the skills value. + */ + @Generated + public List getSkills() { + return this.skills; + } + + /** + * Set the skills property: The list of skill sources to include in this version. A skill reference specifies a + * skill name and optionally a version. If version is omitted, the skill's default version is used. + * + * @param skills the skills value to set. + * @return the CreateToolboxVersionRequest object itself. + */ + @Generated + public CreateToolboxVersionRequest setSkills(List skills) { + this.skills = skills; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/DoubleClickAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/DoubleClickAction.java deleted file mode 100644 index 5fcbeec01fc9..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/DoubleClickAction.java +++ /dev/null @@ -1,128 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * DoubleClick - * - * A double click action. - */ -@Immutable -public final class DoubleClickAction extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.DOUBLE_CLICK; - - /* - * The x-coordinate where the double click occurred. - */ - @Generated - private final long x; - - /* - * The y-coordinate where the double click occurred. - */ - @Generated - private final long y; - - /** - * Creates an instance of DoubleClickAction class. - * - * @param x the x value to set. - * @param y the y value to set. - */ - @Generated - public DoubleClickAction(long x, long y) { - this.x = x; - this.y = y; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the x property: The x-coordinate where the double click occurred. - * - * @return the x value. - */ - @Generated - public long getX() { - return this.x; - } - - /** - * Get the y property: The y-coordinate where the double click occurred. - * - * @return the y value. - */ - @Generated - public long getY() { - return this.y; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("x", this.x); - jsonWriter.writeLongField("y", this.y); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DoubleClickAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DoubleClickAction if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DoubleClickAction. - */ - @Generated - public static DoubleClickAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long x = 0L; - long y = 0L; - ComputerActionType type = ComputerActionType.DOUBLE_CLICK; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("x".equals(fieldName)) { - x = reader.getLong(); - } else if ("y".equals(fieldName)) { - y = reader.getLong(); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - DoubleClickAction deserializedDoubleClickAction = new DoubleClickAction(x, y); - deserializedDoubleClickAction.type = type; - return deserializedDoubleClickAction; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/DragParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/DragParam.java deleted file mode 100644 index 54acd1d1e2ee..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/DragParam.java +++ /dev/null @@ -1,121 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Drag - * - * A drag action. - */ -@Immutable -public final class DragParam extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.DRAG; - - /* - * An array of coordinates representing the path of the drag action. Coordinates will appear as an array of objects, - * eg - * ``` - * [ - * { x: 100, y: 200 }, - * { x: 200, y: 300 } - * ] - * ``` - */ - @Generated - private final List path; - - /** - * Creates an instance of DragParam class. - * - * @param path the path value to set. - */ - @Generated - public DragParam(List path) { - this.path = path; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the path property: An array of coordinates representing the path of the drag action. Coordinates will appear - * as an array of objects, eg - * ``` - * [ - * { x: 100, y: 200 }, - * { x: 200, y: 300 } - * ] - * ```. - * - * @return the path value. - */ - @Generated - public List getPath() { - return this.path; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("path", this.path, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of DragParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of DragParam if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the DragParam. - */ - @Generated - public static DragParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - List path = null; - ComputerActionType type = ComputerActionType.DRAG; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("path".equals(fieldName)) { - path = reader.readArray(reader1 -> CoordParam.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - DragParam deserializedDragParam = new DragParam(path); - deserializedDragParam.type = type; - return deserializedDragParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessage.java deleted file mode 100644 index 9f935bd04fe1..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessage.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Input message - * - * A message input to the model with a role indicating instruction following - * hierarchy. Instructions given with the `developer` or `system` role take - * precedence over instructions given with the `user` role. Messages with the - * `assistant` role are presumed to have been generated by the model in previous - * interactions. - */ -@Fluent -public final class EasyInputMessage extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.MESSAGE; - - /* - * The role of the message input. One of `user`, `assistant`, `system`, or - * `developer`. - */ - @Generated - private final EasyInputMessageRole role; - - /* - * Text, image, or audio input to the model, used to generate a response. - * Can also contain previous assistant responses. - */ - @Generated - private final BinaryData content; - - /* - * The status of item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - */ - @Generated - private EasyInputMessageStatus status; - - /** - * Creates an instance of EasyInputMessage class. - * - * @param role the role value to set. - * @param content the content value to set. - */ - @Generated - public EasyInputMessage(EasyInputMessageRole role, BinaryData content) { - this.role = role; - this.content = content; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the role property: The role of the message input. One of `user`, `assistant`, `system`, or - * `developer`. - * - * @return the role value. - */ - @Generated - public EasyInputMessageRole getRole() { - return this.role; - } - - /** - * Get the content property: Text, image, or audio input to the model, used to generate a response. - * Can also contain previous assistant responses. - * - * @return the content value. - */ - @Generated - public BinaryData getContent() { - return this.content; - } - - /** - * Get the status property: The status of item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @return the status value. - */ - @Generated - public EasyInputMessageStatus getStatus() { - return this.status; - } - - /** - * Set the status property: The status of item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @param status the status value to set. - * @return the EasyInputMessage object itself. - */ - @Generated - public EasyInputMessage setStatus(EasyInputMessageStatus status) { - this.status = status; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - jsonWriter.writeFieldName("content"); - this.content.writeTo(jsonWriter); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EasyInputMessage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EasyInputMessage if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the EasyInputMessage. - */ - @Generated - public static EasyInputMessage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EasyInputMessageRole role = null; - BinaryData content = null; - InputItemType type = InputItemType.MESSAGE; - EasyInputMessageStatus status = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("role".equals(fieldName)) { - role = EasyInputMessageRole.fromString(reader.getString()); - } else if ("content".equals(fieldName)) { - content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("status".equals(fieldName)) { - status = EasyInputMessageStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - EasyInputMessage deserializedEasyInputMessage = new EasyInputMessage(role, content); - deserializedEasyInputMessage.type = type; - deserializedEasyInputMessage.status = status; - return deserializedEasyInputMessage; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java deleted file mode 100644 index 2f052ab8a2f8..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java +++ /dev/null @@ -1,66 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for EasyInputMessageRole. - */ -public enum EasyInputMessageRole { - /** - * Enum value user. - */ - USER("user"), - - /** - * Enum value assistant. - */ - ASSISTANT("assistant"), - - /** - * Enum value system. - */ - SYSTEM("system"), - - /** - * Enum value developer. - */ - DEVELOPER("developer"); - - /** - * The actual serialized value for a EasyInputMessageRole instance. - */ - private final String value; - - EasyInputMessageRole(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EasyInputMessageRole instance. - * - * @param value the serialized value to parse. - * @return the parsed EasyInputMessageRole object, or null if unable to parse. - */ - public static EasyInputMessageRole fromString(String value) { - if (value == null) { - return null; - } - EasyInputMessageRole[] items = EasyInputMessageRole.values(); - for (EasyInputMessageRole 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/implementation/models/EasyInputMessageStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageStatus.java deleted file mode 100644 index 59fc1a7846a1..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for EasyInputMessageStatus. - */ -public enum EasyInputMessageStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a EasyInputMessageStatus instance. - */ - private final String value; - - EasyInputMessageStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a EasyInputMessageStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed EasyInputMessageStatus object, or null if unable to parse. - */ - public static EasyInputMessageStatus fromString(String value) { - if (value == null) { - return null; - } - EasyInputMessageStatus[] items = EasyInputMessageStatus.values(); - for (EasyInputMessageStatus 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/implementation/models/FileCitationBody.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FileCitationBody.java deleted file mode 100644 index b8ec8f41e1b1..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FileCitationBody.java +++ /dev/null @@ -1,150 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * File citation - * - * A citation to a file. - */ -@Immutable -public final class FileCitationBody extends Annotation { - - /* - * The type property. - */ - @Generated - private AnnotationType type = AnnotationType.FILE_CITATION; - - /* - * The ID of the file. - */ - @Generated - private final String fileId; - - /* - * The index of the file in the list of files. - */ - @Generated - private final long index; - - /* - * The filename of the file cited. - */ - @Generated - private final String filename; - - /** - * Creates an instance of FileCitationBody class. - * - * @param fileId the fileId value to set. - * @param index the index value to set. - * @param filename the filename value to set. - */ - @Generated - public FileCitationBody(String fileId, long index, String filename) { - this.fileId = fileId; - this.index = index; - this.filename = filename; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public AnnotationType getType() { - return this.type; - } - - /** - * Get the fileId property: The ID of the file. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Get the index property: The index of the file in the list of files. - * - * @return the index value. - */ - @Generated - public long getIndex() { - return this.index; - } - - /** - * Get the filename property: The filename of the file cited. - * - * @return the filename value. - */ - @Generated - public String getFilename() { - return this.filename; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeLongField("index", this.index); - jsonWriter.writeStringField("filename", this.filename); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FileCitationBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FileCitationBody if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FileCitationBody. - */ - @Generated - public static FileCitationBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String fileId = null; - long index = 0L; - String filename = null; - AnnotationType type = AnnotationType.FILE_CITATION; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("file_id".equals(fieldName)) { - fileId = reader.getString(); - } else if ("index".equals(fieldName)) { - index = reader.getLong(); - } else if ("filename".equals(fieldName)) { - filename = reader.getString(); - } else if ("type".equals(fieldName)) { - type = AnnotationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - FileCitationBody deserializedFileCitationBody = new FileCitationBody(fileId, index, filename); - deserializedFileCitationBody.type = type; - return deserializedFileCitationBody; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FilePath.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FilePath.java deleted file mode 100644 index a042e0fa1acd..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FilePath.java +++ /dev/null @@ -1,128 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * File path - * - * A path to a file. - */ -@Immutable -public final class FilePath extends Annotation { - - /* - * The type property. - */ - @Generated - private AnnotationType type = AnnotationType.FILE_PATH; - - /* - * The ID of the file. - */ - @Generated - private final String fileId; - - /* - * The index of the file in the list of files. - */ - @Generated - private final long index; - - /** - * Creates an instance of FilePath class. - * - * @param fileId the fileId value to set. - * @param index the index value to set. - */ - @Generated - public FilePath(String fileId, long index) { - this.fileId = fileId; - this.index = index; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public AnnotationType getType() { - return this.type; - } - - /** - * Get the fileId property: The ID of the file. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Get the index property: The index of the file in the list of files. - * - * @return the index value. - */ - @Generated - public long getIndex() { - return this.index; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeLongField("index", this.index); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FilePath from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FilePath if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FilePath. - */ - @Generated - public static FilePath fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String fileId = null; - long index = 0L; - AnnotationType type = AnnotationType.FILE_PATH; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("file_id".equals(fieldName)) { - fileId = reader.getString(); - } else if ("index".equals(fieldName)) { - index = reader.getLong(); - } else if ("type".equals(fieldName)) { - type = AnnotationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - FilePath deserializedFilePath = new FilePath(fileId, index); - deserializedFilePath.type = type; - return deserializedFilePath; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FileSearchToolCallResults.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FileSearchToolCallResults.java deleted file mode 100644 index 154eb4630be1..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FileSearchToolCallResults.java +++ /dev/null @@ -1,214 +0,0 @@ -// 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.implementation.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; - -/** - * The FileSearchToolCallResults model. - */ -@Fluent -public final class FileSearchToolCallResults implements JsonSerializable { - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The text property. - */ - @Generated - private String text; - - /* - * The filename property. - */ - @Generated - private String filename; - - /* - * The attributes property. - */ - @Generated - private VectorStoreFileAttributes attributes; - - /* - * The score property. - */ - @Generated - private Double score; - - /** - * Creates an instance of FileSearchToolCallResults class. - */ - @Generated - public FileSearchToolCallResults() { - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the FileSearchToolCallResults object itself. - */ - @Generated - public FileSearchToolCallResults setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the text property: The text property. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * Set the text property: The text property. - * - * @param text the text value to set. - * @return the FileSearchToolCallResults object itself. - */ - @Generated - public FileSearchToolCallResults setText(String text) { - this.text = text; - return this; - } - - /** - * Get the filename property: The filename property. - * - * @return the filename value. - */ - @Generated - public String getFilename() { - return this.filename; - } - - /** - * Set the filename property: The filename property. - * - * @param filename the filename value to set. - * @return the FileSearchToolCallResults object itself. - */ - @Generated - public FileSearchToolCallResults setFilename(String filename) { - this.filename = filename; - return this; - } - - /** - * Get the attributes property: The attributes property. - * - * @return the attributes value. - */ - @Generated - public VectorStoreFileAttributes getAttributes() { - return this.attributes; - } - - /** - * Set the attributes property: The attributes property. - * - * @param attributes the attributes value to set. - * @return the FileSearchToolCallResults object itself. - */ - @Generated - public FileSearchToolCallResults setAttributes(VectorStoreFileAttributes attributes) { - this.attributes = attributes; - return this; - } - - /** - * Get the score property: The score property. - * - * @return the score value. - */ - @Generated - public Double getScore() { - return this.score; - } - - /** - * Set the score property: The score property. - * - * @param score the score value to set. - * @return the FileSearchToolCallResults object itself. - */ - @Generated - public FileSearchToolCallResults setScore(Double score) { - this.score = score; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeStringField("text", this.text); - jsonWriter.writeStringField("filename", this.filename); - jsonWriter.writeJsonField("attributes", this.attributes); - jsonWriter.writeNumberField("score", this.score); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FileSearchToolCallResults from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FileSearchToolCallResults 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 FileSearchToolCallResults. - */ - @Generated - public static FileSearchToolCallResults fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FileSearchToolCallResults deserializedFileSearchToolCallResults = new FileSearchToolCallResults(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("file_id".equals(fieldName)) { - deserializedFileSearchToolCallResults.fileId = reader.getString(); - } else if ("text".equals(fieldName)) { - deserializedFileSearchToolCallResults.text = reader.getString(); - } else if ("filename".equals(fieldName)) { - deserializedFileSearchToolCallResults.filename = reader.getString(); - } else if ("attributes".equals(fieldName)) { - deserializedFileSearchToolCallResults.attributes = VectorStoreFileAttributes.fromJson(reader); - } else if ("score".equals(fieldName)) { - deserializedFileSearchToolCallResults.score = reader.getNullable(JsonReader::getDouble); - } else { - reader.skipChildren(); - } - } - return deserializedFileSearchToolCallResults; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutput.java deleted file mode 100644 index 3dcb06b60607..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutput.java +++ /dev/null @@ -1,112 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The FunctionAndCustomToolCallOutput model. - */ -@Immutable -public class FunctionAndCustomToolCallOutput implements JsonSerializable { - - /* - * The type property. - */ - @Generated - private FunctionAndCustomToolCallOutputType type - = FunctionAndCustomToolCallOutputType.fromString("FunctionAndCustomToolCallOutput"); - - /** - * Creates an instance of FunctionAndCustomToolCallOutput class. - */ - @Generated - public FunctionAndCustomToolCallOutput() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - public FunctionAndCustomToolCallOutputType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionAndCustomToolCallOutput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionAndCustomToolCallOutput 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 FunctionAndCustomToolCallOutput. - */ - @Generated - public static FunctionAndCustomToolCallOutput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - // Prepare for reading - readerToUse.nextToken(); - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("input_text".equals(discriminatorValue)) { - return FunctionAndCustomToolCallOutputInputTextContent.fromJson(readerToUse.reset()); - } else if ("input_image".equals(discriminatorValue)) { - return FunctionAndCustomToolCallOutputInputImageContent.fromJson(readerToUse.reset()); - } else if ("input_file".equals(discriminatorValue)) { - return FunctionAndCustomToolCallOutputInputFileContent.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static FunctionAndCustomToolCallOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FunctionAndCustomToolCallOutput deserializedFunctionAndCustomToolCallOutput - = new FunctionAndCustomToolCallOutput(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedFunctionAndCustomToolCallOutput.type - = FunctionAndCustomToolCallOutputType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedFunctionAndCustomToolCallOutput; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputFileContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputFileContent.java deleted file mode 100644 index 708c4815989e..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputFileContent.java +++ /dev/null @@ -1,206 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Input file - * - * A file input to the model. - */ -@Fluent -public final class FunctionAndCustomToolCallOutputInputFileContent extends FunctionAndCustomToolCallOutput { - - /* - * The type property. - */ - @Generated - private FunctionAndCustomToolCallOutputType type = FunctionAndCustomToolCallOutputType.INPUT_FILE; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The name of the file to be sent to the model. - */ - @Generated - private String filename; - - /* - * The URL of the file to be sent to the model. - */ - @Generated - private String fileUrl; - - /* - * The content of the file to be sent to the model. - */ - @Generated - private String fileData; - - /** - * Creates an instance of FunctionAndCustomToolCallOutputInputFileContent class. - */ - @Generated - public FunctionAndCustomToolCallOutputInputFileContent() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionAndCustomToolCallOutputType getType() { - return this.type; - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the FunctionAndCustomToolCallOutputInputFileContent object itself. - */ - @Generated - public FunctionAndCustomToolCallOutputInputFileContent setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the filename property: The name of the file to be sent to the model. - * - * @return the filename value. - */ - @Generated - public String getFilename() { - return this.filename; - } - - /** - * Set the filename property: The name of the file to be sent to the model. - * - * @param filename the filename value to set. - * @return the FunctionAndCustomToolCallOutputInputFileContent object itself. - */ - @Generated - public FunctionAndCustomToolCallOutputInputFileContent setFilename(String filename) { - this.filename = filename; - return this; - } - - /** - * Get the fileUrl property: The URL of the file to be sent to the model. - * - * @return the fileUrl value. - */ - @Generated - public String getFileUrl() { - return this.fileUrl; - } - - /** - * Set the fileUrl property: The URL of the file to be sent to the model. - * - * @param fileUrl the fileUrl value to set. - * @return the FunctionAndCustomToolCallOutputInputFileContent object itself. - */ - @Generated - public FunctionAndCustomToolCallOutputInputFileContent setFileUrl(String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * Get the fileData property: The content of the file to be sent to the model. - * - * @return the fileData value. - */ - @Generated - public String getFileData() { - return this.fileData; - } - - /** - * Set the fileData property: The content of the file to be sent to the model. - * - * @param fileData the fileData value to set. - * @return the FunctionAndCustomToolCallOutputInputFileContent object itself. - */ - @Generated - public FunctionAndCustomToolCallOutputInputFileContent setFileData(String fileData) { - this.fileData = fileData; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeStringField("filename", this.filename); - jsonWriter.writeStringField("file_url", this.fileUrl); - jsonWriter.writeStringField("file_data", this.fileData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionAndCustomToolCallOutputInputFileContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionAndCustomToolCallOutputInputFileContent 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 FunctionAndCustomToolCallOutputInputFileContent. - */ - @Generated - public static FunctionAndCustomToolCallOutputInputFileContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FunctionAndCustomToolCallOutputInputFileContent deserializedFunctionAndCustomToolCallOutputInputFileContent - = new FunctionAndCustomToolCallOutputInputFileContent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedFunctionAndCustomToolCallOutputInputFileContent.type - = FunctionAndCustomToolCallOutputType.fromString(reader.getString()); - } else if ("file_id".equals(fieldName)) { - deserializedFunctionAndCustomToolCallOutputInputFileContent.fileId = reader.getString(); - } else if ("filename".equals(fieldName)) { - deserializedFunctionAndCustomToolCallOutputInputFileContent.filename = reader.getString(); - } else if ("file_url".equals(fieldName)) { - deserializedFunctionAndCustomToolCallOutputInputFileContent.fileUrl = reader.getString(); - } else if ("file_data".equals(fieldName)) { - deserializedFunctionAndCustomToolCallOutputInputFileContent.fileData = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedFunctionAndCustomToolCallOutputInputFileContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputImageContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputImageContent.java deleted file mode 100644 index 6f812afe9f84..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputImageContent.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Input image - * - * An image input to the model. Learn about [image inputs](/docs/guides/vision). - */ -@Fluent -public final class FunctionAndCustomToolCallOutputInputImageContent extends FunctionAndCustomToolCallOutput { - - /* - * The type property. - */ - @Generated - private FunctionAndCustomToolCallOutputType type = FunctionAndCustomToolCallOutputType.INPUT_IMAGE; - - /* - * The image_url property. - */ - @Generated - private String imageUrl; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - */ - @Generated - private final ImageDetail detail; - - /** - * Creates an instance of FunctionAndCustomToolCallOutputInputImageContent class. - * - * @param detail the detail value to set. - */ - @Generated - public FunctionAndCustomToolCallOutputInputImageContent(ImageDetail detail) { - this.detail = detail; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionAndCustomToolCallOutputType getType() { - return this.type; - } - - /** - * Get the imageUrl property: The image_url property. - * - * @return the imageUrl value. - */ - @Generated - public String getImageUrl() { - return this.imageUrl; - } - - /** - * Set the imageUrl property: The image_url property. - * - * @param imageUrl the imageUrl value to set. - * @return the FunctionAndCustomToolCallOutputInputImageContent object itself. - */ - @Generated - public FunctionAndCustomToolCallOutputInputImageContent setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the FunctionAndCustomToolCallOutputInputImageContent object itself. - */ - @Generated - public FunctionAndCustomToolCallOutputInputImageContent setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the detail property: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. - * Defaults to `auto`. - * - * @return the detail value. - */ - @Generated - public ImageDetail getDetail() { - return this.detail; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("detail", this.detail == null ? null : this.detail.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("image_url", this.imageUrl); - jsonWriter.writeStringField("file_id", this.fileId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionAndCustomToolCallOutputInputImageContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionAndCustomToolCallOutputInputImageContent if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FunctionAndCustomToolCallOutputInputImageContent. - */ - @Generated - public static FunctionAndCustomToolCallOutputInputImageContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImageDetail detail = null; - FunctionAndCustomToolCallOutputType type = FunctionAndCustomToolCallOutputType.INPUT_IMAGE; - String imageUrl = null; - String fileId = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("detail".equals(fieldName)) { - detail = ImageDetail.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = FunctionAndCustomToolCallOutputType.fromString(reader.getString()); - } else if ("image_url".equals(fieldName)) { - imageUrl = reader.getString(); - } else if ("file_id".equals(fieldName)) { - fileId = reader.getString(); - } else { - reader.skipChildren(); - } - } - FunctionAndCustomToolCallOutputInputImageContent deserializedFunctionAndCustomToolCallOutputInputImageContent - = new FunctionAndCustomToolCallOutputInputImageContent(detail); - deserializedFunctionAndCustomToolCallOutputInputImageContent.type = type; - deserializedFunctionAndCustomToolCallOutputInputImageContent.imageUrl = imageUrl; - deserializedFunctionAndCustomToolCallOutputInputImageContent.fileId = fileId; - return deserializedFunctionAndCustomToolCallOutputInputImageContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputTextContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputTextContent.java deleted file mode 100644 index 231c8d7ce861..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputTextContent.java +++ /dev/null @@ -1,107 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Input text - * - * A text input to the model. - */ -@Immutable -public final class FunctionAndCustomToolCallOutputInputTextContent extends FunctionAndCustomToolCallOutput { - - /* - * The type property. - */ - @Generated - private FunctionAndCustomToolCallOutputType type = FunctionAndCustomToolCallOutputType.INPUT_TEXT; - - /* - * The text input to the model. - */ - @Generated - private final String text; - - /** - * Creates an instance of FunctionAndCustomToolCallOutputInputTextContent class. - * - * @param text the text value to set. - */ - @Generated - public FunctionAndCustomToolCallOutputInputTextContent(String text) { - this.text = text; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionAndCustomToolCallOutputType getType() { - return this.type; - } - - /** - * Get the text property: The text input to the model. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("text", this.text); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionAndCustomToolCallOutputInputTextContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionAndCustomToolCallOutputInputTextContent if the JsonReader was pointing to an - * instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FunctionAndCustomToolCallOutputInputTextContent. - */ - @Generated - public static FunctionAndCustomToolCallOutputInputTextContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String text = null; - FunctionAndCustomToolCallOutputType type = FunctionAndCustomToolCallOutputType.INPUT_TEXT; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); - } else if ("type".equals(fieldName)) { - type = FunctionAndCustomToolCallOutputType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - FunctionAndCustomToolCallOutputInputTextContent deserializedFunctionAndCustomToolCallOutputInputTextContent - = new FunctionAndCustomToolCallOutputInputTextContent(text); - deserializedFunctionAndCustomToolCallOutputInputTextContent.type = type; - return deserializedFunctionAndCustomToolCallOutputInputTextContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputType.java deleted file mode 100644 index 935cedfe86e6..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputType.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for FunctionAndCustomToolCallOutputType. - */ -public final class FunctionAndCustomToolCallOutputType - extends ExpandableStringEnum { - - /** - * Static value input_text for FunctionAndCustomToolCallOutputType. - */ - @Generated - public static final FunctionAndCustomToolCallOutputType INPUT_TEXT = fromString("input_text"); - - /** - * Static value input_image for FunctionAndCustomToolCallOutputType. - */ - @Generated - public static final FunctionAndCustomToolCallOutputType INPUT_IMAGE = fromString("input_image"); - - /** - * Static value input_file for FunctionAndCustomToolCallOutputType. - */ - @Generated - public static final FunctionAndCustomToolCallOutputType INPUT_FILE = fromString("input_file"); - - /** - * Creates a new instance of FunctionAndCustomToolCallOutputType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public FunctionAndCustomToolCallOutputType() { - } - - /** - * Creates or finds a FunctionAndCustomToolCallOutputType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FunctionAndCustomToolCallOutputType. - */ - @Generated - public static FunctionAndCustomToolCallOutputType fromString(String name) { - return fromString(name, FunctionAndCustomToolCallOutputType.class); - } - - /** - * Gets known FunctionAndCustomToolCallOutputType values. - * - * @return known FunctionAndCustomToolCallOutputType values. - */ - @Generated - public static Collection values() { - return values(FunctionAndCustomToolCallOutputType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionCallItemStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionCallItemStatus.java deleted file mode 100644 index d9802eb67125..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionCallItemStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for FunctionCallItemStatus. - */ -public enum FunctionCallItemStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a FunctionCallItemStatus instance. - */ - private final String value; - - FunctionCallItemStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a FunctionCallItemStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed FunctionCallItemStatus object, or null if unable to parse. - */ - public static FunctionCallItemStatus fromString(String value) { - if (value == null) { - return null; - } - FunctionCallItemStatus[] items = FunctionCallItemStatus.values(); - for (FunctionCallItemStatus 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/implementation/models/FunctionShellActionParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellActionParam.java deleted file mode 100644 index 29e45f3209f9..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellActionParam.java +++ /dev/null @@ -1,152 +0,0 @@ -// 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.implementation.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; -import java.util.List; - -/** - * Shell action - * - * Commands and limits describing how to run the shell tool call. - */ -@Fluent -public final class FunctionShellActionParam implements JsonSerializable { - - /* - * Ordered shell commands for the execution environment to run. - */ - @Generated - private final List commands; - - /* - * The timeout_ms property. - */ - @Generated - private Long timeoutMs; - - /* - * The max_output_length property. - */ - @Generated - private Long maxOutputLength; - - /** - * Creates an instance of FunctionShellActionParam class. - * - * @param commands the commands value to set. - */ - @Generated - public FunctionShellActionParam(List commands) { - this.commands = commands; - } - - /** - * Get the commands property: Ordered shell commands for the execution environment to run. - * - * @return the commands value. - */ - @Generated - public List getCommands() { - return this.commands; - } - - /** - * Get the timeoutMs property: The timeout_ms property. - * - * @return the timeoutMs value. - */ - @Generated - public Long getTimeoutMs() { - return this.timeoutMs; - } - - /** - * Set the timeoutMs property: The timeout_ms property. - * - * @param timeoutMs the timeoutMs value to set. - * @return the FunctionShellActionParam object itself. - */ - @Generated - public FunctionShellActionParam setTimeoutMs(Long timeoutMs) { - this.timeoutMs = timeoutMs; - return this; - } - - /** - * Get the maxOutputLength property: The max_output_length property. - * - * @return the maxOutputLength value. - */ - @Generated - public Long getMaxOutputLength() { - return this.maxOutputLength; - } - - /** - * Set the maxOutputLength property: The max_output_length property. - * - * @param maxOutputLength the maxOutputLength value to set. - * @return the FunctionShellActionParam object itself. - */ - @Generated - public FunctionShellActionParam setMaxOutputLength(Long maxOutputLength) { - this.maxOutputLength = maxOutputLength; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("commands", this.commands, (writer, element) -> writer.writeString(element)); - jsonWriter.writeNumberField("timeout_ms", this.timeoutMs); - jsonWriter.writeNumberField("max_output_length", this.maxOutputLength); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellActionParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellActionParam if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FunctionShellActionParam. - */ - @Generated - public static FunctionShellActionParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - List commands = null; - Long timeoutMs = null; - Long maxOutputLength = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("commands".equals(fieldName)) { - commands = reader.readArray(reader1 -> reader1.getString()); - } else if ("timeout_ms".equals(fieldName)) { - timeoutMs = reader.getNullable(JsonReader::getLong); - } else if ("max_output_length".equals(fieldName)) { - maxOutputLength = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - FunctionShellActionParam deserializedFunctionShellActionParam = new FunctionShellActionParam(commands); - deserializedFunctionShellActionParam.timeoutMs = timeoutMs; - deserializedFunctionShellActionParam.maxOutputLength = maxOutputLength; - return deserializedFunctionShellActionParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironment.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironment.java deleted file mode 100644 index ae8c4fbcdf04..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironment.java +++ /dev/null @@ -1,110 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The environment to execute the shell commands in. - */ -@Immutable -public class FunctionShellCallItemParamEnvironment implements JsonSerializable { - - /* - * The type property. - */ - @Generated - private FunctionShellCallItemParamEnvironmentType type - = FunctionShellCallItemParamEnvironmentType.fromString("FunctionShellCallItemParamEnvironment"); - - /** - * Creates an instance of FunctionShellCallItemParamEnvironment class. - */ - @Generated - public FunctionShellCallItemParamEnvironment() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - public FunctionShellCallItemParamEnvironmentType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallItemParamEnvironment from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallItemParamEnvironment 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 FunctionShellCallItemParamEnvironment. - */ - @Generated - public static FunctionShellCallItemParamEnvironment fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - // Prepare for reading - readerToUse.nextToken(); - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("local".equals(discriminatorValue)) { - return FunctionShellCallItemParamEnvironmentLocalEnvironmentParam.fromJson(readerToUse.reset()); - } else if ("container_reference".equals(discriminatorValue)) { - return FunctionShellCallItemParamEnvironmentContainerReferenceParam.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static FunctionShellCallItemParamEnvironment fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FunctionShellCallItemParamEnvironment deserializedFunctionShellCallItemParamEnvironment - = new FunctionShellCallItemParamEnvironment(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedFunctionShellCallItemParamEnvironment.type - = FunctionShellCallItemParamEnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedFunctionShellCallItemParamEnvironment; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentContainerReferenceParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentContainerReferenceParam.java deleted file mode 100644 index 6d5d0da847a9..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentContainerReferenceParam.java +++ /dev/null @@ -1,110 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * The FunctionShellCallItemParamEnvironmentContainerReferenceParam model. - */ -@Immutable -public final class FunctionShellCallItemParamEnvironmentContainerReferenceParam - extends FunctionShellCallItemParamEnvironment { - - /* - * The type property. - */ - @Generated - private FunctionShellCallItemParamEnvironmentType type - = FunctionShellCallItemParamEnvironmentType.CONTAINER_REFERENCE; - - /* - * The ID of the referenced container. - */ - @Generated - private final String containerId; - - /** - * Creates an instance of FunctionShellCallItemParamEnvironmentContainerReferenceParam class. - * - * @param containerId the containerId value to set. - */ - @Generated - public FunctionShellCallItemParamEnvironmentContainerReferenceParam(String containerId) { - this.containerId = containerId; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionShellCallItemParamEnvironmentType getType() { - return this.type; - } - - /** - * Get the containerId property: The ID of the referenced container. - * - * @return the containerId value. - */ - @Generated - public String getContainerId() { - return this.containerId; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("container_id", this.containerId); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallItemParamEnvironmentContainerReferenceParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallItemParamEnvironmentContainerReferenceParam if the JsonReader was - * pointing to an instance of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the - * FunctionShellCallItemParamEnvironmentContainerReferenceParam. - */ - @Generated - public static FunctionShellCallItemParamEnvironmentContainerReferenceParam fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - String containerId = null; - FunctionShellCallItemParamEnvironmentType type - = FunctionShellCallItemParamEnvironmentType.CONTAINER_REFERENCE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("container_id".equals(fieldName)) { - containerId = reader.getString(); - } else if ("type".equals(fieldName)) { - type = FunctionShellCallItemParamEnvironmentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - FunctionShellCallItemParamEnvironmentContainerReferenceParam deserializedFunctionShellCallItemParamEnvironmentContainerReferenceParam - = new FunctionShellCallItemParamEnvironmentContainerReferenceParam(containerId); - deserializedFunctionShellCallItemParamEnvironmentContainerReferenceParam.type = type; - return deserializedFunctionShellCallItemParamEnvironmentContainerReferenceParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentLocalEnvironmentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentLocalEnvironmentParam.java deleted file mode 100644 index d03c54565287..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentLocalEnvironmentParam.java +++ /dev/null @@ -1,118 +0,0 @@ -// 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.implementation.models; - -import com.azure.ai.agents.models.LocalSkillParameter; -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The FunctionShellCallItemParamEnvironmentLocalEnvironmentParam model. - */ -@Fluent -public final class FunctionShellCallItemParamEnvironmentLocalEnvironmentParam - extends FunctionShellCallItemParamEnvironment { - - /* - * The type property. - */ - @Generated - private FunctionShellCallItemParamEnvironmentType type = FunctionShellCallItemParamEnvironmentType.LOCAL; - - /* - * An optional list of skills. - */ - @Generated - private List skills; - - /** - * Creates an instance of FunctionShellCallItemParamEnvironmentLocalEnvironmentParam class. - */ - @Generated - public FunctionShellCallItemParamEnvironmentLocalEnvironmentParam() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionShellCallItemParamEnvironmentType getType() { - return this.type; - } - - /** - * Get the skills property: An optional list of skills. - * - * @return the skills value. - */ - @Generated - public List getSkills() { - return this.skills; - } - - /** - * Set the skills property: An optional list of skills. - * - * @param skills the skills value to set. - * @return the FunctionShellCallItemParamEnvironmentLocalEnvironmentParam object itself. - */ - @Generated - public FunctionShellCallItemParamEnvironmentLocalEnvironmentParam setSkills(List skills) { - this.skills = skills; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeArrayField("skills", this.skills, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallItemParamEnvironmentLocalEnvironmentParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallItemParamEnvironmentLocalEnvironmentParam 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 - * FunctionShellCallItemParamEnvironmentLocalEnvironmentParam. - */ - @Generated - public static FunctionShellCallItemParamEnvironmentLocalEnvironmentParam fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - FunctionShellCallItemParamEnvironmentLocalEnvironmentParam deserializedFunctionShellCallItemParamEnvironmentLocalEnvironmentParam - = new FunctionShellCallItemParamEnvironmentLocalEnvironmentParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedFunctionShellCallItemParamEnvironmentLocalEnvironmentParam.type - = FunctionShellCallItemParamEnvironmentType.fromString(reader.getString()); - } else if ("skills".equals(fieldName)) { - List skills - = reader.readArray(reader1 -> LocalSkillParameter.fromJson(reader1)); - deserializedFunctionShellCallItemParamEnvironmentLocalEnvironmentParam.skills = skills; - } else { - reader.skipChildren(); - } - } - return deserializedFunctionShellCallItemParamEnvironmentLocalEnvironmentParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentType.java deleted file mode 100644 index 483e85ab51fa..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentType.java +++ /dev/null @@ -1,59 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for FunctionShellCallItemParamEnvironmentType. - */ -public final class FunctionShellCallItemParamEnvironmentType - extends ExpandableStringEnum { - - /** - * Static value local for FunctionShellCallItemParamEnvironmentType. - */ - @Generated - public static final FunctionShellCallItemParamEnvironmentType LOCAL = fromString("local"); - - /** - * Static value container_reference for FunctionShellCallItemParamEnvironmentType. - */ - @Generated - public static final FunctionShellCallItemParamEnvironmentType CONTAINER_REFERENCE - = fromString("container_reference"); - - /** - * Creates a new instance of FunctionShellCallItemParamEnvironmentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public FunctionShellCallItemParamEnvironmentType() { - } - - /** - * Creates or finds a FunctionShellCallItemParamEnvironmentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FunctionShellCallItemParamEnvironmentType. - */ - @Generated - public static FunctionShellCallItemParamEnvironmentType fromString(String name) { - return fromString(name, FunctionShellCallItemParamEnvironmentType.class); - } - - /** - * Gets known FunctionShellCallItemParamEnvironmentType values. - * - * @return known FunctionShellCallItemParamEnvironmentType values. - */ - @Generated - public static Collection values() { - return values(FunctionShellCallItemParamEnvironmentType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemStatus.java deleted file mode 100644 index a0abe4108aac..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemStatus.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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.implementation.models; - -/** - * Shell call status - * - * Status values reported for shell tool calls. - */ -public enum FunctionShellCallItemStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a FunctionShellCallItemStatus instance. - */ - private final String value; - - FunctionShellCallItemStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a FunctionShellCallItemStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed FunctionShellCallItemStatus object, or null if unable to parse. - */ - public static FunctionShellCallItemStatus fromString(String value) { - if (value == null) { - return null; - } - FunctionShellCallItemStatus[] items = FunctionShellCallItemStatus.values(); - for (FunctionShellCallItemStatus 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/implementation/models/FunctionShellCallOutputContentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputContentParam.java deleted file mode 100644 index 51c24e9d2d02..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputContentParam.java +++ /dev/null @@ -1,130 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Shell output content - * - * Captured stdout and stderr for a portion of a shell tool call output. - */ -@Immutable -public final class FunctionShellCallOutputContentParam - implements JsonSerializable { - - /* - * Captured stdout output for the shell call. - */ - @Generated - private final String stdout; - - /* - * Captured stderr output for the shell call. - */ - @Generated - private final String stderr; - - /* - * The exit or timeout outcome associated with this shell call. - */ - @Generated - private final FunctionShellCallOutputOutcomeParam outcome; - - /** - * Creates an instance of FunctionShellCallOutputContentParam class. - * - * @param stdout the stdout value to set. - * @param stderr the stderr value to set. - * @param outcome the outcome value to set. - */ - @Generated - public FunctionShellCallOutputContentParam(String stdout, String stderr, - FunctionShellCallOutputOutcomeParam outcome) { - this.stdout = stdout; - this.stderr = stderr; - this.outcome = outcome; - } - - /** - * Get the stdout property: Captured stdout output for the shell call. - * - * @return the stdout value. - */ - @Generated - public String getStdout() { - return this.stdout; - } - - /** - * Get the stderr property: Captured stderr output for the shell call. - * - * @return the stderr value. - */ - @Generated - public String getStderr() { - return this.stderr; - } - - /** - * Get the outcome property: The exit or timeout outcome associated with this shell call. - * - * @return the outcome value. - */ - @Generated - public FunctionShellCallOutputOutcomeParam getOutcome() { - return this.outcome; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("stdout", this.stdout); - jsonWriter.writeStringField("stderr", this.stderr); - jsonWriter.writeJsonField("outcome", this.outcome); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallOutputContentParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallOutputContentParam if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FunctionShellCallOutputContentParam. - */ - @Generated - public static FunctionShellCallOutputContentParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String stdout = null; - String stderr = null; - FunctionShellCallOutputOutcomeParam outcome = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("stdout".equals(fieldName)) { - stdout = reader.getString(); - } else if ("stderr".equals(fieldName)) { - stderr = reader.getString(); - } else if ("outcome".equals(fieldName)) { - outcome = FunctionShellCallOutputOutcomeParam.fromJson(reader); - } else { - reader.skipChildren(); - } - } - return new FunctionShellCallOutputContentParam(stdout, stderr, outcome); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputExitOutcomeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputExitOutcomeParam.java deleted file mode 100644 index 6c824940c3c5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputExitOutcomeParam.java +++ /dev/null @@ -1,107 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Shell call exit outcome - * - * Indicates that the shell commands finished and returned an exit code. - */ -@Immutable -public final class FunctionShellCallOutputExitOutcomeParam extends FunctionShellCallOutputOutcomeParam { - - /* - * The type property. - */ - @Generated - private FunctionShellCallOutputOutcomeParamType type = FunctionShellCallOutputOutcomeParamType.EXIT; - - /* - * The exit code returned by the shell process. - */ - @Generated - private final long exitCode; - - /** - * Creates an instance of FunctionShellCallOutputExitOutcomeParam class. - * - * @param exitCode the exitCode value to set. - */ - @Generated - public FunctionShellCallOutputExitOutcomeParam(long exitCode) { - this.exitCode = exitCode; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionShellCallOutputOutcomeParamType getType() { - return this.type; - } - - /** - * Get the exitCode property: The exit code returned by the shell process. - * - * @return the exitCode value. - */ - @Generated - public long getExitCode() { - return this.exitCode; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("exit_code", this.exitCode); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallOutputExitOutcomeParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallOutputExitOutcomeParam if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the FunctionShellCallOutputExitOutcomeParam. - */ - @Generated - public static FunctionShellCallOutputExitOutcomeParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long exitCode = 0L; - FunctionShellCallOutputOutcomeParamType type = FunctionShellCallOutputOutcomeParamType.EXIT; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("exit_code".equals(fieldName)) { - exitCode = reader.getLong(); - } else if ("type".equals(fieldName)) { - type = FunctionShellCallOutputOutcomeParamType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - FunctionShellCallOutputExitOutcomeParam deserializedFunctionShellCallOutputExitOutcomeParam - = new FunctionShellCallOutputExitOutcomeParam(exitCode); - deserializedFunctionShellCallOutputExitOutcomeParam.type = type; - return deserializedFunctionShellCallOutputExitOutcomeParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParam.java deleted file mode 100644 index 4f841507e914..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParam.java +++ /dev/null @@ -1,112 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Shell call outcome - * - * The exit or timeout outcome associated with this shell call. - */ -@Immutable -public class FunctionShellCallOutputOutcomeParam implements JsonSerializable { - - /* - * The type property. - */ - @Generated - private FunctionShellCallOutputOutcomeParamType type - = FunctionShellCallOutputOutcomeParamType.fromString("FunctionShellCallOutputOutcomeParam"); - - /** - * Creates an instance of FunctionShellCallOutputOutcomeParam class. - */ - @Generated - public FunctionShellCallOutputOutcomeParam() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - public FunctionShellCallOutputOutcomeParamType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallOutputOutcomeParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallOutputOutcomeParam 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 FunctionShellCallOutputOutcomeParam. - */ - @Generated - public static FunctionShellCallOutputOutcomeParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - // Prepare for reading - readerToUse.nextToken(); - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("timeout".equals(discriminatorValue)) { - return FunctionShellCallOutputTimeoutOutcomeParam.fromJson(readerToUse.reset()); - } else if ("exit".equals(discriminatorValue)) { - return FunctionShellCallOutputExitOutcomeParam.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static FunctionShellCallOutputOutcomeParam fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FunctionShellCallOutputOutcomeParam deserializedFunctionShellCallOutputOutcomeParam - = new FunctionShellCallOutputOutcomeParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedFunctionShellCallOutputOutcomeParam.type - = FunctionShellCallOutputOutcomeParamType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedFunctionShellCallOutputOutcomeParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParamType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParamType.java deleted file mode 100644 index 9fa435b0caef..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParamType.java +++ /dev/null @@ -1,58 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for FunctionShellCallOutputOutcomeParamType. - */ -public final class FunctionShellCallOutputOutcomeParamType - extends ExpandableStringEnum { - - /** - * Static value timeout for FunctionShellCallOutputOutcomeParamType. - */ - @Generated - public static final FunctionShellCallOutputOutcomeParamType TIMEOUT = fromString("timeout"); - - /** - * Static value exit for FunctionShellCallOutputOutcomeParamType. - */ - @Generated - public static final FunctionShellCallOutputOutcomeParamType EXIT = fromString("exit"); - - /** - * Creates a new instance of FunctionShellCallOutputOutcomeParamType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public FunctionShellCallOutputOutcomeParamType() { - } - - /** - * Creates or finds a FunctionShellCallOutputOutcomeParamType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FunctionShellCallOutputOutcomeParamType. - */ - @Generated - public static FunctionShellCallOutputOutcomeParamType fromString(String name) { - return fromString(name, FunctionShellCallOutputOutcomeParamType.class); - } - - /** - * Gets known FunctionShellCallOutputOutcomeParamType values. - * - * @return known FunctionShellCallOutputOutcomeParamType values. - */ - @Generated - public static Collection values() { - return values(FunctionShellCallOutputOutcomeParamType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputTimeoutOutcomeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputTimeoutOutcomeParam.java deleted file mode 100644 index d27ede95997b..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputTimeoutOutcomeParam.java +++ /dev/null @@ -1,82 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Shell call timeout outcome - * - * Indicates that the shell call exceeded its configured time limit. - */ -@Immutable -public final class FunctionShellCallOutputTimeoutOutcomeParam extends FunctionShellCallOutputOutcomeParam { - - /* - * The type property. - */ - @Generated - private FunctionShellCallOutputOutcomeParamType type = FunctionShellCallOutputOutcomeParamType.TIMEOUT; - - /** - * Creates an instance of FunctionShellCallOutputTimeoutOutcomeParam class. - */ - @Generated - public FunctionShellCallOutputTimeoutOutcomeParam() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public FunctionShellCallOutputOutcomeParamType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionShellCallOutputTimeoutOutcomeParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionShellCallOutputTimeoutOutcomeParam 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 FunctionShellCallOutputTimeoutOutcomeParam. - */ - @Generated - public static FunctionShellCallOutputTimeoutOutcomeParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - FunctionShellCallOutputTimeoutOutcomeParam deserializedFunctionShellCallOutputTimeoutOutcomeParam - = new FunctionShellCallOutputTimeoutOutcomeParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedFunctionShellCallOutputTimeoutOutcomeParam.type - = FunctionShellCallOutputOutcomeParamType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedFunctionShellCallOutputTimeoutOutcomeParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ImageDetail.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ImageDetail.java deleted file mode 100644 index 7046854f4279..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ImageDetail.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for ImageDetail. - */ -public enum ImageDetail { - /** - * Enum value low. - */ - LOW("low"), - - /** - * Enum value high. - */ - HIGH("high"), - - /** - * Enum value auto. - */ - AUTO("auto"); - - /** - * The actual serialized value for a ImageDetail instance. - */ - private final String value; - - ImageDetail(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ImageDetail instance. - * - * @param value the serialized value to parse. - * @return the parsed ImageDetail object, or null if unable to parse. - */ - public static ImageDetail fromString(String value) { - if (value == null) { - return null; - } - ImageDetail[] items = ImageDetail.values(); - for (ImageDetail 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/implementation/models/ImageDetailLevel.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ImageDetailLevel.java deleted file mode 100644 index a6ed6b55269d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ImageDetailLevel.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for ImageDetailLevel. - */ -public enum ImageDetailLevel { - /** - * Enum value low. - */ - LOW("low"), - - /** - * Enum value high. - */ - HIGH("high"), - - /** - * Enum value auto. - */ - AUTO("auto"); - - /** - * The actual serialized value for a ImageDetailLevel instance. - */ - private final String value; - - ImageDetailLevel(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ImageDetailLevel instance. - * - * @param value the serialized value to parse. - * @return the parsed ImageDetailLevel object, or null if unable to parse. - */ - public static ImageDetailLevel fromString(String value) { - if (value == null) { - return null; - } - ImageDetailLevel[] items = ImageDetailLevel.values(); - for (ImageDetailLevel 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/implementation/models/InputContentInputFileContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputFileContent.java deleted file mode 100644 index 8c99e451465d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputFileContent.java +++ /dev/null @@ -1,204 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Input file - * - * A file input to the model. - */ -@Fluent -public final class InputContentInputFileContent extends InputContent { - - /* - * The type property. - */ - @Generated - private InputContentType type = InputContentType.INPUT_FILE; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The name of the file to be sent to the model. - */ - @Generated - private String filename; - - /* - * The URL of the file to be sent to the model. - */ - @Generated - private String fileUrl; - - /* - * The content of the file to be sent to the model. - */ - @Generated - private String fileData; - - /** - * Creates an instance of InputContentInputFileContent class. - */ - @Generated - public InputContentInputFileContent() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputContentType getType() { - return this.type; - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the InputContentInputFileContent object itself. - */ - @Generated - public InputContentInputFileContent setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the filename property: The name of the file to be sent to the model. - * - * @return the filename value. - */ - @Generated - public String getFilename() { - return this.filename; - } - - /** - * Set the filename property: The name of the file to be sent to the model. - * - * @param filename the filename value to set. - * @return the InputContentInputFileContent object itself. - */ - @Generated - public InputContentInputFileContent setFilename(String filename) { - this.filename = filename; - return this; - } - - /** - * Get the fileUrl property: The URL of the file to be sent to the model. - * - * @return the fileUrl value. - */ - @Generated - public String getFileUrl() { - return this.fileUrl; - } - - /** - * Set the fileUrl property: The URL of the file to be sent to the model. - * - * @param fileUrl the fileUrl value to set. - * @return the InputContentInputFileContent object itself. - */ - @Generated - public InputContentInputFileContent setFileUrl(String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * Get the fileData property: The content of the file to be sent to the model. - * - * @return the fileData value. - */ - @Generated - public String getFileData() { - return this.fileData; - } - - /** - * Set the fileData property: The content of the file to be sent to the model. - * - * @param fileData the fileData value to set. - * @return the InputContentInputFileContent object itself. - */ - @Generated - public InputContentInputFileContent setFileData(String fileData) { - this.fileData = fileData; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeStringField("filename", this.filename); - jsonWriter.writeStringField("file_url", this.fileUrl); - jsonWriter.writeStringField("file_data", this.fileData); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputContentInputFileContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputContentInputFileContent 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 InputContentInputFileContent. - */ - @Generated - public static InputContentInputFileContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InputContentInputFileContent deserializedInputContentInputFileContent = new InputContentInputFileContent(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedInputContentInputFileContent.type = InputContentType.fromString(reader.getString()); - } else if ("file_id".equals(fieldName)) { - deserializedInputContentInputFileContent.fileId = reader.getString(); - } else if ("filename".equals(fieldName)) { - deserializedInputContentInputFileContent.filename = reader.getString(); - } else if ("file_url".equals(fieldName)) { - deserializedInputContentInputFileContent.fileUrl = reader.getString(); - } else if ("file_data".equals(fieldName)) { - deserializedInputContentInputFileContent.fileData = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedInputContentInputFileContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputImageContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputImageContent.java deleted file mode 100644 index 3d0677520609..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputImageContent.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Input image - * - * An image input to the model. Learn about [image inputs](/docs/guides/vision). - */ -@Fluent -public final class InputContentInputImageContent extends InputContent { - - /* - * The type property. - */ - @Generated - private InputContentType type = InputContentType.INPUT_IMAGE; - - /* - * The image_url property. - */ - @Generated - private String imageUrl; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - */ - @Generated - private final ImageDetail detail; - - /** - * Creates an instance of InputContentInputImageContent class. - * - * @param detail the detail value to set. - */ - @Generated - public InputContentInputImageContent(ImageDetail detail) { - this.detail = detail; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputContentType getType() { - return this.type; - } - - /** - * Get the imageUrl property: The image_url property. - * - * @return the imageUrl value. - */ - @Generated - public String getImageUrl() { - return this.imageUrl; - } - - /** - * Set the imageUrl property: The image_url property. - * - * @param imageUrl the imageUrl value to set. - * @return the InputContentInputImageContent object itself. - */ - @Generated - public InputContentInputImageContent setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the InputContentInputImageContent object itself. - */ - @Generated - public InputContentInputImageContent setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the detail property: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. - * Defaults to `auto`. - * - * @return the detail value. - */ - @Generated - public ImageDetail getDetail() { - return this.detail; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("detail", this.detail == null ? null : this.detail.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("image_url", this.imageUrl); - jsonWriter.writeStringField("file_id", this.fileId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputContentInputImageContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputContentInputImageContent if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputContentInputImageContent. - */ - @Generated - public static InputContentInputImageContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ImageDetail detail = null; - InputContentType type = InputContentType.INPUT_IMAGE; - String imageUrl = null; - String fileId = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("detail".equals(fieldName)) { - detail = ImageDetail.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = InputContentType.fromString(reader.getString()); - } else if ("image_url".equals(fieldName)) { - imageUrl = reader.getString(); - } else if ("file_id".equals(fieldName)) { - fileId = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputContentInputImageContent deserializedInputContentInputImageContent - = new InputContentInputImageContent(detail); - deserializedInputContentInputImageContent.type = type; - deserializedInputContentInputImageContent.imageUrl = imageUrl; - deserializedInputContentInputImageContent.fileId = fileId; - return deserializedInputContentInputImageContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputTextContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputTextContent.java deleted file mode 100644 index 954126eeba33..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentInputTextContent.java +++ /dev/null @@ -1,107 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Input text - * - * A text input to the model. - */ -@Immutable -public final class InputContentInputTextContent extends InputContent { - - /* - * The type property. - */ - @Generated - private InputContentType type = InputContentType.INPUT_TEXT; - - /* - * The text input to the model. - */ - @Generated - private final String text; - - /** - * Creates an instance of InputContentInputTextContent class. - * - * @param text the text value to set. - */ - @Generated - public InputContentInputTextContent(String text) { - this.text = text; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputContentType getType() { - return this.type; - } - - /** - * Get the text property: The text input to the model. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("text", this.text); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputContentInputTextContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputContentInputTextContent if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputContentInputTextContent. - */ - @Generated - public static InputContentInputTextContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String text = null; - InputContentType type = InputContentType.INPUT_TEXT; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputContentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputContentInputTextContent deserializedInputContentInputTextContent - = new InputContentInputTextContent(text); - deserializedInputContentInputTextContent.type = type; - return deserializedInputContentInputTextContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentType.java deleted file mode 100644 index 08150f869a80..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContentType.java +++ /dev/null @@ -1,63 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for InputContentType. - */ -public final class InputContentType extends ExpandableStringEnum { - - /** - * Static value input_text for InputContentType. - */ - @Generated - public static final InputContentType INPUT_TEXT = fromString("input_text"); - - /** - * Static value input_image for InputContentType. - */ - @Generated - public static final InputContentType INPUT_IMAGE = fromString("input_image"); - - /** - * Static value input_file for InputContentType. - */ - @Generated - public static final InputContentType INPUT_FILE = fromString("input_file"); - - /** - * Creates a new instance of InputContentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public InputContentType() { - } - - /** - * Creates or finds a InputContentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InputContentType. - */ - @Generated - public static InputContentType fromString(String name) { - return fromString(name, InputContentType.class); - } - - /** - * Gets known InputContentType values. - * - * @return known InputContentType values. - */ - @Generated - public static Collection values() { - return values(InputContentType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputFileContentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputFileContentParam.java deleted file mode 100644 index 014a3d6a026e..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputFileContentParam.java +++ /dev/null @@ -1,203 +0,0 @@ -// 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.implementation.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; - -/** - * Input file - * - * A file input to the model. - */ -@Fluent -public final class InputFileContentParam implements JsonSerializable { - - /* - * The type of the input item. Always `input_file`. - */ - @Generated - private final String type = "input_file"; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The filename property. - */ - @Generated - private String filename; - - /* - * The file_data property. - */ - @Generated - private String fileData; - - /* - * The file_url property. - */ - @Generated - private String fileUrl; - - /** - * Creates an instance of InputFileContentParam class. - */ - @Generated - public InputFileContentParam() { - } - - /** - * Get the type property: The type of the input item. Always `input_file`. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the InputFileContentParam object itself. - */ - @Generated - public InputFileContentParam setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the filename property: The filename property. - * - * @return the filename value. - */ - @Generated - public String getFilename() { - return this.filename; - } - - /** - * Set the filename property: The filename property. - * - * @param filename the filename value to set. - * @return the InputFileContentParam object itself. - */ - @Generated - public InputFileContentParam setFilename(String filename) { - this.filename = filename; - return this; - } - - /** - * Get the fileData property: The file_data property. - * - * @return the fileData value. - */ - @Generated - public String getFileData() { - return this.fileData; - } - - /** - * Set the fileData property: The file_data property. - * - * @param fileData the fileData value to set. - * @return the InputFileContentParam object itself. - */ - @Generated - public InputFileContentParam setFileData(String fileData) { - this.fileData = fileData; - return this; - } - - /** - * Get the fileUrl property: The file_url property. - * - * @return the fileUrl value. - */ - @Generated - public String getFileUrl() { - return this.fileUrl; - } - - /** - * Set the fileUrl property: The file_url property. - * - * @param fileUrl the fileUrl value to set. - * @return the InputFileContentParam object itself. - */ - @Generated - public InputFileContentParam setFileUrl(String fileUrl) { - this.fileUrl = fileUrl; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeStringField("filename", this.filename); - jsonWriter.writeStringField("file_data", this.fileData); - jsonWriter.writeStringField("file_url", this.fileUrl); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputFileContentParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputFileContentParam if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputFileContentParam. - */ - @Generated - public static InputFileContentParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InputFileContentParam deserializedInputFileContentParam = new InputFileContentParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("file_id".equals(fieldName)) { - deserializedInputFileContentParam.fileId = reader.getString(); - } else if ("filename".equals(fieldName)) { - deserializedInputFileContentParam.filename = reader.getString(); - } else if ("file_data".equals(fieldName)) { - deserializedInputFileContentParam.fileData = reader.getString(); - } else if ("file_url".equals(fieldName)) { - deserializedInputFileContentParam.fileUrl = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedInputFileContentParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputImageContentParamAutoParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputImageContentParamAutoParam.java deleted file mode 100644 index cbb9b6500b18..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputImageContentParamAutoParam.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.implementation.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; - -/** - * Input image - * - * An image input to the model. Learn about [image inputs](/docs/guides/vision). - */ -@Fluent -public final class InputImageContentParamAutoParam implements JsonSerializable { - - /* - * The type of the input item. Always `input_image`. - */ - @Generated - private final String type = "input_image"; - - /* - * The image_url property. - */ - @Generated - private String imageUrl; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /* - * The detail property. - */ - @Generated - private ImageDetailLevel detail; - - /** - * Creates an instance of InputImageContentParamAutoParam class. - */ - @Generated - public InputImageContentParamAutoParam() { - } - - /** - * Get the type property: The type of the input item. Always `input_image`. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the imageUrl property: The image_url property. - * - * @return the imageUrl value. - */ - @Generated - public String getImageUrl() { - return this.imageUrl; - } - - /** - * Set the imageUrl property: The image_url property. - * - * @param imageUrl the imageUrl value to set. - * @return the InputImageContentParamAutoParam object itself. - */ - @Generated - public InputImageContentParamAutoParam setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - return this; - } - - /** - * Get the fileId property: The file_id property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The file_id property. - * - * @param fileId the fileId value to set. - * @return the InputImageContentParamAutoParam object itself. - */ - @Generated - public InputImageContentParamAutoParam setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the detail property: The detail property. - * - * @return the detail value. - */ - @Generated - public ImageDetailLevel getDetail() { - return this.detail; - } - - /** - * Set the detail property: The detail property. - * - * @param detail the detail value to set. - * @return the InputImageContentParamAutoParam object itself. - */ - @Generated - public InputImageContentParamAutoParam setDetail(ImageDetailLevel detail) { - this.detail = detail; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("image_url", this.imageUrl); - jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeStringField("detail", this.detail == null ? null : this.detail.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputImageContentParamAutoParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputImageContentParamAutoParam if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputImageContentParamAutoParam. - */ - @Generated - public static InputImageContentParamAutoParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InputImageContentParamAutoParam deserializedInputImageContentParamAutoParam - = new InputImageContentParamAutoParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("image_url".equals(fieldName)) { - deserializedInputImageContentParamAutoParam.imageUrl = reader.getString(); - } else if ("file_id".equals(fieldName)) { - deserializedInputImageContentParamAutoParam.fileId = reader.getString(); - } else if ("detail".equals(fieldName)) { - deserializedInputImageContentParamAutoParam.detail - = ImageDetailLevel.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedInputImageContentParamAutoParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItem.java deleted file mode 100644 index 16801c80b3be..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItem.java +++ /dev/null @@ -1,155 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An item representing part of the context for the response to be - * generated by the model. Can contain text, images, and audio inputs, - * as well as previous assistant responses and tool call outputs. - */ -@Immutable -public class InputItem implements JsonSerializable { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.fromString("InputItem"); - - /** - * Creates an instance of InputItem class. - */ - @Generated - public InputItem() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - public InputItemType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItem 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 InputItem. - */ - @Generated - public static InputItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String discriminatorValue = null; - try (JsonReader readerToUse = reader.bufferObject()) { - // Prepare for reading - readerToUse.nextToken(); - while (readerToUse.nextToken() != JsonToken.END_OBJECT) { - String fieldName = readerToUse.getFieldName(); - readerToUse.nextToken(); - if ("type".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("message".equals(discriminatorValue)) { - return EasyInputMessage.fromJson(readerToUse.reset()); - } else if ("item_reference".equals(discriminatorValue)) { - return ItemReferenceParam.fromJson(readerToUse.reset()); - } else if ("output_message".equals(discriminatorValue)) { - return InputItemOutputMessage.fromJson(readerToUse.reset()); - } else if ("file_search_call".equals(discriminatorValue)) { - return InputItemFileSearchToolCall.fromJson(readerToUse.reset()); - } else if ("computer_call".equals(discriminatorValue)) { - return InputItemComputerToolCall.fromJson(readerToUse.reset()); - } else if ("computer_call_output".equals(discriminatorValue)) { - return InputItemComputerCallOutputItemParam.fromJson(readerToUse.reset()); - } else if ("web_search_call".equals(discriminatorValue)) { - return InputItemWebSearchToolCall.fromJson(readerToUse.reset()); - } else if ("function_call".equals(discriminatorValue)) { - return InputItemFunctionToolCall.fromJson(readerToUse.reset()); - } else if ("function_call_output".equals(discriminatorValue)) { - return InputItemFunctionCallOutputItemParam.fromJson(readerToUse.reset()); - } else if ("reasoning".equals(discriminatorValue)) { - return InputItemReasoningItem.fromJson(readerToUse.reset()); - } else if ("compaction".equals(discriminatorValue)) { - return InputItemCompactionSummaryItemParam.fromJson(readerToUse.reset()); - } else if ("image_generation_call".equals(discriminatorValue)) { - return InputItemImageGenToolCall.fromJson(readerToUse.reset()); - } else if ("code_interpreter_call".equals(discriminatorValue)) { - return InputItemCodeInterpreterToolCall.fromJson(readerToUse.reset()); - } else if ("local_shell_call".equals(discriminatorValue)) { - return InputItemLocalShellToolCall.fromJson(readerToUse.reset()); - } else if ("local_shell_call_output".equals(discriminatorValue)) { - return InputItemLocalShellToolCallOutput.fromJson(readerToUse.reset()); - } else if ("shell_call".equals(discriminatorValue)) { - return InputItemFunctionShellCallItemParam.fromJson(readerToUse.reset()); - } else if ("shell_call_output".equals(discriminatorValue)) { - return InputItemFunctionShellCallOutputItemParam.fromJson(readerToUse.reset()); - } else if ("apply_patch_call".equals(discriminatorValue)) { - return InputItemApplyPatchToolCallItemParam.fromJson(readerToUse.reset()); - } else if ("apply_patch_call_output".equals(discriminatorValue)) { - return InputItemApplyPatchToolCallOutputItemParam.fromJson(readerToUse.reset()); - } else if ("mcp_list_tools".equals(discriminatorValue)) { - return InputItemMcpListTools.fromJson(readerToUse.reset()); - } else if ("mcp_approval_request".equals(discriminatorValue)) { - return InputItemMcpApprovalRequest.fromJson(readerToUse.reset()); - } else if ("mcp_approval_response".equals(discriminatorValue)) { - return InputItemMcpApprovalResponse.fromJson(readerToUse.reset()); - } else if ("mcp_call".equals(discriminatorValue)) { - return InputItemMcpToolCall.fromJson(readerToUse.reset()); - } else if ("custom_tool_call_output".equals(discriminatorValue)) { - return InputItemCustomToolCallOutput.fromJson(readerToUse.reset()); - } else if ("custom_tool_call".equals(discriminatorValue)) { - return InputItemCustomToolCall.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static InputItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InputItem deserializedInputItem = new InputItem(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedInputItem.type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedInputItem; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallItemParam.java deleted file mode 100644 index 6811bcb03a7c..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallItemParam.java +++ /dev/null @@ -1,185 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Apply patch tool call - * - * A tool call representing a request to create, delete, or update files using diff patches. - */ -@Fluent -public final class InputItemApplyPatchToolCallItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.APPLY_PATCH_CALL; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The unique ID of the apply patch tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * The status of the apply patch tool call. One of `in_progress` or `completed`. - */ - @Generated - private final ApplyPatchCallStatusParam status; - - /* - * The specific create, delete, or update instruction for the apply_patch tool call. - */ - @Generated - private final ApplyPatchOperationParam operation; - - /** - * Creates an instance of InputItemApplyPatchToolCallItemParam class. - * - * @param callId the callId value to set. - * @param status the status value to set. - * @param operation the operation value to set. - */ - @Generated - public InputItemApplyPatchToolCallItemParam(String callId, ApplyPatchCallStatusParam status, - ApplyPatchOperationParam operation) { - this.callId = callId; - this.status = status; - this.operation = operation; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemApplyPatchToolCallItemParam object itself. - */ - @Generated - public InputItemApplyPatchToolCallItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The unique ID of the apply patch tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the status property: The status of the apply patch tool call. One of `in_progress` or `completed`. - * - * @return the status value. - */ - @Generated - public ApplyPatchCallStatusParam getStatus() { - return this.status; - } - - /** - * Get the operation property: The specific create, delete, or update instruction for the apply_patch tool call. - * - * @return the operation value. - */ - @Generated - public ApplyPatchOperationParam getOperation() { - return this.operation; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("operation", this.operation); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemApplyPatchToolCallItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemApplyPatchToolCallItemParam if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemApplyPatchToolCallItemParam. - */ - @Generated - public static InputItemApplyPatchToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - ApplyPatchCallStatusParam status = null; - ApplyPatchOperationParam operation = null; - InputItemType type = InputItemType.APPLY_PATCH_CALL; - String id = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("status".equals(fieldName)) { - status = ApplyPatchCallStatusParam.fromString(reader.getString()); - } else if ("operation".equals(fieldName)) { - operation = ApplyPatchOperationParam.fromJson(reader); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemApplyPatchToolCallItemParam deserializedInputItemApplyPatchToolCallItemParam - = new InputItemApplyPatchToolCallItemParam(callId, status, operation); - deserializedInputItemApplyPatchToolCallItemParam.type = type; - deserializedInputItemApplyPatchToolCallItemParam.id = id; - return deserializedInputItemApplyPatchToolCallItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallOutputItemParam.java deleted file mode 100644 index 40f7f29c7682..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallOutputItemParam.java +++ /dev/null @@ -1,195 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Apply patch tool call output - * - * The streamed output emitted by an apply patch tool call. - */ -@Fluent -public final class InputItemApplyPatchToolCallOutputItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.APPLY_PATCH_CALL_OUTPUT; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The unique ID of the apply patch tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * The status of the apply patch tool call output. One of `completed` or `failed`. - */ - @Generated - private final ApplyPatchCallOutputStatusParam status; - - /* - * The output property. - */ - @Generated - private String output; - - /** - * Creates an instance of InputItemApplyPatchToolCallOutputItemParam class. - * - * @param callId the callId value to set. - * @param status the status value to set. - */ - @Generated - public InputItemApplyPatchToolCallOutputItemParam(String callId, ApplyPatchCallOutputStatusParam status) { - this.callId = callId; - this.status = status; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemApplyPatchToolCallOutputItemParam object itself. - */ - @Generated - public InputItemApplyPatchToolCallOutputItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The unique ID of the apply patch tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the status property: The status of the apply patch tool call output. One of `completed` or `failed`. - * - * @return the status value. - */ - @Generated - public ApplyPatchCallOutputStatusParam getStatus() { - return this.status; - } - - /** - * Get the output property: The output property. - * - * @return the output value. - */ - @Generated - public String getOutput() { - return this.output; - } - - /** - * Set the output property: The output property. - * - * @param output the output value to set. - * @return the InputItemApplyPatchToolCallOutputItemParam object itself. - */ - @Generated - public InputItemApplyPatchToolCallOutputItemParam setOutput(String output) { - this.output = output; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("output", this.output); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemApplyPatchToolCallOutputItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemApplyPatchToolCallOutputItemParam if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemApplyPatchToolCallOutputItemParam. - */ - @Generated - public static InputItemApplyPatchToolCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - ApplyPatchCallOutputStatusParam status = null; - InputItemType type = InputItemType.APPLY_PATCH_CALL_OUTPUT; - String id = null; - String output = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("status".equals(fieldName)) { - status = ApplyPatchCallOutputStatusParam.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("output".equals(fieldName)) { - output = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemApplyPatchToolCallOutputItemParam deserializedInputItemApplyPatchToolCallOutputItemParam - = new InputItemApplyPatchToolCallOutputItemParam(callId, status); - deserializedInputItemApplyPatchToolCallOutputItemParam.type = type; - deserializedInputItemApplyPatchToolCallOutputItemParam.id = id; - deserializedInputItemApplyPatchToolCallOutputItemParam.output = output; - return deserializedInputItemApplyPatchToolCallOutputItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCall.java deleted file mode 100644 index e9532673c174..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCall.java +++ /dev/null @@ -1,207 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Code interpreter tool call - * - * A tool call to run code. - */ -@Immutable -public final class InputItemCodeInterpreterToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.CODE_INTERPRETER_CALL; - - /* - * The unique ID of the code interpreter tool call. - */ - @Generated - private final String id; - - /* - * The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, - * `interpreting`, and `failed`. - */ - @Generated - private final InputItemCodeInterpreterToolCallStatus status; - - /* - * The ID of the container used to run the code. - */ - @Generated - private final String containerId; - - /* - * The code property. - */ - @Generated - private final String code; - - /* - * The outputs property. - */ - @Generated - private final List outputs; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the code interpreter tool call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the code interpreter tool call. Valid values are `in_progress`, - * `completed`, `incomplete`, `interpreting`, and `failed`. - * - * @return the status value. - */ - @Generated - public InputItemCodeInterpreterToolCallStatus getStatus() { - return this.status; - } - - /** - * Get the containerId property: The ID of the container used to run the code. - * - * @return the containerId value. - */ - @Generated - public String getContainerId() { - return this.containerId; - } - - /** - * Get the code property: The code property. - * - * @return the code value. - */ - @Generated - public String getCode() { - return this.code; - } - - /** - * Get the outputs property: The outputs property. - * - * @return the outputs value. - */ - @Generated - public List getOutputs() { - return this.outputs; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("container_id", this.containerId); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeArrayField("outputs", this.outputs, (writer, element) -> { - if (element == null) { - writer.writeNull(); - } else { - element.writeTo(writer); - } - }); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemCodeInterpreterToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemCodeInterpreterToolCall if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemCodeInterpreterToolCall. - */ - @Generated - public static InputItemCodeInterpreterToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - InputItemCodeInterpreterToolCallStatus status = null; - String containerId = null; - String code = null; - List outputs = null; - InputItemType type = InputItemType.CODE_INTERPRETER_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = InputItemCodeInterpreterToolCallStatus.fromString(reader.getString()); - } else if ("container_id".equals(fieldName)) { - containerId = reader.getString(); - } else if ("code".equals(fieldName)) { - code = reader.getString(); - } else if ("outputs".equals(fieldName)) { - outputs = reader.readArray(reader1 -> reader1 - .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemCodeInterpreterToolCall deserializedInputItemCodeInterpreterToolCall - = new InputItemCodeInterpreterToolCall(id, status, containerId, code, outputs); - deserializedInputItemCodeInterpreterToolCall.type = type; - return deserializedInputItemCodeInterpreterToolCall; - }); - } - - /** - * Creates an instance of InputItemCodeInterpreterToolCall class. - * - * @param id the id value to set. - * @param status the status value to set. - * @param containerId the containerId value to set. - * @param code the code value to set. - * @param outputs the outputs value to set. - */ - @Generated - public InputItemCodeInterpreterToolCall(String id, InputItemCodeInterpreterToolCallStatus status, - String containerId, String code, List outputs) { - this.id = id; - this.status = status; - this.containerId = containerId; - this.code = code; - this.outputs = outputs; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCallStatus.java deleted file mode 100644 index e14fdd1a1d57..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCallStatus.java +++ /dev/null @@ -1,71 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemCodeInterpreterToolCallStatus. - */ -public enum InputItemCodeInterpreterToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"), - - /** - * Enum value interpreting. - */ - INTERPRETING("interpreting"), - - /** - * Enum value failed. - */ - FAILED("failed"); - - /** - * The actual serialized value for a InputItemCodeInterpreterToolCallStatus instance. - */ - private final String value; - - InputItemCodeInterpreterToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemCodeInterpreterToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemCodeInterpreterToolCallStatus object, or null if unable to parse. - */ - public static InputItemCodeInterpreterToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemCodeInterpreterToolCallStatus[] items = InputItemCodeInterpreterToolCallStatus.values(); - for (InputItemCodeInterpreterToolCallStatus 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/implementation/models/InputItemCompactionSummaryItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCompactionSummaryItemParam.java deleted file mode 100644 index 6cb22f707a4d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCompactionSummaryItemParam.java +++ /dev/null @@ -1,140 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Compaction item - * - * A compaction item generated by the [`v1/responses/compact` API](/docs/api-reference/responses/compact). - */ -@Fluent -public final class InputItemCompactionSummaryItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.COMPACTION; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The encrypted content of the compaction summary. - */ - @Generated - private final String encryptedContent; - - /** - * Creates an instance of InputItemCompactionSummaryItemParam class. - * - * @param encryptedContent the encryptedContent value to set. - */ - @Generated - public InputItemCompactionSummaryItemParam(String encryptedContent) { - this.encryptedContent = encryptedContent; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemCompactionSummaryItemParam object itself. - */ - @Generated - public InputItemCompactionSummaryItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the encryptedContent property: The encrypted content of the compaction summary. - * - * @return the encryptedContent value. - */ - @Generated - public String getEncryptedContent() { - return this.encryptedContent; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("encrypted_content", this.encryptedContent); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemCompactionSummaryItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemCompactionSummaryItemParam if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemCompactionSummaryItemParam. - */ - @Generated - public static InputItemCompactionSummaryItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String encryptedContent = null; - InputItemType type = InputItemType.COMPACTION; - String id = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("encrypted_content".equals(fieldName)) { - encryptedContent = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemCompactionSummaryItemParam deserializedInputItemCompactionSummaryItemParam - = new InputItemCompactionSummaryItemParam(encryptedContent); - deserializedInputItemCompactionSummaryItemParam.type = type; - deserializedInputItemCompactionSummaryItemParam.id = id; - return deserializedInputItemCompactionSummaryItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerCallOutputItemParam.java deleted file mode 100644 index 5f6e7cf0de01..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerCallOutputItemParam.java +++ /dev/null @@ -1,232 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Computer tool call output - * - * The output of a computer tool call. - */ -@Fluent -public final class InputItemComputerCallOutputItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.COMPUTER_CALL_OUTPUT; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The ID of the computer tool call that produced the output. - */ - @Generated - private final String callId; - - /* - * The output property. - */ - @Generated - private final ComputerScreenshotImage output; - - /* - * The acknowledged_safety_checks property. - */ - @Generated - private List acknowledgedSafetyChecks; - - /* - * The status property. - */ - @Generated - private FunctionCallItemStatus status; - - /** - * Creates an instance of InputItemComputerCallOutputItemParam class. - * - * @param callId the callId value to set. - * @param output the output value to set. - */ - @Generated - public InputItemComputerCallOutputItemParam(String callId, ComputerScreenshotImage output) { - this.callId = callId; - this.output = output; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemComputerCallOutputItemParam object itself. - */ - @Generated - public InputItemComputerCallOutputItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The ID of the computer tool call that produced the output. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the output property: The output property. - * - * @return the output value. - */ - @Generated - public ComputerScreenshotImage getOutput() { - return this.output; - } - - /** - * Get the acknowledgedSafetyChecks property: The acknowledged_safety_checks property. - * - * @return the acknowledgedSafetyChecks value. - */ - @Generated - public List getAcknowledgedSafetyChecks() { - return this.acknowledgedSafetyChecks; - } - - /** - * Set the acknowledgedSafetyChecks property: The acknowledged_safety_checks property. - * - * @param acknowledgedSafetyChecks the acknowledgedSafetyChecks value to set. - * @return the InputItemComputerCallOutputItemParam object itself. - */ - @Generated - public InputItemComputerCallOutputItemParam - setAcknowledgedSafetyChecks(List acknowledgedSafetyChecks) { - this.acknowledgedSafetyChecks = acknowledgedSafetyChecks; - return this; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - @Generated - public FunctionCallItemStatus getStatus() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the InputItemComputerCallOutputItemParam object itself. - */ - @Generated - public InputItemComputerCallOutputItemParam setStatus(FunctionCallItemStatus status) { - this.status = status; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeJsonField("output", this.output); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeArrayField("acknowledged_safety_checks", this.acknowledgedSafetyChecks, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemComputerCallOutputItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemComputerCallOutputItemParam if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemComputerCallOutputItemParam. - */ - @Generated - public static InputItemComputerCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - ComputerScreenshotImage output = null; - InputItemType type = InputItemType.COMPUTER_CALL_OUTPUT; - String id = null; - List acknowledgedSafetyChecks = null; - FunctionCallItemStatus status = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("output".equals(fieldName)) { - output = ComputerScreenshotImage.fromJson(reader); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("acknowledged_safety_checks".equals(fieldName)) { - acknowledgedSafetyChecks - = reader.readArray(reader1 -> ComputerCallSafetyCheckParam.fromJson(reader1)); - } else if ("status".equals(fieldName)) { - status = FunctionCallItemStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemComputerCallOutputItemParam deserializedInputItemComputerCallOutputItemParam - = new InputItemComputerCallOutputItemParam(callId, output); - deserializedInputItemComputerCallOutputItemParam.type = type; - deserializedInputItemComputerCallOutputItemParam.id = id; - deserializedInputItemComputerCallOutputItemParam.acknowledgedSafetyChecks = acknowledgedSafetyChecks; - deserializedInputItemComputerCallOutputItemParam.status = status; - return deserializedInputItemComputerCallOutputItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCall.java deleted file mode 100644 index f25ef0f0c52a..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCall.java +++ /dev/null @@ -1,201 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Computer tool call - * - * A tool call to a computer use tool. See the - * [computer use guide](/docs/guides/tools-computer-use) for more information. - */ -@Immutable -public final class InputItemComputerToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.COMPUTER_CALL; - - /* - * The unique ID of the computer call. - */ - @Generated - private final String id; - - /* - * An identifier used when responding to the tool call with output. - */ - @Generated - private final String callId; - - /* - * The action property. - */ - @Generated - private final ComputerAction action; - - /* - * The pending safety checks for the computer call. - */ - @Generated - private final List pendingSafetyChecks; - - /* - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - */ - @Generated - private final InputItemComputerToolCallStatus status; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the computer call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the callId property: An identifier used when responding to the tool call with output. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the action property: The action property. - * - * @return the action value. - */ - @Generated - public ComputerAction getAction() { - return this.action; - } - - /** - * Get the pendingSafetyChecks property: The pending safety checks for the computer call. - * - * @return the pendingSafetyChecks value. - */ - @Generated - public List getPendingSafetyChecks() { - return this.pendingSafetyChecks; - } - - /** - * Get the status property: The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @return the status value. - */ - @Generated - public InputItemComputerToolCallStatus getStatus() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeJsonField("action", this.action); - jsonWriter.writeArrayField("pending_safety_checks", this.pendingSafetyChecks, - (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemComputerToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemComputerToolCall if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemComputerToolCall. - */ - @Generated - public static InputItemComputerToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String callId = null; - ComputerAction action = null; - List pendingSafetyChecks = null; - InputItemComputerToolCallStatus status = null; - InputItemType type = InputItemType.COMPUTER_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("action".equals(fieldName)) { - action = ComputerAction.fromJson(reader); - } else if ("pending_safety_checks".equals(fieldName)) { - pendingSafetyChecks = reader.readArray(reader1 -> ComputerCallSafetyCheckParam.fromJson(reader1)); - } else if ("status".equals(fieldName)) { - status = InputItemComputerToolCallStatus.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemComputerToolCall deserializedInputItemComputerToolCall - = new InputItemComputerToolCall(id, callId, action, pendingSafetyChecks, status); - deserializedInputItemComputerToolCall.type = type; - return deserializedInputItemComputerToolCall; - }); - } - - /** - * Creates an instance of InputItemComputerToolCall class. - * - * @param id the id value to set. - * @param callId the callId value to set. - * @param action the action value to set. - * @param pendingSafetyChecks the pendingSafetyChecks value to set. - * @param status the status value to set. - */ - @Generated - public InputItemComputerToolCall(String id, String callId, ComputerAction action, - List pendingSafetyChecks, InputItemComputerToolCallStatus status) { - this.id = id; - this.callId = callId; - this.action = action; - this.pendingSafetyChecks = pendingSafetyChecks; - this.status = status; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCallStatus.java deleted file mode 100644 index dc2b3e7379ae..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCallStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemComputerToolCallStatus. - */ -public enum InputItemComputerToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a InputItemComputerToolCallStatus instance. - */ - private final String value; - - InputItemComputerToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemComputerToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemComputerToolCallStatus object, or null if unable to parse. - */ - public static InputItemComputerToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemComputerToolCallStatus[] items = InputItemComputerToolCallStatus.values(); - for (InputItemComputerToolCallStatus 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/implementation/models/InputItemCustomToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCall.java deleted file mode 100644 index 6730eb0e9384..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCall.java +++ /dev/null @@ -1,184 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Custom tool call - * - * A call to a custom tool created by the model. - */ -@Fluent -public final class InputItemCustomToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.CUSTOM_TOOL_CALL; - - /* - * The unique ID of the custom tool call in the OpenAI platform. - */ - @Generated - private String id; - - /* - * An identifier used to map this custom tool call to a tool call output. - */ - @Generated - private final String callId; - - /* - * The name of the custom tool being called. - */ - @Generated - private final String name; - - /* - * The input for the custom tool call generated by the model. - */ - @Generated - private final String input; - - /** - * Creates an instance of InputItemCustomToolCall class. - * - * @param callId the callId value to set. - * @param name the name value to set. - * @param input the input value to set. - */ - @Generated - public InputItemCustomToolCall(String callId, String name, String input) { - this.callId = callId; - this.name = name; - this.input = input; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the custom tool call in the OpenAI platform. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The unique ID of the custom tool call in the OpenAI platform. - * - * @param id the id value to set. - * @return the InputItemCustomToolCall object itself. - */ - @Generated - public InputItemCustomToolCall setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: An identifier used to map this custom tool call to a tool call output. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the name property: The name of the custom tool being called. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the input property: The input for the custom tool call generated by the model. - * - * @return the input value. - */ - @Generated - public String getInput() { - return this.input; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("input", this.input); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemCustomToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemCustomToolCall if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemCustomToolCall. - */ - @Generated - public static InputItemCustomToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - String name = null; - String input = null; - InputItemType type = InputItemType.CUSTOM_TOOL_CALL; - String id = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("input".equals(fieldName)) { - input = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemCustomToolCall deserializedInputItemCustomToolCall - = new InputItemCustomToolCall(callId, name, input); - deserializedInputItemCustomToolCall.type = type; - deserializedInputItemCustomToolCall.id = id; - return deserializedInputItemCustomToolCall; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCall.java deleted file mode 100644 index 86ad8d7e2caf..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCall.java +++ /dev/null @@ -1,188 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * File search tool call - * - * The results of a file search tool call. See the - * [file search guide](/docs/guides/tools-file-search) for more information. - */ -@Fluent -public final class InputItemFileSearchToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.FILE_SEARCH_CALL; - - /* - * The unique ID of the file search tool call. - */ - @Generated - private final String id; - - /* - * The status of the file search tool call. One of `in_progress`, - * `searching`, `incomplete` or `failed`, - */ - @Generated - private final InputItemFileSearchToolCallStatus status; - - /* - * The queries used to search for files. - */ - @Generated - private final List queries; - - /* - * The results property. - */ - @Generated - private List results; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the file search tool call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the file search tool call. One of `in_progress`, - * `searching`, `incomplete` or `failed`,. - * - * @return the status value. - */ - @Generated - public InputItemFileSearchToolCallStatus getStatus() { - return this.status; - } - - /** - * Get the queries property: The queries used to search for files. - * - * @return the queries value. - */ - @Generated - public List getQueries() { - return this.queries; - } - - /** - * Get the results property: The results property. - * - * @return the results value. - */ - @Generated - public List getResults() { - return this.results; - } - - /** - * Set the results property: The results property. - * - * @param results the results value to set. - * @return the InputItemFileSearchToolCall object itself. - */ - @Generated - public InputItemFileSearchToolCall setResults(List results) { - this.results = results; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeArrayField("queries", this.queries, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemFileSearchToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemFileSearchToolCall if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemFileSearchToolCall. - */ - @Generated - public static InputItemFileSearchToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - InputItemFileSearchToolCallStatus status = null; - List queries = null; - InputItemType type = InputItemType.FILE_SEARCH_CALL; - List results = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = InputItemFileSearchToolCallStatus.fromString(reader.getString()); - } else if ("queries".equals(fieldName)) { - queries = reader.readArray(reader1 -> reader1.getString()); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("results".equals(fieldName)) { - results = reader.readArray(reader1 -> FileSearchToolCallResults.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - InputItemFileSearchToolCall deserializedInputItemFileSearchToolCall - = new InputItemFileSearchToolCall(id, status, queries); - deserializedInputItemFileSearchToolCall.type = type; - deserializedInputItemFileSearchToolCall.results = results; - return deserializedInputItemFileSearchToolCall; - }); - } - - /** - * Creates an instance of InputItemFileSearchToolCall class. - * - * @param id the id value to set. - * @param status the status value to set. - * @param queries the queries value to set. - */ - @Generated - public InputItemFileSearchToolCall(String id, InputItemFileSearchToolCallStatus status, List queries) { - this.id = id; - this.status = status; - this.queries = queries; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCallStatus.java deleted file mode 100644 index cb53bd4a8a88..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCallStatus.java +++ /dev/null @@ -1,71 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemFileSearchToolCallStatus. - */ -public enum InputItemFileSearchToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value searching. - */ - SEARCHING("searching"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"), - - /** - * Enum value failed. - */ - FAILED("failed"); - - /** - * The actual serialized value for a InputItemFileSearchToolCallStatus instance. - */ - private final String value; - - InputItemFileSearchToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemFileSearchToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemFileSearchToolCallStatus object, or null if unable to parse. - */ - public static InputItemFileSearchToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemFileSearchToolCallStatus[] items = InputItemFileSearchToolCallStatus.values(); - for (InputItemFileSearchToolCallStatus 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/implementation/models/InputItemFunctionCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionCallOutputItemParam.java deleted file mode 100644 index 92bdda7e7d19..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionCallOutputItemParam.java +++ /dev/null @@ -1,197 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Function tool call output - * - * The output of a function tool call. - */ -@Fluent -public final class InputItemFunctionCallOutputItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.FUNCTION_CALL_OUTPUT; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The unique ID of the function tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * Text, image, or file output of the function tool call. - */ - @Generated - private final BinaryData output; - - /* - * The status property. - */ - @Generated - private FunctionCallItemStatus status; - - /** - * Creates an instance of InputItemFunctionCallOutputItemParam class. - * - * @param callId the callId value to set. - * @param output the output value to set. - */ - @Generated - public InputItemFunctionCallOutputItemParam(String callId, BinaryData output) { - this.callId = callId; - this.output = output; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemFunctionCallOutputItemParam object itself. - */ - @Generated - public InputItemFunctionCallOutputItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The unique ID of the function tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the output property: Text, image, or file output of the function tool call. - * - * @return the output value. - */ - @Generated - public BinaryData getOutput() { - return this.output; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - @Generated - public FunctionCallItemStatus getStatus() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the InputItemFunctionCallOutputItemParam object itself. - */ - @Generated - public InputItemFunctionCallOutputItemParam setStatus(FunctionCallItemStatus status) { - this.status = status; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeFieldName("output"); - this.output.writeTo(jsonWriter); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemFunctionCallOutputItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemFunctionCallOutputItemParam if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemFunctionCallOutputItemParam. - */ - @Generated - public static InputItemFunctionCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - BinaryData output = null; - InputItemType type = InputItemType.FUNCTION_CALL_OUTPUT; - String id = null; - FunctionCallItemStatus status = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("output".equals(fieldName)) { - output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = FunctionCallItemStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemFunctionCallOutputItemParam deserializedInputItemFunctionCallOutputItemParam - = new InputItemFunctionCallOutputItemParam(callId, output); - deserializedInputItemFunctionCallOutputItemParam.type = type; - deserializedInputItemFunctionCallOutputItemParam.id = id; - deserializedInputItemFunctionCallOutputItemParam.status = status; - return deserializedInputItemFunctionCallOutputItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallItemParam.java deleted file mode 100644 index afc65cfe8fab..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallItemParam.java +++ /dev/null @@ -1,228 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Shell tool call - * - * A tool representing a request to execute one or more shell commands. - */ -@Fluent -public final class InputItemFunctionShellCallItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.SHELL_CALL; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The unique ID of the shell tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * The shell commands and limits that describe how to run the tool call. - */ - @Generated - private final FunctionShellActionParam action; - - /* - * The status property. - */ - @Generated - private FunctionShellCallItemStatus status; - - /* - * The environment property. - */ - @Generated - private FunctionShellCallItemParamEnvironment environment; - - /** - * Creates an instance of InputItemFunctionShellCallItemParam class. - * - * @param callId the callId value to set. - * @param action the action value to set. - */ - @Generated - public InputItemFunctionShellCallItemParam(String callId, FunctionShellActionParam action) { - this.callId = callId; - this.action = action; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemFunctionShellCallItemParam object itself. - */ - @Generated - public InputItemFunctionShellCallItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The unique ID of the shell tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the action property: The shell commands and limits that describe how to run the tool call. - * - * @return the action value. - */ - @Generated - public FunctionShellActionParam getAction() { - return this.action; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - @Generated - public FunctionShellCallItemStatus getStatus() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the InputItemFunctionShellCallItemParam object itself. - */ - @Generated - public InputItemFunctionShellCallItemParam setStatus(FunctionShellCallItemStatus status) { - this.status = status; - return this; - } - - /** - * Get the environment property: The environment property. - * - * @return the environment value. - */ - @Generated - public FunctionShellCallItemParamEnvironment getEnvironment() { - return this.environment; - } - - /** - * Set the environment property: The environment property. - * - * @param environment the environment value to set. - * @return the InputItemFunctionShellCallItemParam object itself. - */ - @Generated - public InputItemFunctionShellCallItemParam setEnvironment(FunctionShellCallItemParamEnvironment environment) { - this.environment = environment; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeJsonField("action", this.action); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeJsonField("environment", this.environment); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemFunctionShellCallItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemFunctionShellCallItemParam if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemFunctionShellCallItemParam. - */ - @Generated - public static InputItemFunctionShellCallItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - FunctionShellActionParam action = null; - InputItemType type = InputItemType.SHELL_CALL; - String id = null; - FunctionShellCallItemStatus status = null; - FunctionShellCallItemParamEnvironment environment = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("action".equals(fieldName)) { - action = FunctionShellActionParam.fromJson(reader); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = FunctionShellCallItemStatus.fromString(reader.getString()); - } else if ("environment".equals(fieldName)) { - environment = FunctionShellCallItemParamEnvironment.fromJson(reader); - } else { - reader.skipChildren(); - } - } - InputItemFunctionShellCallItemParam deserializedInputItemFunctionShellCallItemParam - = new InputItemFunctionShellCallItemParam(callId, action); - deserializedInputItemFunctionShellCallItemParam.type = type; - deserializedInputItemFunctionShellCallItemParam.id = id; - deserializedInputItemFunctionShellCallItemParam.status = status; - deserializedInputItemFunctionShellCallItemParam.environment = environment; - return deserializedInputItemFunctionShellCallItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallOutputItemParam.java deleted file mode 100644 index e74fbb7f5710..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallOutputItemParam.java +++ /dev/null @@ -1,229 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Shell tool call output - * - * The streamed output items emitted by a shell tool call. - */ -@Fluent -public final class InputItemFunctionShellCallOutputItemParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.SHELL_CALL_OUTPUT; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The unique ID of the shell tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * Captured chunks of stdout and stderr output, along with their associated outcomes. - */ - @Generated - private final List output; - - /* - * The status property. - */ - @Generated - private FunctionShellCallItemStatus status; - - /* - * The max_output_length property. - */ - @Generated - private Long maxOutputLength; - - /** - * Creates an instance of InputItemFunctionShellCallOutputItemParam class. - * - * @param callId the callId value to set. - * @param output the output value to set. - */ - @Generated - public InputItemFunctionShellCallOutputItemParam(String callId, List output) { - this.callId = callId; - this.output = output; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemFunctionShellCallOutputItemParam object itself. - */ - @Generated - public InputItemFunctionShellCallOutputItemParam setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The unique ID of the shell tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the output property: Captured chunks of stdout and stderr output, along with their associated outcomes. - * - * @return the output value. - */ - @Generated - public List getOutput() { - return this.output; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - @Generated - public FunctionShellCallItemStatus getStatus() { - return this.status; - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the InputItemFunctionShellCallOutputItemParam object itself. - */ - @Generated - public InputItemFunctionShellCallOutputItemParam setStatus(FunctionShellCallItemStatus status) { - this.status = status; - return this; - } - - /** - * Get the maxOutputLength property: The max_output_length property. - * - * @return the maxOutputLength value. - */ - @Generated - public Long getMaxOutputLength() { - return this.maxOutputLength; - } - - /** - * Set the maxOutputLength property: The max_output_length property. - * - * @param maxOutputLength the maxOutputLength value to set. - * @return the InputItemFunctionShellCallOutputItemParam object itself. - */ - @Generated - public InputItemFunctionShellCallOutputItemParam setMaxOutputLength(Long maxOutputLength) { - this.maxOutputLength = maxOutputLength; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeArrayField("output", this.output, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeNumberField("max_output_length", this.maxOutputLength); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemFunctionShellCallOutputItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemFunctionShellCallOutputItemParam if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemFunctionShellCallOutputItemParam. - */ - @Generated - public static InputItemFunctionShellCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - List output = null; - InputItemType type = InputItemType.SHELL_CALL_OUTPUT; - String id = null; - FunctionShellCallItemStatus status = null; - Long maxOutputLength = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("output".equals(fieldName)) { - output = reader.readArray(reader1 -> FunctionShellCallOutputContentParam.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = FunctionShellCallItemStatus.fromString(reader.getString()); - } else if ("max_output_length".equals(fieldName)) { - maxOutputLength = reader.getNullable(JsonReader::getLong); - } else { - reader.skipChildren(); - } - } - InputItemFunctionShellCallOutputItemParam deserializedInputItemFunctionShellCallOutputItemParam - = new InputItemFunctionShellCallOutputItemParam(callId, output); - deserializedInputItemFunctionShellCallOutputItemParam.type = type; - deserializedInputItemFunctionShellCallOutputItemParam.id = id; - deserializedInputItemFunctionShellCallOutputItemParam.status = status; - deserializedInputItemFunctionShellCallOutputItemParam.maxOutputLength = maxOutputLength; - return deserializedInputItemFunctionShellCallOutputItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCall.java deleted file mode 100644 index 73d53cc46ae2..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCall.java +++ /dev/null @@ -1,221 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Function tool call - * - * A tool call to run a function. See the - * [function calling guide](/docs/guides/function-calling) for more information. - */ -@Fluent -public final class InputItemFunctionToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.FUNCTION_CALL; - - /* - * The unique ID of the function tool call. - */ - @Generated - private String id; - - /* - * The unique ID of the function tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * The name of the function to run. - */ - @Generated - private final String name; - - /* - * A JSON string of the arguments to pass to the function. - */ - @Generated - private final String arguments; - - /* - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - */ - @Generated - private InputItemFunctionToolCallStatus status; - - /** - * Creates an instance of InputItemFunctionToolCall class. - * - * @param callId the callId value to set. - * @param name the name value to set. - * @param arguments the arguments value to set. - */ - @Generated - public InputItemFunctionToolCall(String callId, String name, String arguments) { - this.callId = callId; - this.name = name; - this.arguments = arguments; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the function tool call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The unique ID of the function tool call. - * - * @param id the id value to set. - * @return the InputItemFunctionToolCall object itself. - */ - @Generated - public InputItemFunctionToolCall setId(String id) { - this.id = id; - return this; - } - - /** - * Get the callId property: The unique ID of the function tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the name property: The name of the function to run. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the arguments property: A JSON string of the arguments to pass to the function. - * - * @return the arguments value. - */ - @Generated - public String getArguments() { - return this.arguments; - } - - /** - * Get the status property: The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @return the status value. - */ - @Generated - public InputItemFunctionToolCallStatus getStatus() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("arguments", this.arguments); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemFunctionToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemFunctionToolCall if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemFunctionToolCall. - */ - @Generated - public static InputItemFunctionToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - String name = null; - String arguments = null; - InputItemType type = InputItemType.FUNCTION_CALL; - String id = null; - InputItemFunctionToolCallStatus status = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("arguments".equals(fieldName)) { - arguments = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = InputItemFunctionToolCallStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemFunctionToolCall deserializedInputItemFunctionToolCall - = new InputItemFunctionToolCall(callId, name, arguments); - deserializedInputItemFunctionToolCall.type = type; - deserializedInputItemFunctionToolCall.id = id; - deserializedInputItemFunctionToolCall.status = status; - return deserializedInputItemFunctionToolCall; - }); - } - - /** - * Set the status property: The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @param status the status value to set. - * @return the InputItemFunctionToolCall object itself. - */ - @Generated - public InputItemFunctionToolCall setStatus(InputItemFunctionToolCallStatus status) { - this.status = status; - return this; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCallStatus.java deleted file mode 100644 index 8fbd9ffed5a2..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCallStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemFunctionToolCallStatus. - */ -public enum InputItemFunctionToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a InputItemFunctionToolCallStatus instance. - */ - private final String value; - - InputItemFunctionToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemFunctionToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemFunctionToolCallStatus object, or null if unable to parse. - */ - public static InputItemFunctionToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemFunctionToolCallStatus[] items = InputItemFunctionToolCallStatus.values(); - for (InputItemFunctionToolCallStatus 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/implementation/models/InputItemImageGenToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCall.java deleted file mode 100644 index a5505bd1093f..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCall.java +++ /dev/null @@ -1,151 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Image generation call - * - * An image generation request made by the model. - */ -@Immutable -public final class InputItemImageGenToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.IMAGE_GENERATION_CALL; - - /* - * The unique ID of the image generation call. - */ - @Generated - private final String id; - - /* - * The status of the image generation call. - */ - @Generated - private final InputItemImageGenToolCallStatus status; - - /* - * The result property. - */ - @Generated - private final String result; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the image generation call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the image generation call. - * - * @return the status value. - */ - @Generated - public InputItemImageGenToolCallStatus getStatus() { - return this.status; - } - - /** - * Get the result property: The result property. - * - * @return the result value. - */ - @Generated - public String getResult() { - return this.result; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("result", this.result); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemImageGenToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemImageGenToolCall if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemImageGenToolCall. - */ - @Generated - public static InputItemImageGenToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - InputItemImageGenToolCallStatus status = null; - String result = null; - InputItemType type = InputItemType.IMAGE_GENERATION_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = InputItemImageGenToolCallStatus.fromString(reader.getString()); - } else if ("result".equals(fieldName)) { - result = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemImageGenToolCall deserializedInputItemImageGenToolCall - = new InputItemImageGenToolCall(id, status, result); - deserializedInputItemImageGenToolCall.type = type; - return deserializedInputItemImageGenToolCall; - }); - } - - /** - * Creates an instance of InputItemImageGenToolCall class. - * - * @param id the id value to set. - * @param status the status value to set. - * @param result the result value to set. - */ - @Generated - public InputItemImageGenToolCall(String id, InputItemImageGenToolCallStatus status, String result) { - this.id = id; - this.status = status; - this.result = result; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCallStatus.java deleted file mode 100644 index f48710e61ada..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCallStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemImageGenToolCallStatus. - */ -public enum InputItemImageGenToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value generating. - */ - GENERATING("generating"), - - /** - * Enum value failed. - */ - FAILED("failed"); - - /** - * The actual serialized value for a InputItemImageGenToolCallStatus instance. - */ - private final String value; - - InputItemImageGenToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemImageGenToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemImageGenToolCallStatus object, or null if unable to parse. - */ - public static InputItemImageGenToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemImageGenToolCallStatus[] items = InputItemImageGenToolCallStatus.values(); - for (InputItemImageGenToolCallStatus 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/implementation/models/InputItemLocalShellToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCall.java deleted file mode 100644 index c961549f300f..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCall.java +++ /dev/null @@ -1,174 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Local shell call - * - * A tool call to run a command on the local shell. - */ -@Immutable -public final class InputItemLocalShellToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.LOCAL_SHELL_CALL; - - /* - * The unique ID of the local shell call. - */ - @Generated - private final String id; - - /* - * The unique ID of the local shell tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * The action property. - */ - @Generated - private final LocalShellExecAction action; - - /* - * The status of the local shell call. - */ - @Generated - private final InputItemLocalShellToolCallStatus status; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the local shell call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the callId property: The unique ID of the local shell tool call generated by the model. - * - * @return the callId value. - */ - @Generated - public String getCallId() { - return this.callId; - } - - /** - * Get the action property: The action property. - * - * @return the action value. - */ - @Generated - public LocalShellExecAction getAction() { - return this.action; - } - - /** - * Get the status property: The status of the local shell call. - * - * @return the status value. - */ - @Generated - public InputItemLocalShellToolCallStatus getStatus() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeJsonField("action", this.action); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemLocalShellToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemLocalShellToolCall if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemLocalShellToolCall. - */ - @Generated - public static InputItemLocalShellToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String callId = null; - LocalShellExecAction action = null; - InputItemLocalShellToolCallStatus status = null; - InputItemType type = InputItemType.LOCAL_SHELL_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("call_id".equals(fieldName)) { - callId = reader.getString(); - } else if ("action".equals(fieldName)) { - action = LocalShellExecAction.fromJson(reader); - } else if ("status".equals(fieldName)) { - status = InputItemLocalShellToolCallStatus.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemLocalShellToolCall deserializedInputItemLocalShellToolCall - = new InputItemLocalShellToolCall(id, callId, action, status); - deserializedInputItemLocalShellToolCall.type = type; - return deserializedInputItemLocalShellToolCall; - }); - } - - /** - * Creates an instance of InputItemLocalShellToolCall class. - * - * @param id the id value to set. - * @param callId the callId value to set. - * @param action the action value to set. - * @param status the status value to set. - */ - @Generated - public InputItemLocalShellToolCall(String id, String callId, LocalShellExecAction action, - InputItemLocalShellToolCallStatus status) { - this.id = id; - this.callId = callId; - this.action = action; - this.status = status; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutput.java deleted file mode 100644 index 3933ee173c51..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutput.java +++ /dev/null @@ -1,162 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Local shell call output - * - * The output of a local shell tool call. - */ -@Fluent -public final class InputItemLocalShellToolCallOutput extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.LOCAL_SHELL_CALL_OUTPUT; - - /* - * The unique ID of the local shell tool call generated by the model. - */ - @Generated - private final String id; - - /* - * A JSON string of the output of the local shell tool call. - */ - @Generated - private final String output; - - /* - * The status property. - */ - @Generated - private InputItemLocalShellToolCallOutputStatus status; - - /** - * Creates an instance of InputItemLocalShellToolCallOutput class. - * - * @param id the id value to set. - * @param output the output value to set. - */ - @Generated - public InputItemLocalShellToolCallOutput(String id, String output) { - this.id = id; - this.output = output; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the local shell tool call generated by the model. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the output property: A JSON string of the output of the local shell tool call. - * - * @return the output value. - */ - @Generated - public String getOutput() { - return this.output; - } - - /** - * Get the status property: The status property. - * - * @return the status value. - */ - @Generated - public InputItemLocalShellToolCallOutputStatus getStatus() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("output", this.output); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemLocalShellToolCallOutput from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemLocalShellToolCallOutput if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemLocalShellToolCallOutput. - */ - @Generated - public static InputItemLocalShellToolCallOutput fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String output = null; - InputItemType type = InputItemType.LOCAL_SHELL_CALL_OUTPUT; - InputItemLocalShellToolCallOutputStatus status = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("output".equals(fieldName)) { - output = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("status".equals(fieldName)) { - status = InputItemLocalShellToolCallOutputStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemLocalShellToolCallOutput deserializedInputItemLocalShellToolCallOutput - = new InputItemLocalShellToolCallOutput(id, output); - deserializedInputItemLocalShellToolCallOutput.type = type; - deserializedInputItemLocalShellToolCallOutput.status = status; - return deserializedInputItemLocalShellToolCallOutput; - }); - } - - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the InputItemLocalShellToolCallOutput object itself. - */ - @Generated - public InputItemLocalShellToolCallOutput setStatus(InputItemLocalShellToolCallOutputStatus status) { - this.status = status; - return this; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutputStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutputStatus.java deleted file mode 100644 index 9474f927f0b5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutputStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemLocalShellToolCallOutputStatus. - */ -public enum InputItemLocalShellToolCallOutputStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a InputItemLocalShellToolCallOutputStatus instance. - */ - private final String value; - - InputItemLocalShellToolCallOutputStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemLocalShellToolCallOutputStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemLocalShellToolCallOutputStatus object, or null if unable to parse. - */ - public static InputItemLocalShellToolCallOutputStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemLocalShellToolCallOutputStatus[] items = InputItemLocalShellToolCallOutputStatus.values(); - for (InputItemLocalShellToolCallOutputStatus 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/implementation/models/InputItemLocalShellToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallStatus.java deleted file mode 100644 index 1a910d98a80a..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemLocalShellToolCallStatus. - */ -public enum InputItemLocalShellToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a InputItemLocalShellToolCallStatus instance. - */ - private final String value; - - InputItemLocalShellToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemLocalShellToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemLocalShellToolCallStatus object, or null if unable to parse. - */ - public static InputItemLocalShellToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemLocalShellToolCallStatus[] items = InputItemLocalShellToolCallStatus.values(); - for (InputItemLocalShellToolCallStatus 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/implementation/models/InputItemMcpApprovalRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalRequest.java deleted file mode 100644 index 4b169a676c8d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalRequest.java +++ /dev/null @@ -1,173 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * MCP approval request - * - * A request for human approval of a tool invocation. - */ -@Immutable -public final class InputItemMcpApprovalRequest extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.MCP_APPROVAL_REQUEST; - - /* - * The unique ID of the approval request. - */ - @Generated - private final String id; - - /* - * The label of the MCP server making the request. - */ - @Generated - private final String serverLabel; - - /* - * The name of the tool to run. - */ - @Generated - private final String name; - - /* - * A JSON string of arguments for the tool. - */ - @Generated - private final String arguments; - - /** - * Creates an instance of InputItemMcpApprovalRequest class. - * - * @param id the id value to set. - * @param serverLabel the serverLabel value to set. - * @param name the name value to set. - * @param arguments the arguments value to set. - */ - @Generated - public InputItemMcpApprovalRequest(String id, String serverLabel, String name, String arguments) { - this.id = id; - this.serverLabel = serverLabel; - this.name = name; - this.arguments = arguments; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the approval request. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the serverLabel property: The label of the MCP server making the request. - * - * @return the serverLabel value. - */ - @Generated - public String getServerLabel() { - return this.serverLabel; - } - - /** - * Get the name property: The name of the tool to run. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the arguments property: A JSON string of arguments for the tool. - * - * @return the arguments value. - */ - @Generated - public String getArguments() { - return this.arguments; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("server_label", this.serverLabel); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("arguments", this.arguments); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemMcpApprovalRequest from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemMcpApprovalRequest if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemMcpApprovalRequest. - */ - @Generated - public static InputItemMcpApprovalRequest fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String serverLabel = null; - String name = null; - String arguments = null; - InputItemType type = InputItemType.MCP_APPROVAL_REQUEST; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("server_label".equals(fieldName)) { - serverLabel = reader.getString(); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("arguments".equals(fieldName)) { - arguments = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemMcpApprovalRequest deserializedInputItemMcpApprovalRequest - = new InputItemMcpApprovalRequest(id, serverLabel, name, arguments); - deserializedInputItemMcpApprovalRequest.type = type; - return deserializedInputItemMcpApprovalRequest; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalResponse.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalResponse.java deleted file mode 100644 index 34a1a5f8fc96..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalResponse.java +++ /dev/null @@ -1,195 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * MCP approval response - * - * A response to an MCP approval request. - */ -@Fluent -public final class InputItemMcpApprovalResponse extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.MCP_APPROVAL_RESPONSE; - - /* - * The id property. - */ - @Generated - private String id; - - /* - * The ID of the approval request being answered. - */ - @Generated - private final String approvalRequestId; - - /* - * Whether the request was approved. - */ - @Generated - private final boolean approved; - - /* - * The reason property. - */ - @Generated - private String reason; - - /** - * Creates an instance of InputItemMcpApprovalResponse class. - * - * @param approvalRequestId the approvalRequestId value to set. - * @param approved the approved value to set. - */ - @Generated - public InputItemMcpApprovalResponse(String approvalRequestId, boolean approved) { - this.approvalRequestId = approvalRequestId; - this.approved = approved; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The id property. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Set the id property: The id property. - * - * @param id the id value to set. - * @return the InputItemMcpApprovalResponse object itself. - */ - @Generated - public InputItemMcpApprovalResponse setId(String id) { - this.id = id; - return this; - } - - /** - * Get the approvalRequestId property: The ID of the approval request being answered. - * - * @return the approvalRequestId value. - */ - @Generated - public String getApprovalRequestId() { - return this.approvalRequestId; - } - - /** - * Get the approved property: Whether the request was approved. - * - * @return the approved value. - */ - @Generated - public boolean isApproved() { - return this.approved; - } - - /** - * Get the reason property: The reason property. - * - * @return the reason value. - */ - @Generated - public String getReason() { - return this.reason; - } - - /** - * Set the reason property: The reason property. - * - * @param reason the reason value to set. - * @return the InputItemMcpApprovalResponse object itself. - */ - @Generated - public InputItemMcpApprovalResponse setReason(String reason) { - this.reason = reason; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("approval_request_id", this.approvalRequestId); - jsonWriter.writeBooleanField("approve", this.approved); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("reason", this.reason); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemMcpApprovalResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemMcpApprovalResponse if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemMcpApprovalResponse. - */ - @Generated - public static InputItemMcpApprovalResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String approvalRequestId = null; - boolean approved = false; - InputItemType type = InputItemType.MCP_APPROVAL_RESPONSE; - String id = null; - String reason = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("approval_request_id".equals(fieldName)) { - approvalRequestId = reader.getString(); - } else if ("approve".equals(fieldName)) { - approved = reader.getBoolean(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("reason".equals(fieldName)) { - reason = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemMcpApprovalResponse deserializedInputItemMcpApprovalResponse - = new InputItemMcpApprovalResponse(approvalRequestId, approved); - deserializedInputItemMcpApprovalResponse.type = type; - deserializedInputItemMcpApprovalResponse.id = id; - deserializedInputItemMcpApprovalResponse.reason = reason; - return deserializedInputItemMcpApprovalResponse; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpListTools.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpListTools.java deleted file mode 100644 index 366dcd914a8b..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpListTools.java +++ /dev/null @@ -1,184 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * MCP list tools - * - * A list of tools available on an MCP server. - */ -@Fluent -public final class InputItemMcpListTools extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.MCP_LIST_TOOLS; - - /* - * The unique ID of the list. - */ - @Generated - private final String id; - - /* - * The label of the MCP server. - */ - @Generated - private final String serverLabel; - - /* - * The tools available on the server. - */ - @Generated - private final List tools; - - /* - * The error property. - */ - @Generated - private String error; - - /** - * Creates an instance of InputItemMcpListTools class. - * - * @param id the id value to set. - * @param serverLabel the serverLabel value to set. - * @param tools the tools value to set. - */ - @Generated - public InputItemMcpListTools(String id, String serverLabel, List tools) { - this.id = id; - this.serverLabel = serverLabel; - this.tools = tools; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the list. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the serverLabel property: The label of the MCP server. - * - * @return the serverLabel value. - */ - @Generated - public String getServerLabel() { - return this.serverLabel; - } - - /** - * Get the tools property: The tools available on the server. - * - * @return the tools value. - */ - @Generated - public List getTools() { - return this.tools; - } - - /** - * Get the error property: The error property. - * - * @return the error value. - */ - @Generated - public String getError() { - return this.error; - } - - /** - * Set the error property: The error property. - * - * @param error the error value to set. - * @return the InputItemMcpListTools object itself. - */ - @Generated - public InputItemMcpListTools setError(String error) { - this.error = error; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("server_label", this.serverLabel); - jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemMcpListTools from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemMcpListTools if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemMcpListTools. - */ - @Generated - public static InputItemMcpListTools fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String serverLabel = null; - List tools = null; - InputItemType type = InputItemType.MCP_LIST_TOOLS; - String error = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("server_label".equals(fieldName)) { - serverLabel = reader.getString(); - } else if ("tools".equals(fieldName)) { - tools = reader.readArray(reader1 -> McpListToolsTool.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("error".equals(fieldName)) { - error = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemMcpListTools deserializedInputItemMcpListTools = new InputItemMcpListTools(id, serverLabel, tools); - deserializedInputItemMcpListTools.type = type; - deserializedInputItemMcpListTools.error = error; - return deserializedInputItemMcpListTools; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpToolCall.java deleted file mode 100644 index 059b900ba04b..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpToolCall.java +++ /dev/null @@ -1,316 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * MCP tool call - * - * An invocation of a tool on an MCP server. - */ -@Fluent -public final class InputItemMcpToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.MCP_CALL; - - /* - * The unique ID of the tool call. - */ - @Generated - private final String id; - - /* - * The label of the MCP server running the tool. - */ - @Generated - private final String serverLabel; - - /* - * The name of the tool that was run. - */ - @Generated - private final String name; - - /* - * A JSON string of the arguments passed to the tool. - */ - @Generated - private final String arguments; - - /* - * The output property. - */ - @Generated - private String output; - - /* - * The error property. - */ - @Generated - private Map error; - - /* - * The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, or `failed`. - */ - @Generated - private McpToolCallStatus status; - - /* - * The approval_request_id property. - */ - @Generated - private String approvalRequestId; - - /** - * Creates an instance of InputItemMcpToolCall class. - * - * @param id the id value to set. - * @param serverLabel the serverLabel value to set. - * @param name the name value to set. - * @param arguments the arguments value to set. - */ - @Generated - public InputItemMcpToolCall(String id, String serverLabel, String name, String arguments) { - this.id = id; - this.serverLabel = serverLabel; - this.name = name; - this.arguments = arguments; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the tool call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the serverLabel property: The label of the MCP server running the tool. - * - * @return the serverLabel value. - */ - @Generated - public String getServerLabel() { - return this.serverLabel; - } - - /** - * Get the name property: The name of the tool that was run. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the arguments property: A JSON string of the arguments passed to the tool. - * - * @return the arguments value. - */ - @Generated - public String getArguments() { - return this.arguments; - } - - /** - * Get the output property: The output property. - * - * @return the output value. - */ - @Generated - public String getOutput() { - return this.output; - } - - /** - * Set the output property: The output property. - * - * @param output the output value to set. - * @return the InputItemMcpToolCall object itself. - */ - @Generated - public InputItemMcpToolCall setOutput(String output) { - this.output = output; - return this; - } - - /** - * Get the error property: The error property. - * - * @return the error value. - */ - @Generated - public Map getError() { - return this.error; - } - - /** - * Set the error property: The error property. - * - * @param error the error value to set. - * @return the InputItemMcpToolCall object itself. - */ - @Generated - public InputItemMcpToolCall setError(Map error) { - this.error = error; - return this; - } - - /** - * Get the status property: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, - * or `failed`. - * - * @return the status value. - */ - @Generated - public McpToolCallStatus getStatus() { - return this.status; - } - - /** - * Set the status property: The status of the tool call. One of `in_progress`, `completed`, `incomplete`, `calling`, - * or `failed`. - * - * @param status the status value to set. - * @return the InputItemMcpToolCall object itself. - */ - @Generated - public InputItemMcpToolCall setStatus(McpToolCallStatus status) { - this.status = status; - return this; - } - - /** - * Get the approvalRequestId property: The approval_request_id property. - * - * @return the approvalRequestId value. - */ - @Generated - public String getApprovalRequestId() { - return this.approvalRequestId; - } - - /** - * Set the approvalRequestId property: The approval_request_id property. - * - * @param approvalRequestId the approvalRequestId value to set. - * @return the InputItemMcpToolCall object itself. - */ - @Generated - public InputItemMcpToolCall setApprovalRequestId(String approvalRequestId) { - this.approvalRequestId = approvalRequestId; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("server_label", this.serverLabel); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("arguments", this.arguments); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("output", this.output); - jsonWriter.writeMapField("error", this.error, (writer, element) -> { - if (element == null) { - writer.writeNull(); - } else { - element.writeTo(writer); - } - }); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("approval_request_id", this.approvalRequestId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemMcpToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemMcpToolCall if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemMcpToolCall. - */ - @Generated - public static InputItemMcpToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - String serverLabel = null; - String name = null; - String arguments = null; - InputItemType type = InputItemType.MCP_CALL; - String output = null; - Map error = null; - McpToolCallStatus status = null; - String approvalRequestId = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("server_label".equals(fieldName)) { - serverLabel = reader.getString(); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("arguments".equals(fieldName)) { - arguments = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("output".equals(fieldName)) { - output = reader.getString(); - } else if ("error".equals(fieldName)) { - error = reader.readMap(reader1 -> reader1 - .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); - } else if ("status".equals(fieldName)) { - status = McpToolCallStatus.fromString(reader.getString()); - } else if ("approval_request_id".equals(fieldName)) { - approvalRequestId = reader.getString(); - } else { - reader.skipChildren(); - } - } - InputItemMcpToolCall deserializedInputItemMcpToolCall - = new InputItemMcpToolCall(id, serverLabel, name, arguments); - deserializedInputItemMcpToolCall.type = type; - deserializedInputItemMcpToolCall.output = output; - deserializedInputItemMcpToolCall.error = error; - deserializedInputItemMcpToolCall.status = status; - deserializedInputItemMcpToolCall.approvalRequestId = approvalRequestId; - return deserializedInputItemMcpToolCall; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessage.java deleted file mode 100644 index 3aec2b1264a7..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessage.java +++ /dev/null @@ -1,170 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Output message - * - * An output message from the model. - */ -@Immutable -public final class InputItemOutputMessage extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.OUTPUT_MESSAGE; - - /* - * The unique ID of the output message. - */ - @Generated - private final String id; - - /* - * The role of the output message. Always `assistant`. - */ - @Generated - private final String role = "assistant"; - - /* - * The content of the output message. - */ - @Generated - private final List content; - - /* - * The status of the message input. One of `in_progress`, `completed`, or - * `incomplete`. Populated when input items are returned via API. - */ - @Generated - private final InputItemOutputMessageStatus status; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the output message. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the role property: The role of the output message. Always `assistant`. - * - * @return the role value. - */ - @Generated - public String getRole() { - return this.role; - } - - /** - * Get the content property: The content of the output message. - * - * @return the content value. - */ - @Generated - public List getContent() { - return this.content; - } - - /** - * Get the status property: The status of the message input. One of `in_progress`, `completed`, or - * `incomplete`. Populated when input items are returned via API. - * - * @return the status value. - */ - @Generated - public InputItemOutputMessageStatus getStatus() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("role", this.role); - jsonWriter.writeArrayField("content", this.content, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemOutputMessage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemOutputMessage if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemOutputMessage. - */ - @Generated - public static InputItemOutputMessage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - List content = null; - InputItemOutputMessageStatus status = null; - InputItemType type = InputItemType.OUTPUT_MESSAGE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("content".equals(fieldName)) { - content = reader.readArray(reader1 -> OutputMessageContent.fromJson(reader1)); - } else if ("status".equals(fieldName)) { - status = InputItemOutputMessageStatus.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemOutputMessage deserializedInputItemOutputMessage = new InputItemOutputMessage(id, content, status); - deserializedInputItemOutputMessage.type = type; - return deserializedInputItemOutputMessage; - }); - } - - /** - * Creates an instance of InputItemOutputMessage class. - * - * @param id the id value to set. - * @param content the content value to set. - * @param status the status value to set. - */ - @Generated - public InputItemOutputMessage(String id, List content, InputItemOutputMessageStatus status) { - this.id = id; - this.content = content; - this.status = status; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessageStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessageStatus.java deleted file mode 100644 index 9dcfdd8dd276..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessageStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemOutputMessageStatus. - */ -public enum InputItemOutputMessageStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a InputItemOutputMessageStatus instance. - */ - private final String value; - - InputItemOutputMessageStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemOutputMessageStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemOutputMessageStatus object, or null if unable to parse. - */ - public static InputItemOutputMessageStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemOutputMessageStatus[] items = InputItemOutputMessageStatus.values(); - for (InputItemOutputMessageStatus 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/implementation/models/InputItemReasoningItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItem.java deleted file mode 100644 index 25e76b52cd6d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItem.java +++ /dev/null @@ -1,234 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Reasoning - * - * A description of the chain of thought used by a reasoning model while generating - * a response. Be sure to include these items in your `input` to the Responses API - * for subsequent turns of a conversation if you are manually - * [managing context](/docs/guides/conversation-state). - */ -@Fluent -public final class InputItemReasoningItem extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.REASONING; - - /* - * The unique identifier of the reasoning content. - */ - @Generated - private final String id; - - /* - * The encrypted_content property. - */ - @Generated - private String encryptedContent; - - /* - * Reasoning summary content. - */ - @Generated - private final List summary; - - /* - * Reasoning text content. - */ - @Generated - private List content; - - /* - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - */ - @Generated - private InputItemReasoningItemStatus status; - - /** - * Creates an instance of InputItemReasoningItem class. - * - * @param id the id value to set. - * @param summary the summary value to set. - */ - @Generated - public InputItemReasoningItem(String id, List summary) { - this.id = id; - this.summary = summary; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique identifier of the reasoning content. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the encryptedContent property: The encrypted_content property. - * - * @return the encryptedContent value. - */ - @Generated - public String getEncryptedContent() { - return this.encryptedContent; - } - - /** - * Set the encryptedContent property: The encrypted_content property. - * - * @param encryptedContent the encryptedContent value to set. - * @return the InputItemReasoningItem object itself. - */ - @Generated - public InputItemReasoningItem setEncryptedContent(String encryptedContent) { - this.encryptedContent = encryptedContent; - return this; - } - - /** - * Get the summary property: Reasoning summary content. - * - * @return the summary value. - */ - @Generated - public List getSummary() { - return this.summary; - } - - /** - * Get the content property: Reasoning text content. - * - * @return the content value. - */ - @Generated - public List getContent() { - return this.content; - } - - /** - * Set the content property: Reasoning text content. - * - * @param content the content value to set. - * @return the InputItemReasoningItem object itself. - */ - @Generated - public InputItemReasoningItem setContent(List content) { - this.content = content; - return this; - } - - /** - * Get the status property: The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @return the status value. - */ - @Generated - public InputItemReasoningItemStatus getStatus() { - return this.status; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeArrayField("summary", this.summary, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("encrypted_content", this.encryptedContent); - jsonWriter.writeArrayField("content", this.content, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemReasoningItem from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemReasoningItem if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemReasoningItem. - */ - @Generated - public static InputItemReasoningItem fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - List summary = null; - InputItemType type = InputItemType.REASONING; - String encryptedContent = null; - List content = null; - InputItemReasoningItemStatus status = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("summary".equals(fieldName)) { - summary = reader.readArray(reader1 -> SummaryTextContent.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("encrypted_content".equals(fieldName)) { - encryptedContent = reader.getString(); - } else if ("content".equals(fieldName)) { - content = reader.readArray(reader1 -> ReasoningTextContent.fromJson(reader1)); - } else if ("status".equals(fieldName)) { - status = InputItemReasoningItemStatus.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemReasoningItem deserializedInputItemReasoningItem = new InputItemReasoningItem(id, summary); - deserializedInputItemReasoningItem.type = type; - deserializedInputItemReasoningItem.encryptedContent = encryptedContent; - deserializedInputItemReasoningItem.content = content; - deserializedInputItemReasoningItem.status = status; - return deserializedInputItemReasoningItem; - }); - } - - /** - * Set the status property: The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - * @param status the status value to set. - * @return the InputItemReasoningItem object itself. - */ - @Generated - public InputItemReasoningItem setStatus(InputItemReasoningItemStatus status) { - this.status = status; - return this; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItemStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItemStatus.java deleted file mode 100644 index 49ceac55ce3c..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItemStatus.java +++ /dev/null @@ -1,61 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemReasoningItemStatus. - */ -public enum InputItemReasoningItemStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value incomplete. - */ - INCOMPLETE("incomplete"); - - /** - * The actual serialized value for a InputItemReasoningItemStatus instance. - */ - private final String value; - - InputItemReasoningItemStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemReasoningItemStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemReasoningItemStatus object, or null if unable to parse. - */ - public static InputItemReasoningItemStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemReasoningItemStatus[] items = InputItemReasoningItemStatus.values(); - for (InputItemReasoningItemStatus 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/implementation/models/InputItemType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemType.java deleted file mode 100644 index 86e7f4e6e66e..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemType.java +++ /dev/null @@ -1,195 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for InputItemType. - */ -public final class InputItemType extends ExpandableStringEnum { - - /** - * Static value message for InputItemType. - */ - @Generated - public static final InputItemType MESSAGE = fromString("message"); - - /** - * Static value output_message for InputItemType. - */ - @Generated - public static final InputItemType OUTPUT_MESSAGE = fromString("output_message"); - - /** - * Static value file_search_call for InputItemType. - */ - @Generated - public static final InputItemType FILE_SEARCH_CALL = fromString("file_search_call"); - - /** - * Static value computer_call for InputItemType. - */ - @Generated - public static final InputItemType COMPUTER_CALL = fromString("computer_call"); - - /** - * Static value computer_call_output for InputItemType. - */ - @Generated - public static final InputItemType COMPUTER_CALL_OUTPUT = fromString("computer_call_output"); - - /** - * Static value web_search_call for InputItemType. - */ - @Generated - public static final InputItemType WEB_SEARCH_CALL = fromString("web_search_call"); - - /** - * Static value function_call for InputItemType. - */ - @Generated - public static final InputItemType FUNCTION_CALL = fromString("function_call"); - - /** - * Static value function_call_output for InputItemType. - */ - @Generated - public static final InputItemType FUNCTION_CALL_OUTPUT = fromString("function_call_output"); - - /** - * Static value reasoning for InputItemType. - */ - @Generated - public static final InputItemType REASONING = fromString("reasoning"); - - /** - * Static value compaction for InputItemType. - */ - @Generated - public static final InputItemType COMPACTION = fromString("compaction"); - - /** - * Static value image_generation_call for InputItemType. - */ - @Generated - public static final InputItemType IMAGE_GENERATION_CALL = fromString("image_generation_call"); - - /** - * Static value code_interpreter_call for InputItemType. - */ - @Generated - public static final InputItemType CODE_INTERPRETER_CALL = fromString("code_interpreter_call"); - - /** - * Static value local_shell_call for InputItemType. - */ - @Generated - public static final InputItemType LOCAL_SHELL_CALL = fromString("local_shell_call"); - - /** - * Static value local_shell_call_output for InputItemType. - */ - @Generated - public static final InputItemType LOCAL_SHELL_CALL_OUTPUT = fromString("local_shell_call_output"); - - /** - * Static value shell_call for InputItemType. - */ - @Generated - public static final InputItemType SHELL_CALL = fromString("shell_call"); - - /** - * Static value shell_call_output for InputItemType. - */ - @Generated - public static final InputItemType SHELL_CALL_OUTPUT = fromString("shell_call_output"); - - /** - * Static value apply_patch_call for InputItemType. - */ - @Generated - public static final InputItemType APPLY_PATCH_CALL = fromString("apply_patch_call"); - - /** - * Static value apply_patch_call_output for InputItemType. - */ - @Generated - public static final InputItemType APPLY_PATCH_CALL_OUTPUT = fromString("apply_patch_call_output"); - - /** - * Static value mcp_list_tools for InputItemType. - */ - @Generated - public static final InputItemType MCP_LIST_TOOLS = fromString("mcp_list_tools"); - - /** - * Static value mcp_approval_request for InputItemType. - */ - @Generated - public static final InputItemType MCP_APPROVAL_REQUEST = fromString("mcp_approval_request"); - - /** - * Static value mcp_approval_response for InputItemType. - */ - @Generated - public static final InputItemType MCP_APPROVAL_RESPONSE = fromString("mcp_approval_response"); - - /** - * Static value mcp_call for InputItemType. - */ - @Generated - public static final InputItemType MCP_CALL = fromString("mcp_call"); - - /** - * Static value custom_tool_call_output for InputItemType. - */ - @Generated - public static final InputItemType CUSTOM_TOOL_CALL_OUTPUT = fromString("custom_tool_call_output"); - - /** - * Static value custom_tool_call for InputItemType. - */ - @Generated - public static final InputItemType CUSTOM_TOOL_CALL = fromString("custom_tool_call"); - - /** - * Static value item_reference for InputItemType. - */ - @Generated - public static final InputItemType ITEM_REFERENCE = fromString("item_reference"); - - /** - * Creates a new instance of InputItemType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public InputItemType() { - } - - /** - * Creates or finds a InputItemType from its string representation. - * - * @param name a name to look for. - * @return the corresponding InputItemType. - */ - @Generated - public static InputItemType fromString(String name) { - return fromString(name, InputItemType.class); - } - - /** - * Gets known InputItemType values. - * - * @return known InputItemType values. - */ - @Generated - public static Collection values() { - return values(InputItemType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCall.java deleted file mode 100644 index 995b41cad529..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCall.java +++ /dev/null @@ -1,156 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Web search tool call - * - * The results of a web search tool call. See the - * [web search guide](/docs/guides/tools-web-search) for more information. - */ -@Immutable -public final class InputItemWebSearchToolCall extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.WEB_SEARCH_CALL; - - /* - * The unique ID of the web search tool call. - */ - @Generated - private final String id; - - /* - * The status of the web search tool call. - */ - @Generated - private final InputItemWebSearchToolCallStatus status; - - /* - * An object describing the specific action taken in this web search call. - * Includes details on how the model used the web (search, open_page, find_in_page). - */ - @Generated - private final BinaryData action; - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The unique ID of the web search tool call. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * Get the status property: The status of the web search tool call. - * - * @return the status value. - */ - @Generated - public InputItemWebSearchToolCallStatus getStatus() { - return this.status; - } - - /** - * Get the action property: An object describing the specific action taken in this web search call. - * Includes details on how the model used the web (search, open_page, find_in_page). - * - * @return the action value. - */ - @Generated - public BinaryData getAction() { - return this.action; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); - jsonWriter.writeFieldName("action"); - this.action.writeTo(jsonWriter); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputItemWebSearchToolCall from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputItemWebSearchToolCall if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemWebSearchToolCall. - */ - @Generated - public static InputItemWebSearchToolCall fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - InputItemWebSearchToolCallStatus status = null; - BinaryData action = null; - InputItemType type = InputItemType.WEB_SEARCH_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("status".equals(fieldName)) { - status = InputItemWebSearchToolCallStatus.fromString(reader.getString()); - } else if ("action".equals(fieldName)) { - action = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - InputItemWebSearchToolCall deserializedInputItemWebSearchToolCall - = new InputItemWebSearchToolCall(id, status, action); - deserializedInputItemWebSearchToolCall.type = type; - return deserializedInputItemWebSearchToolCall; - }); - } - - /** - * Creates an instance of InputItemWebSearchToolCall class. - * - * @param id the id value to set. - * @param status the status value to set. - * @param action the action value to set. - */ - @Generated - public InputItemWebSearchToolCall(String id, InputItemWebSearchToolCallStatus status, BinaryData action) { - this.id = id; - this.status = status; - this.action = action; - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCallStatus.java deleted file mode 100644 index 8fd1af03409b..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCallStatus.java +++ /dev/null @@ -1,66 +0,0 @@ -// 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.implementation.models; - -/** - * Defines values for InputItemWebSearchToolCallStatus. - */ -public enum InputItemWebSearchToolCallStatus { - /** - * Enum value in_progress. - */ - IN_PROGRESS("in_progress"), - - /** - * Enum value searching. - */ - SEARCHING("searching"), - - /** - * Enum value completed. - */ - COMPLETED("completed"), - - /** - * Enum value failed. - */ - FAILED("failed"); - - /** - * The actual serialized value for a InputItemWebSearchToolCallStatus instance. - */ - private final String value; - - InputItemWebSearchToolCallStatus(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a InputItemWebSearchToolCallStatus instance. - * - * @param value the serialized value to parse. - * @return the parsed InputItemWebSearchToolCallStatus object, or null if unable to parse. - */ - public static InputItemWebSearchToolCallStatus fromString(String value) { - if (value == null) { - return null; - } - InputItemWebSearchToolCallStatus[] items = InputItemWebSearchToolCallStatus.values(); - for (InputItemWebSearchToolCallStatus 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/implementation/models/InputTextContentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputTextContentParam.java deleted file mode 100644 index f54947c16b79..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputTextContentParam.java +++ /dev/null @@ -1,101 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Input text - * - * A text input to the model. - */ -@Immutable -public final class InputTextContentParam implements JsonSerializable { - - /* - * The type of the input item. Always `input_text`. - */ - @Generated - private final String type = "input_text"; - - /* - * The text input to the model. - */ - @Generated - private final String text; - - /** - * Creates an instance of InputTextContentParam class. - * - * @param text the text value to set. - */ - @Generated - public InputTextContentParam(String text) { - this.text = text; - } - - /** - * Get the type property: The type of the input item. Always `input_text`. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the text property: The text input to the model. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("text", this.text); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InputTextContentParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InputTextContentParam if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputTextContentParam. - */ - @Generated - public static InputTextContentParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String text = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new InputTextContentParam(text); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java deleted file mode 100644 index a1f4b369863d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java +++ /dev/null @@ -1,106 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Item reference - * - * An internal identifier for an item to reference. - */ -@Immutable -public final class ItemReferenceParam extends InputItem { - - /* - * The type property. - */ - @Generated - private InputItemType type = InputItemType.ITEM_REFERENCE; - - /* - * The ID of the item to reference. - */ - @Generated - private final String id; - - /** - * Creates an instance of ItemReferenceParam class. - * - * @param id the id value to set. - */ - @Generated - public ItemReferenceParam(String id) { - this.id = id; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public InputItemType getType() { - return this.type; - } - - /** - * Get the id property: The ID of the item to reference. - * - * @return the id value. - */ - @Generated - public String getId() { - return this.id; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ItemReferenceParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ItemReferenceParam if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ItemReferenceParam. - */ - @Generated - public static ItemReferenceParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String id = null; - InputItemType type = InputItemType.ITEM_REFERENCE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("id".equals(fieldName)) { - id = reader.getString(); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ItemReferenceParam deserializedItemReferenceParam = new ItemReferenceParam(id); - deserializedItemReferenceParam.type = type; - return deserializedItemReferenceParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/KeyPressAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/KeyPressAction.java deleted file mode 100644 index 7af41eaafe46..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/KeyPressAction.java +++ /dev/null @@ -1,109 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * KeyPress - * - * A collection of keypresses the model would like to perform. - */ -@Immutable -public final class KeyPressAction extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.KEYPRESS; - - /* - * The combination of keys the model is requesting to be pressed. This is an array of strings, each representing a - * key. - */ - @Generated - private final List keys; - - /** - * Creates an instance of KeyPressAction class. - * - * @param keys the keys value to set. - */ - @Generated - public KeyPressAction(List keys) { - this.keys = keys; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the keys property: The combination of keys the model is requesting to be pressed. This is an array of - * strings, each representing a key. - * - * @return the keys value. - */ - @Generated - public List getKeys() { - return this.keys; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("keys", this.keys, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KeyPressAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KeyPressAction if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the KeyPressAction. - */ - @Generated - public static KeyPressAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - List keys = null; - ComputerActionType type = ComputerActionType.KEYPRESS; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("keys".equals(fieldName)) { - keys = reader.readArray(reader1 -> reader1.getString()); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - KeyPressAction deserializedKeyPressAction = new KeyPressAction(keys); - deserializedKeyPressAction.type = type; - return deserializedKeyPressAction; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ListMemoriesRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ListMemoriesRequest.java new file mode 100644 index 000000000000..be3004d57111 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ListMemoriesRequest.java @@ -0,0 +1,82 @@ +// 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.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The ListMemoriesRequest model. + */ +@Immutable +public final class ListMemoriesRequest implements JsonSerializable { + + /* + * The namespace that logically groups and isolates memories, such as a user ID. + */ + @Generated + private final String scope; + + /** + * Creates an instance of ListMemoriesRequest class. + * + * @param scope the scope value to set. + */ + @Generated + public ListMemoriesRequest(String scope) { + this.scope = scope; + } + + /** + * Get the scope property: The namespace that logically groups and isolates memories, such as a user ID. + * + * @return the scope value. + */ + @Generated + public String getScope() { + return this.scope; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scope", this.scope); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListMemoriesRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListMemoriesRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ListMemoriesRequest. + */ + @Generated + public static ListMemoriesRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String scope = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("scope".equals(fieldName)) { + scope = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new ListMemoriesRequest(scope); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/LocalShellExecAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/LocalShellExecAction.java deleted file mode 100644 index b3863c972805..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/LocalShellExecAction.java +++ /dev/null @@ -1,225 +0,0 @@ -// 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.implementation.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; -import java.util.List; -import java.util.Map; - -/** - * Local shell exec action - * - * Execute a shell command on the server. - */ -@Fluent -public final class LocalShellExecAction implements JsonSerializable { - - /* - * The type of the local shell action. Always `exec`. - */ - @Generated - private final String type = "exec"; - - /* - * The command to run. - */ - @Generated - private final List command; - - /* - * The timeout_ms property. - */ - @Generated - private Long duration; - - /* - * The working_directory property. - */ - @Generated - private String workingDirectory; - - /* - * Environment variables to set for the command. - */ - @Generated - private final Map env; - - /* - * The user property. - */ - @Generated - private String user; - - /** - * Creates an instance of LocalShellExecAction class. - * - * @param command the command value to set. - * @param env the env value to set. - */ - @Generated - public LocalShellExecAction(List command, Map env) { - this.command = command; - this.env = env; - } - - /** - * Get the type property: The type of the local shell action. Always `exec`. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the command property: The command to run. - * - * @return the command value. - */ - @Generated - public List getCommand() { - return this.command; - } - - /** - * Get the duration property: The timeout_ms property. - * - * @return the duration value. - */ - @Generated - public Long getDuration() { - return this.duration; - } - - /** - * Set the duration property: The timeout_ms property. - * - * @param duration the duration value to set. - * @return the LocalShellExecAction object itself. - */ - @Generated - public LocalShellExecAction setDuration(Long duration) { - this.duration = duration; - return this; - } - - /** - * Get the workingDirectory property: The working_directory property. - * - * @return the workingDirectory value. - */ - @Generated - public String getWorkingDirectory() { - return this.workingDirectory; - } - - /** - * Set the workingDirectory property: The working_directory property. - * - * @param workingDirectory the workingDirectory value to set. - * @return the LocalShellExecAction object itself. - */ - @Generated - public LocalShellExecAction setWorkingDirectory(String workingDirectory) { - this.workingDirectory = workingDirectory; - return this; - } - - /** - * Get the env property: Environment variables to set for the command. - * - * @return the env value. - */ - @Generated - public Map getEnv() { - return this.env; - } - - /** - * Get the user property: The user property. - * - * @return the user value. - */ - @Generated - public String getUser() { - return this.user; - } - - /** - * Set the user property: The user property. - * - * @param user the user value to set. - * @return the LocalShellExecAction object itself. - */ - @Generated - public LocalShellExecAction setUser(String user) { - this.user = user; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeArrayField("command", this.command, (writer, element) -> writer.writeString(element)); - jsonWriter.writeMapField("env", this.env, (writer, element) -> writer.writeString(element)); - jsonWriter.writeNumberField("timeout_ms", this.duration); - jsonWriter.writeStringField("working_directory", this.workingDirectory); - jsonWriter.writeStringField("user", this.user); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LocalShellExecAction from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LocalShellExecAction if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LocalShellExecAction. - */ - @Generated - public static LocalShellExecAction fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - List command = null; - Map env = null; - Long duration = null; - String workingDirectory = null; - String user = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("command".equals(fieldName)) { - command = reader.readArray(reader1 -> reader1.getString()); - } else if ("env".equals(fieldName)) { - env = reader.readMap(reader1 -> reader1.getString()); - } else if ("timeout_ms".equals(fieldName)) { - duration = reader.getNullable(JsonReader::getLong); - } else if ("working_directory".equals(fieldName)) { - workingDirectory = reader.getString(); - } else if ("user".equals(fieldName)) { - user = reader.getString(); - } else { - reader.skipChildren(); - } - } - LocalShellExecAction deserializedLocalShellExecAction = new LocalShellExecAction(command, env); - deserializedLocalShellExecAction.duration = duration; - deserializedLocalShellExecAction.workingDirectory = workingDirectory; - deserializedLocalShellExecAction.user = user; - return deserializedLocalShellExecAction; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/LogProb.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/LogProb.java deleted file mode 100644 index 445c07cf1f77..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/LogProb.java +++ /dev/null @@ -1,151 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Log probability - * - * The log probability of a token. - */ -@Immutable -public final class LogProb implements JsonSerializable { - - /* - * The token property. - */ - @Generated - private final String token; - - /* - * The logprob property. - */ - @Generated - private final double logProb; - - /* - * The bytes property. - */ - @Generated - private final List bytes; - - /* - * The top_logprobs property. - */ - @Generated - private final List topLogprobs; - - /** - * Creates an instance of LogProb class. - * - * @param token the token value to set. - * @param logProb the logProb value to set. - * @param bytes the bytes value to set. - * @param topLogprobs the topLogprobs value to set. - */ - @Generated - public LogProb(String token, double logProb, List bytes, List topLogprobs) { - this.token = token; - this.logProb = logProb; - this.bytes = bytes; - this.topLogprobs = topLogprobs; - } - - /** - * Get the token property: The token property. - * - * @return the token value. - */ - @Generated - public String getToken() { - return this.token; - } - - /** - * Get the logProb property: The logprob property. - * - * @return the logProb value. - */ - @Generated - public double getLogProb() { - return this.logProb; - } - - /** - * Get the bytes property: The bytes property. - * - * @return the bytes value. - */ - @Generated - public List getBytes() { - return this.bytes; - } - - /** - * Get the topLogprobs property: The top_logprobs property. - * - * @return the topLogprobs value. - */ - @Generated - public List getTopLogprobs() { - return this.topLogprobs; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("token", this.token); - jsonWriter.writeDoubleField("logprob", this.logProb); - jsonWriter.writeArrayField("bytes", this.bytes, (writer, element) -> writer.writeLong(element)); - jsonWriter.writeArrayField("top_logprobs", this.topLogprobs, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LogProb from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LogProb if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the LogProb. - */ - @Generated - public static LogProb fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String token = null; - double logProb = 0.0; - List bytes = null; - List topLogprobs = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("token".equals(fieldName)) { - token = reader.getString(); - } else if ("logprob".equals(fieldName)) { - logProb = reader.getDouble(); - } else if ("bytes".equals(fieldName)) { - bytes = reader.readArray(reader1 -> reader1.getLong()); - } else if ("top_logprobs".equals(fieldName)) { - topLogprobs = reader.readArray(reader1 -> TopLogProb.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - return new LogProb(token, logProb, bytes, topLogprobs); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsTool.java deleted file mode 100644 index 3439e2a1849c..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsTool.java +++ /dev/null @@ -1,173 +0,0 @@ -// 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.implementation.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; - -/** - * MCP list tools tool - * - * A tool available on an MCP server. - */ -@Fluent -public final class McpListToolsTool implements JsonSerializable { - - /* - * The name of the tool. - */ - @Generated - private final String name; - - /* - * The description property. - */ - @Generated - private String description; - - /* - * The JSON schema describing the tool's input. - */ - @Generated - private final McpListToolsToolInputSchema inputSchema; - - /* - * The annotations property. - */ - @Generated - private McpListToolsToolAnnotations annotations; - - /** - * Creates an instance of McpListToolsTool class. - * - * @param name the name value to set. - * @param inputSchema the inputSchema value to set. - */ - @Generated - public McpListToolsTool(String name, McpListToolsToolInputSchema inputSchema) { - this.name = name; - this.inputSchema = inputSchema; - } - - /** - * Get the name property: The name of the tool. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the description property: The description property. - * - * @return the description value. - */ - @Generated - public String getDescription() { - return this.description; - } - - /** - * Set the description property: The description property. - * - * @param description the description value to set. - * @return the McpListToolsTool object itself. - */ - @Generated - public McpListToolsTool setDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the inputSchema property: The JSON schema describing the tool's input. - * - * @return the inputSchema value. - */ - @Generated - public McpListToolsToolInputSchema getInputSchema() { - return this.inputSchema; - } - - /** - * Get the annotations property: The annotations property. - * - * @return the annotations value. - */ - @Generated - public McpListToolsToolAnnotations getAnnotations() { - return this.annotations; - } - - /** - * Set the annotations property: The annotations property. - * - * @param annotations the annotations value to set. - * @return the McpListToolsTool object itself. - */ - @Generated - public McpListToolsTool setAnnotations(McpListToolsToolAnnotations annotations) { - this.annotations = annotations; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("input_schema", this.inputSchema); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeJsonField("annotations", this.annotations); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of McpListToolsTool from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of McpListToolsTool if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the McpListToolsTool. - */ - @Generated - public static McpListToolsTool fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String name = null; - McpListToolsToolInputSchema inputSchema = null; - String description = null; - McpListToolsToolAnnotations annotations = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("input_schema".equals(fieldName)) { - inputSchema = McpListToolsToolInputSchema.fromJson(reader); - } else if ("description".equals(fieldName)) { - description = reader.getString(); - } else if ("annotations".equals(fieldName)) { - annotations = McpListToolsToolAnnotations.fromJson(reader); - } else { - reader.skipChildren(); - } - } - McpListToolsTool deserializedMcpListToolsTool = new McpListToolsTool(name, inputSchema); - deserializedMcpListToolsTool.description = description; - deserializedMcpListToolsTool.annotations = annotations; - return deserializedMcpListToolsTool; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolAnnotations.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolAnnotations.java deleted file mode 100644 index 5a1c5bd58827..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolAnnotations.java +++ /dev/null @@ -1,57 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The McpListToolsToolAnnotations model. - */ -@Immutable -public final class McpListToolsToolAnnotations implements JsonSerializable { - - /** - * Creates an instance of McpListToolsToolAnnotations class. - */ - @Generated - public McpListToolsToolAnnotations() { - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of McpListToolsToolAnnotations from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of McpListToolsToolAnnotations 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 McpListToolsToolAnnotations. - */ - @Generated - public static McpListToolsToolAnnotations fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - McpListToolsToolAnnotations deserializedMcpListToolsToolAnnotations = new McpListToolsToolAnnotations(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - reader.skipChildren(); - } - return deserializedMcpListToolsToolAnnotations; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolInputSchema.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolInputSchema.java deleted file mode 100644 index ac4f7cdc903d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolInputSchema.java +++ /dev/null @@ -1,57 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The McpListToolsToolInputSchema model. - */ -@Immutable -public final class McpListToolsToolInputSchema implements JsonSerializable { - - /** - * Creates an instance of McpListToolsToolInputSchema class. - */ - @Generated - public McpListToolsToolInputSchema() { - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of McpListToolsToolInputSchema from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of McpListToolsToolInputSchema 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 McpListToolsToolInputSchema. - */ - @Generated - public static McpListToolsToolInputSchema fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - McpListToolsToolInputSchema deserializedMcpListToolsToolInputSchema = new McpListToolsToolInputSchema(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - reader.skipChildren(); - } - return deserializedMcpListToolsToolInputSchema; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MessageContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MessageContentType.java deleted file mode 100644 index 3089ebcf34fb..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MessageContentType.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for MessageContentType. - */ -public final class MessageContentType extends ExpandableStringEnum { - - /** - * Static value input_text for MessageContentType. - */ - @Generated - public static final MessageContentType INPUT_TEXT = fromString("input_text"); - - /** - * Static value output_text for MessageContentType. - */ - @Generated - public static final MessageContentType OUTPUT_TEXT = fromString("output_text"); - - /** - * Static value text for MessageContentType. - */ - @Generated - public static final MessageContentType TEXT = fromString("text"); - - /** - * Static value summary_text for MessageContentType. - */ - @Generated - public static final MessageContentType SUMMARY_TEXT = fromString("summary_text"); - - /** - * Static value reasoning_text for MessageContentType. - */ - @Generated - public static final MessageContentType REASONING_TEXT = fromString("reasoning_text"); - - /** - * Static value refusal for MessageContentType. - */ - @Generated - public static final MessageContentType REFUSAL = fromString("refusal"); - - /** - * Static value input_image for MessageContentType. - */ - @Generated - public static final MessageContentType INPUT_IMAGE = fromString("input_image"); - - /** - * Static value computer_screenshot for MessageContentType. - */ - @Generated - public static final MessageContentType COMPUTER_SCREENSHOT = fromString("computer_screenshot"); - - /** - * Static value input_file for MessageContentType. - */ - @Generated - public static final MessageContentType INPUT_FILE = fromString("input_file"); - - /** - * Creates a new instance of MessageContentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public MessageContentType() { - } - - /** - * Creates or finds a MessageContentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding MessageContentType. - */ - @Generated - public static MessageContentType fromString(String name) { - return fromString(name, MessageContentType.class); - } - - /** - * Gets known MessageContentType values. - * - * @return known MessageContentType values. - */ - @Generated - public static Collection values() { - return values(MessageContentType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MoveParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MoveParam.java deleted file mode 100644 index 8c0459250505..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MoveParam.java +++ /dev/null @@ -1,128 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Move - * - * A mouse move action. - */ -@Immutable -public final class MoveParam extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.MOVE; - - /* - * The x-coordinate to move to. - */ - @Generated - private final long x; - - /* - * The y-coordinate to move to. - */ - @Generated - private final long y; - - /** - * Creates an instance of MoveParam class. - * - * @param x the x value to set. - * @param y the y value to set. - */ - @Generated - public MoveParam(long x, long y) { - this.x = x; - this.y = y; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the x property: The x-coordinate to move to. - * - * @return the x value. - */ - @Generated - public long getX() { - return this.x; - } - - /** - * Get the y property: The y-coordinate to move to. - * - * @return the y value. - */ - @Generated - public long getY() { - return this.y; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("x", this.x); - jsonWriter.writeLongField("y", this.y); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MoveParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MoveParam if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the MoveParam. - */ - @Generated - public static MoveParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long x = 0L; - long y = 0L; - ComputerActionType type = ComputerActionType.MOVE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("x".equals(fieldName)) { - x = reader.getLong(); - } else if ("y".equals(fieldName)) { - y = reader.getLong(); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - MoveParam deserializedMoveParam = new MoveParam(x, y); - deserializedMoveParam.type = type; - return deserializedMoveParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentOutputTextContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentOutputTextContent.java deleted file mode 100644 index 410572cff1d5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentOutputTextContent.java +++ /dev/null @@ -1,152 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Output text - * - * A text output from the model. - */ -@Immutable -public final class OutputMessageContentOutputTextContent extends OutputMessageContent { - - /* - * The type property. - */ - @Generated - private OutputMessageContentType type = OutputMessageContentType.OUTPUT_TEXT; - - /* - * The text output from the model. - */ - @Generated - private final String text; - - /* - * The annotations of the text output. - */ - @Generated - private final List annotations; - - /* - * The logprobs property. - */ - @Generated - private final List logProbs; - - /** - * Creates an instance of OutputMessageContentOutputTextContent class. - * - * @param text the text value to set. - * @param annotations the annotations value to set. - * @param logProbs the logProbs value to set. - */ - @Generated - public OutputMessageContentOutputTextContent(String text, List annotations, List logProbs) { - this.text = text; - this.annotations = annotations; - this.logProbs = logProbs; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public OutputMessageContentType getType() { - return this.type; - } - - /** - * Get the text property: The text output from the model. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * Get the annotations property: The annotations of the text output. - * - * @return the annotations value. - */ - @Generated - public List getAnnotations() { - return this.annotations; - } - - /** - * Get the logProbs property: The logprobs property. - * - * @return the logProbs value. - */ - @Generated - public List getLogProbs() { - return this.logProbs; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("text", this.text); - jsonWriter.writeArrayField("annotations", this.annotations, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("logprobs", this.logProbs, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OutputMessageContentOutputTextContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OutputMessageContentOutputTextContent if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OutputMessageContentOutputTextContent. - */ - @Generated - public static OutputMessageContentOutputTextContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String text = null; - List annotations = null; - List logProbs = null; - OutputMessageContentType type = OutputMessageContentType.OUTPUT_TEXT; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); - } else if ("annotations".equals(fieldName)) { - annotations = reader.readArray(reader1 -> Annotation.fromJson(reader1)); - } else if ("logprobs".equals(fieldName)) { - logProbs = reader.readArray(reader1 -> LogProb.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = OutputMessageContentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - OutputMessageContentOutputTextContent deserializedOutputMessageContentOutputTextContent - = new OutputMessageContentOutputTextContent(text, annotations, logProbs); - deserializedOutputMessageContentOutputTextContent.type = type; - return deserializedOutputMessageContentOutputTextContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentRefusalContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentRefusalContent.java deleted file mode 100644 index 457b0c6c4662..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentRefusalContent.java +++ /dev/null @@ -1,107 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Refusal - * - * A refusal from the model. - */ -@Immutable -public final class OutputMessageContentRefusalContent extends OutputMessageContent { - - /* - * The type property. - */ - @Generated - private OutputMessageContentType type = OutputMessageContentType.REFUSAL; - - /* - * The refusal explanation from the model. - */ - @Generated - private final String refusal; - - /** - * Creates an instance of OutputMessageContentRefusalContent class. - * - * @param refusal the refusal value to set. - */ - @Generated - public OutputMessageContentRefusalContent(String refusal) { - this.refusal = refusal; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public OutputMessageContentType getType() { - return this.type; - } - - /** - * Get the refusal property: The refusal explanation from the model. - * - * @return the refusal value. - */ - @Generated - public String getRefusal() { - return this.refusal; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("refusal", this.refusal); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OutputMessageContentRefusalContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OutputMessageContentRefusalContent if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the OutputMessageContentRefusalContent. - */ - @Generated - public static OutputMessageContentRefusalContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String refusal = null; - OutputMessageContentType type = OutputMessageContentType.REFUSAL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("refusal".equals(fieldName)) { - refusal = reader.getString(); - } else if ("type".equals(fieldName)) { - type = OutputMessageContentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - OutputMessageContentRefusalContent deserializedOutputMessageContentRefusalContent - = new OutputMessageContentRefusalContent(refusal); - deserializedOutputMessageContentRefusalContent.type = type; - return deserializedOutputMessageContentRefusalContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentType.java deleted file mode 100644 index ec2ec10e1d06..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentType.java +++ /dev/null @@ -1,57 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for OutputMessageContentType. - */ -public final class OutputMessageContentType extends ExpandableStringEnum { - - /** - * Static value output_text for OutputMessageContentType. - */ - @Generated - public static final OutputMessageContentType OUTPUT_TEXT = fromString("output_text"); - - /** - * Static value refusal for OutputMessageContentType. - */ - @Generated - public static final OutputMessageContentType REFUSAL = fromString("refusal"); - - /** - * Creates a new instance of OutputMessageContentType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public OutputMessageContentType() { - } - - /** - * Creates or finds a OutputMessageContentType from its string representation. - * - * @param name a name to look for. - * @return the corresponding OutputMessageContentType. - */ - @Generated - public static OutputMessageContentType fromString(String name) { - return fromString(name, OutputMessageContentType.class); - } - - /** - * Gets known OutputMessageContentType values. - * - * @return known OutputMessageContentType values. - */ - @Generated - public static Collection values() { - return values(OutputMessageContentType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ScrollParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ScrollParam.java deleted file mode 100644 index 6ccb209b8111..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ScrollParam.java +++ /dev/null @@ -1,172 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Scroll - * - * A scroll action. - */ -@Immutable -public final class ScrollParam extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.SCROLL; - - /* - * The x-coordinate where the scroll occurred. - */ - @Generated - private final long x; - - /* - * The y-coordinate where the scroll occurred. - */ - @Generated - private final long y; - - /* - * The horizontal scroll distance. - */ - @Generated - private final long scrollX; - - /* - * The vertical scroll distance. - */ - @Generated - private final long scrollY; - - /** - * Creates an instance of ScrollParam class. - * - * @param x the x value to set. - * @param y the y value to set. - * @param scrollX the scrollX value to set. - * @param scrollY the scrollY value to set. - */ - @Generated - public ScrollParam(long x, long y, long scrollX, long scrollY) { - this.x = x; - this.y = y; - this.scrollX = scrollX; - this.scrollY = scrollY; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the x property: The x-coordinate where the scroll occurred. - * - * @return the x value. - */ - @Generated - public long getX() { - return this.x; - } - - /** - * Get the y property: The y-coordinate where the scroll occurred. - * - * @return the y value. - */ - @Generated - public long getY() { - return this.y; - } - - /** - * Get the scrollX property: The horizontal scroll distance. - * - * @return the scrollX value. - */ - @Generated - public long getScrollX() { - return this.scrollX; - } - - /** - * Get the scrollY property: The vertical scroll distance. - * - * @return the scrollY value. - */ - @Generated - public long getScrollY() { - return this.scrollY; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeLongField("x", this.x); - jsonWriter.writeLongField("y", this.y); - jsonWriter.writeLongField("scroll_x", this.scrollX); - jsonWriter.writeLongField("scroll_y", this.scrollY); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ScrollParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ScrollParam if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ScrollParam. - */ - @Generated - public static ScrollParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - long x = 0L; - long y = 0L; - long scrollX = 0L; - long scrollY = 0L; - ComputerActionType type = ComputerActionType.SCROLL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("x".equals(fieldName)) { - x = reader.getLong(); - } else if ("y".equals(fieldName)) { - y = reader.getLong(); - } else if ("scroll_x".equals(fieldName)) { - scrollX = reader.getLong(); - } else if ("scroll_y".equals(fieldName)) { - scrollY = reader.getLong(); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ScrollParam deserializedScrollParam = new ScrollParam(x, y, scrollX, scrollY); - deserializedScrollParam.type = type; - return deserializedScrollParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java index 098d38474abd..cbbfb7943ac6 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java @@ -6,6 +6,7 @@ import com.azure.ai.agents.models.MemorySearchOptions; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -29,7 +30,7 @@ public final class SearchMemoriesRequest implements JsonSerializable items; + private List items; /* * The unique ID of the previous search request, enabling incremental memory search from where the last operation @@ -70,7 +71,7 @@ public String getScope() { * @return the items value. */ @Generated - public List getItems() { + public List getItems() { return this.items; } @@ -81,7 +82,7 @@ public List getItems() { * @return the SearchMemoriesRequest object itself. */ @Generated - public SearchMemoriesRequest setItems(List items) { + public SearchMemoriesRequest setItems(List items) { this.items = items; return this; } @@ -140,7 +141,13 @@ public SearchMemoriesRequest setOptions(MemorySearchOptions options) { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("scope", this.scope); - jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); jsonWriter.writeStringField("previous_search_id", this.previousSearchId); jsonWriter.writeJsonField("options", this.options); return jsonWriter.writeEndObject(); @@ -159,7 +166,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static SearchMemoriesRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String scope = null; - List items = null; + List items = null; String previousSearchId = null; MemorySearchOptions options = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -168,7 +175,8 @@ public static SearchMemoriesRequest fromJson(JsonReader jsonReader) throws IOExc if ("scope".equals(fieldName)) { scope = reader.getString(); } else if ("items".equals(fieldName)) { - items = reader.readArray(reader1 -> InputItem.fromJson(reader1)); + items = reader.readArray(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); } else if ("previous_search_id".equals(fieldName)) { previousSearchId = reader.getString(); } else if ("options".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SummaryTextContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SummaryTextContent.java deleted file mode 100644 index c4c1a7aabbd2..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SummaryTextContent.java +++ /dev/null @@ -1,106 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Summary text - * - * A summary text from the model. - */ -@Immutable -public final class SummaryTextContent extends MessageContent { - - /* - * The type property. - */ - @Generated - private MessageContentType type = MessageContentType.SUMMARY_TEXT; - - /* - * A summary of the reasoning output from the model so far. - */ - @Generated - private final String text; - - /** - * Creates an instance of SummaryTextContent class. - * - * @param text the text value to set. - */ - @Generated - public SummaryTextContent(String text) { - this.text = text; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public MessageContentType getType() { - return this.type; - } - - /** - * Get the text property: A summary of the reasoning output from the model so far. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("text", this.text); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SummaryTextContent from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SummaryTextContent if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SummaryTextContent. - */ - @Generated - public static SummaryTextContent fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String text = null; - MessageContentType type = MessageContentType.SUMMARY_TEXT; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); - } else if ("type".equals(fieldName)) { - type = MessageContentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - SummaryTextContent deserializedSummaryTextContent = new SummaryTextContent(text); - deserializedSummaryTextContent.type = type; - return deserializedSummaryTextContent; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/TopLogProb.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/TopLogProb.java deleted file mode 100644 index 909c84c97fbd..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/TopLogProb.java +++ /dev/null @@ -1,129 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Top log probability - * - * The top log probability of a token. - */ -@Immutable -public final class TopLogProb implements JsonSerializable { - - /* - * The token property. - */ - @Generated - private final String token; - - /* - * The logprob property. - */ - @Generated - private final double logprob; - - /* - * The bytes property. - */ - @Generated - private final List bytes; - - /** - * Creates an instance of TopLogProb class. - * - * @param token the token value to set. - * @param logprob the logprob value to set. - * @param bytes the bytes value to set. - */ - @Generated - public TopLogProb(String token, double logprob, List bytes) { - this.token = token; - this.logprob = logprob; - this.bytes = bytes; - } - - /** - * Get the token property: The token property. - * - * @return the token value. - */ - @Generated - public String getToken() { - return this.token; - } - - /** - * Get the logprob property: The logprob property. - * - * @return the logprob value. - */ - @Generated - public double getLogprob() { - return this.logprob; - } - - /** - * Get the bytes property: The bytes property. - * - * @return the bytes value. - */ - @Generated - public List getBytes() { - return this.bytes; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("token", this.token); - jsonWriter.writeDoubleField("logprob", this.logprob); - jsonWriter.writeArrayField("bytes", this.bytes, (writer, element) -> writer.writeLong(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TopLogProb from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TopLogProb if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the TopLogProb. - */ - @Generated - public static TopLogProb fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String token = null; - double logprob = 0.0; - List bytes = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("token".equals(fieldName)) { - token = reader.getString(); - } else if ("logprob".equals(fieldName)) { - logprob = reader.getDouble(); - } else if ("bytes".equals(fieldName)) { - bytes = reader.readArray(reader1 -> reader1.getLong()); - } else { - reader.skipChildren(); - } - } - return new TopLogProb(token, logprob, bytes); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/TypeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/TypeParam.java deleted file mode 100644 index 424c23ded435..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/TypeParam.java +++ /dev/null @@ -1,106 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Type - * - * An action to type in text. - */ -@Immutable -public final class TypeParam extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.TYPE; - - /* - * The text to type. - */ - @Generated - private final String text; - - /** - * Creates an instance of TypeParam class. - * - * @param text the text value to set. - */ - @Generated - public TypeParam(String text) { - this.text = text; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * Get the text property: The text to type. - * - * @return the text value. - */ - @Generated - public String getText() { - return this.text; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("text", this.text); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TypeParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TypeParam if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the TypeParam. - */ - @Generated - public static TypeParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String text = null; - ComputerActionType type = ComputerActionType.TYPE; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); - } else if ("type".equals(fieldName)) { - type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - TypeParam deserializedTypeParam = new TypeParam(text); - deserializedTypeParam.type = type; - return deserializedTypeParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java index 6166c818404e..ef0196f5de65 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -28,7 +29,7 @@ public final class UpdateMemoriesRequest implements JsonSerializable items; + private List items; /* * The unique ID of the previous update request, enabling incremental memory updates from where the last operation @@ -72,7 +73,7 @@ public String getScope() { * @return the items value. */ @Generated - public List getItems() { + public List getItems() { return this.items; } @@ -83,7 +84,7 @@ public List getItems() { * @return the UpdateMemoriesRequest object itself. */ @Generated - public UpdateMemoriesRequest setItems(List items) { + public UpdateMemoriesRequest setItems(List items) { this.items = items; return this; } @@ -148,7 +149,13 @@ public UpdateMemoriesRequest setUpdateDelay(Integer updateDelay) { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("scope", this.scope); - jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("items", this.items, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); jsonWriter.writeStringField("previous_update_id", this.previousUpdateId); jsonWriter.writeNumberField("update_delay", this.updateDelay); return jsonWriter.writeEndObject(); @@ -167,7 +174,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static UpdateMemoriesRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String scope = null; - List items = null; + List items = null; String previousUpdateId = null; Integer updateDelay = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -176,7 +183,8 @@ public static UpdateMemoriesRequest fromJson(JsonReader jsonReader) throws IOExc if ("scope".equals(fieldName)) { scope = reader.getString(); } else if ("items".equals(fieldName)) { - items = reader.readArray(reader1 -> InputItem.fromJson(reader1)); + items = reader.readArray(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); } else if ("previous_update_id".equals(fieldName)) { previousUpdateId = reader.getString(); } else if ("update_delay".equals(fieldName)) { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ScreenshotParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoryRequest.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ScreenshotParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoryRequest.java index b287a9cdc35d..1597e8139756 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ScreenshotParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoryRequest.java @@ -6,40 +6,41 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; /** - * Screenshot - * - * A screenshot action. + * The UpdateMemoryRequest model. */ @Immutable -public final class ScreenshotParam extends ComputerAction { +public final class UpdateMemoryRequest implements JsonSerializable { /* - * The type property. + * The updated content of the memory. */ @Generated - private ComputerActionType type = ComputerActionType.SCREENSHOT; + private final String content; /** - * Creates an instance of ScreenshotParam class. + * Creates an instance of UpdateMemoryRequest class. + * + * @param content the content value to set. */ @Generated - public ScreenshotParam() { + public UpdateMemoryRequest(String content) { + this.content = content; } /** - * Get the type property: The type property. + * Get the content property: The updated content of the memory. * - * @return the type value. + * @return the content value. */ @Generated - @Override - public ComputerActionType getType() { - return this.type; + public String getContent() { + return this.content; } /** @@ -49,32 +50,33 @@ public ComputerActionType getType() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("content", this.content); return jsonWriter.writeEndObject(); } /** - * Reads an instance of ScreenshotParam from the JsonReader. + * Reads an instance of UpdateMemoryRequest from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ScreenshotParam if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of UpdateMemoryRequest 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 ScreenshotParam. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the UpdateMemoryRequest. */ @Generated - public static ScreenshotParam fromJson(JsonReader jsonReader) throws IOException { + public static UpdateMemoryRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ScreenshotParam deserializedScreenshotParam = new ScreenshotParam(); + String content = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedScreenshotParam.type = ComputerActionType.fromString(reader.getString()); + if ("content".equals(fieldName)) { + content = reader.getString(); } else { reader.skipChildren(); } } - return deserializedScreenshotParam; + return new UpdateMemoryRequest(content); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UrlCitationBody.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UrlCitationBody.java deleted file mode 100644 index 0f5224240a27..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UrlCitationBody.java +++ /dev/null @@ -1,172 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * URL citation - * - * A citation for a web resource used to generate a model response. - */ -@Immutable -public final class UrlCitationBody extends Annotation { - - /* - * The type property. - */ - @Generated - private AnnotationType type = AnnotationType.URL_CITATION; - - /* - * The URL of the web resource. - */ - @Generated - private final String url; - - /* - * The index of the first character of the URL citation in the message. - */ - @Generated - private final long startIndex; - - /* - * The index of the last character of the URL citation in the message. - */ - @Generated - private final long endIndex; - - /* - * The title of the web resource. - */ - @Generated - private final String title; - - /** - * Creates an instance of UrlCitationBody class. - * - * @param url the url value to set. - * @param startIndex the startIndex value to set. - * @param endIndex the endIndex value to set. - * @param title the title value to set. - */ - @Generated - public UrlCitationBody(String url, long startIndex, long endIndex, String title) { - this.url = url; - this.startIndex = startIndex; - this.endIndex = endIndex; - this.title = title; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public AnnotationType getType() { - return this.type; - } - - /** - * Get the url property: The URL of the web resource. - * - * @return the url value. - */ - @Generated - public String getUrl() { - return this.url; - } - - /** - * Get the startIndex property: The index of the first character of the URL citation in the message. - * - * @return the startIndex value. - */ - @Generated - public long getStartIndex() { - return this.startIndex; - } - - /** - * Get the endIndex property: The index of the last character of the URL citation in the message. - * - * @return the endIndex value. - */ - @Generated - public long getEndIndex() { - return this.endIndex; - } - - /** - * Get the title property: The title of the web resource. - * - * @return the title value. - */ - @Generated - public String getTitle() { - return this.title; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("url", this.url); - jsonWriter.writeLongField("start_index", this.startIndex); - jsonWriter.writeLongField("end_index", this.endIndex); - jsonWriter.writeStringField("title", this.title); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of UrlCitationBody from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of UrlCitationBody if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the UrlCitationBody. - */ - @Generated - public static UrlCitationBody fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String url = null; - long startIndex = 0L; - long endIndex = 0L; - String title = null; - AnnotationType type = AnnotationType.URL_CITATION; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("url".equals(fieldName)) { - url = reader.getString(); - } else if ("start_index".equals(fieldName)) { - startIndex = reader.getLong(); - } else if ("end_index".equals(fieldName)) { - endIndex = reader.getLong(); - } else if ("title".equals(fieldName)) { - title = reader.getString(); - } else if ("type".equals(fieldName)) { - type = AnnotationType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - UrlCitationBody deserializedUrlCitationBody = new UrlCitationBody(url, startIndex, endIndex, title); - deserializedUrlCitationBody.type = type; - return deserializedUrlCitationBody; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/VectorStoreFileAttributes.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/VectorStoreFileAttributes.java deleted file mode 100644 index a6ad5ae86d11..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/VectorStoreFileAttributes.java +++ /dev/null @@ -1,120 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. Keys are strings - * with a maximum length of 64 characters. Values are strings with a maximum - * length of 512 characters, booleans, or numbers. - */ -@Fluent -public final class VectorStoreFileAttributes implements JsonSerializable { - - /* - * Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. Keys are strings - * with a maximum length of 64 characters. Values are strings with a maximum - * length of 512 characters, booleans, or numbers. - */ - @Generated - private Map additionalProperties; - - /** - * Creates an instance of VectorStoreFileAttributes class. - */ - @Generated - public VectorStoreFileAttributes() { - } - - /** - * Get the additionalProperties property: Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. Keys are strings - * with a maximum length of 64 characters. Values are strings with a maximum - * length of 512 characters, booleans, or numbers. - * - * @return the additionalProperties value. - */ - @Generated - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. Keys are strings - * with a maximum length of 64 characters. Values are strings with a maximum - * length of 512 characters, booleans, or numbers. - * - * @param additionalProperties the additionalProperties value to set. - * @return the VectorStoreFileAttributes object itself. - */ - @Generated - public VectorStoreFileAttributes setAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeFieldName(additionalProperty.getKey()); - if (additionalProperty.getValue() == null) { - jsonWriter.writeNull(); - } else { - additionalProperty.getValue().writeTo(jsonWriter); - } - } - } - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of VectorStoreFileAttributes from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of VectorStoreFileAttributes 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 VectorStoreFileAttributes. - */ - @Generated - public static VectorStoreFileAttributes fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - VectorStoreFileAttributes deserializedVectorStoreFileAttributes = new VectorStoreFileAttributes(); - Map additionalProperties = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - additionalProperties.put(fieldName, - reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); - } - deserializedVectorStoreFileAttributes.additionalProperties = additionalProperties; - return deserializedVectorStoreFileAttributes; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WaitParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WaitParam.java deleted file mode 100644 index 793b138b18c7..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WaitParam.java +++ /dev/null @@ -1,80 +0,0 @@ -// 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.implementation.models; - -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; - -/** - * Wait - * - * A wait action. - */ -@Immutable -public final class WaitParam extends ComputerAction { - - /* - * The type property. - */ - @Generated - private ComputerActionType type = ComputerActionType.WAIT; - - /** - * Creates an instance of WaitParam class. - */ - @Generated - public WaitParam() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerActionType getType() { - return this.type; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WaitParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WaitParam 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 WaitParam. - */ - @Generated - public static WaitParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WaitParam deserializedWaitParam = new WaitParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedWaitParam.type = ComputerActionType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedWaitParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionFind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionFind.java deleted file mode 100644 index 70ba0d69ce09..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionFind.java +++ /dev/null @@ -1,123 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Find action - * - * Action type "find_in_page": Searches for a pattern within a loaded page. - */ -@Immutable -public final class WebSearchActionFind implements JsonSerializable { - - /* - * The action type. - */ - @Generated - private final String type = "find_in_page"; - - /* - * The URL of the page searched for the pattern. - */ - @Generated - private final String url; - - /* - * The pattern or text to search for within the page. - */ - @Generated - private final String pattern; - - /** - * Creates an instance of WebSearchActionFind class. - * - * @param url the url value to set. - * @param pattern the pattern value to set. - */ - @Generated - public WebSearchActionFind(String url, String pattern) { - this.url = url; - this.pattern = pattern; - } - - /** - * Get the type property: The action type. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the url property: The URL of the page searched for the pattern. - * - * @return the url value. - */ - @Generated - public String getUrl() { - return this.url; - } - - /** - * Get the pattern property: The pattern or text to search for within the page. - * - * @return the pattern value. - */ - @Generated - public String getPattern() { - return this.pattern; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("url", this.url); - jsonWriter.writeStringField("pattern", this.pattern); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WebSearchActionFind from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WebSearchActionFind if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WebSearchActionFind. - */ - @Generated - public static WebSearchActionFind fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String url = null; - String pattern = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("url".equals(fieldName)) { - url = reader.getString(); - } else if ("pattern".equals(fieldName)) { - pattern = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new WebSearchActionFind(url, pattern); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionOpenPage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionOpenPage.java deleted file mode 100644 index e8d7599e90c1..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionOpenPage.java +++ /dev/null @@ -1,110 +0,0 @@ -// 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.implementation.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; - -/** - * Open page action - * - * Action type "open_page" - Opens a specific URL from search results. - */ -@Fluent -public final class WebSearchActionOpenPage implements JsonSerializable { - - /* - * The action type. - */ - @Generated - private final String type = "open_page"; - - /* - * The URL opened by the model. - */ - @Generated - private String url; - - /** - * Creates an instance of WebSearchActionOpenPage class. - */ - @Generated - public WebSearchActionOpenPage() { - } - - /** - * Get the type property: The action type. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the url property: The URL opened by the model. - * - * @return the url value. - */ - @Generated - public String getUrl() { - return this.url; - } - - /** - * Set the url property: The URL opened by the model. - * - * @param url the url value to set. - * @return the WebSearchActionOpenPage object itself. - */ - @Generated - public WebSearchActionOpenPage setUrl(String url) { - this.url = url; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("url", this.url); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WebSearchActionOpenPage from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WebSearchActionOpenPage if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WebSearchActionOpenPage. - */ - @Generated - public static WebSearchActionOpenPage fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WebSearchActionOpenPage deserializedWebSearchActionOpenPage = new WebSearchActionOpenPage(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("url".equals(fieldName)) { - deserializedWebSearchActionOpenPage.url = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedWebSearchActionOpenPage; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearch.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearch.java deleted file mode 100644 index 9d0df0dca1a4..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearch.java +++ /dev/null @@ -1,181 +0,0 @@ -// 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.implementation.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; -import java.util.List; - -/** - * Search action - * - * Action type "search" - Performs a web search query. - */ -@Fluent -public final class WebSearchActionSearch implements JsonSerializable { - - /* - * The action type. - */ - @Generated - private final String type = "search"; - - /* - * [DEPRECATED] The search query. - */ - @Generated - private final String query; - - /* - * Search queries - * - * The search queries. - */ - @Generated - private List queries; - - /* - * Web search sources - * - * The sources used in the search. - */ - @Generated - private List sources; - - /** - * Creates an instance of WebSearchActionSearch class. - * - * @param query the query value to set. - */ - @Generated - public WebSearchActionSearch(String query) { - this.query = query; - } - - /** - * Get the type property: The action type. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the query property: [DEPRECATED] The search query. - * - * @return the query value. - */ - @Generated - public String getQuery() { - return this.query; - } - - /** - * Get the queries property: Search queries - * - * The search queries. - * - * @return the queries value. - */ - @Generated - public List getQueries() { - return this.queries; - } - - /** - * Set the queries property: Search queries - * - * The search queries. - * - * @param queries the queries value to set. - * @return the WebSearchActionSearch object itself. - */ - @Generated - public WebSearchActionSearch setQueries(List queries) { - this.queries = queries; - return this; - } - - /** - * Get the sources property: Web search sources - * - * The sources used in the search. - * - * @return the sources value. - */ - @Generated - public List getSources() { - return this.sources; - } - - /** - * Set the sources property: Web search sources - * - * The sources used in the search. - * - * @param sources the sources value to set. - * @return the WebSearchActionSearch object itself. - */ - @Generated - public WebSearchActionSearch setSources(List sources) { - this.sources = sources; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("query", this.query); - jsonWriter.writeArrayField("queries", this.queries, (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WebSearchActionSearch from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WebSearchActionSearch if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WebSearchActionSearch. - */ - @Generated - public static WebSearchActionSearch fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String query = null; - List queries = null; - List sources = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("query".equals(fieldName)) { - query = reader.getString(); - } else if ("queries".equals(fieldName)) { - queries = reader.readArray(reader1 -> reader1.getString()); - } else if ("sources".equals(fieldName)) { - sources = reader.readArray(reader1 -> WebSearchActionSearchSources.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - WebSearchActionSearch deserializedWebSearchActionSearch = new WebSearchActionSearch(query); - deserializedWebSearchActionSearch.queries = queries; - deserializedWebSearchActionSearch.sources = sources; - return deserializedWebSearchActionSearch; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearchSources.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearchSources.java deleted file mode 100644 index 16b4ca1760de..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearchSources.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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.implementation.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The WebSearchActionSearchSources model. - */ -@Immutable -public final class WebSearchActionSearchSources implements JsonSerializable { - - /* - * The type property. - */ - @Generated - private final String type = "url"; - - /* - * The url property. - */ - @Generated - private final String url; - - /** - * Creates an instance of WebSearchActionSearchSources class. - * - * @param url the url value to set. - */ - @Generated - public WebSearchActionSearchSources(String url) { - this.url = url; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Get the url property: The url property. - * - * @return the url value. - */ - @Generated - public String getUrl() { - return this.url; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("url", this.url); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WebSearchActionSearchSources from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WebSearchActionSearchSources if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WebSearchActionSearchSources. - */ - @Generated - public static WebSearchActionSearchSources fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String url = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("url".equals(fieldName)) { - url = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new WebSearchActionSearchSources(url); - }); - } -} 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 0d87544cb110..3b1e254c3641 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 @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * An agent implementing the A2A protocol. @@ -138,6 +139,9 @@ public A2APreviewTool setProjectConnectionId(String projectConnectionId) { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("base_url", this.baseUrl); jsonWriter.writeStringField("agent_card_path", this.agentCardPath); jsonWriter.writeStringField("project_connection_id", this.projectConnectionId); @@ -161,6 +165,13 @@ public static A2APreviewTool fromJson(JsonReader jsonReader) throws IOException reader.nextToken(); if ("type".equals(fieldName)) { deserializedA2APreviewTool.type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedA2APreviewTool.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedA2APreviewTool.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedA2APreviewTool.toolConfigs = toolConfigs; } else if ("base_url".equals(fieldName)) { deserializedA2APreviewTool.baseUrl = reader.getString(); } else if ("agent_card_path".equals(fieldName)) { @@ -174,4 +185,94 @@ public static A2APreviewTool fromJson(JsonReader jsonReader) throws IOException return deserializedA2APreviewTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the A2APreviewTool object itself. + */ + @Generated + public A2APreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the A2APreviewTool object itself. + */ + @Generated + public A2APreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the A2APreviewTool object itself. + */ + @Generated + public A2APreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } 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 new file mode 100644 index 000000000000..5a49fbba0373 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCall.java @@ -0,0 +1,165 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An A2A (Agent-to-Agent) tool call. + */ +@Immutable +public final class A2AToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "a2a_preview_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The name of the A2A agent card being called. + */ + @Generated + private final String name; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of A2AToolCall class. + * + * @param callId the callId value to set. + * @param name the name value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public A2AToolCall(String callId, String name, String arguments, ToolCallStatus status) { + this.callId = callId; + this.name = name; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the name property: The name of the A2A agent card being called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of A2AToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of A2AToolCall if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the A2AToolCall. + */ + @Generated + public static A2AToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String name = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new A2AToolCall(callId, name, arguments, status); + }); + } +} 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 new file mode 100644 index 000000000000..5c7c8e518553 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2AToolCallOutput.java @@ -0,0 +1,181 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of an A2A (Agent-to-Agent) tool call. + */ +@Fluent +public final class A2AToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "a2a_preview_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The name of the A2A agent card that was called. + */ + @Generated + private final String name; + + /* + * The output from the A2A tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of A2AToolCallOutput class. + * + * @param callId the callId value to set. + * @param name the name value to set. + * @param status the status value to set. + */ + @Generated + public A2AToolCallOutput(String callId, String name, ToolCallStatus status) { + this.callId = callId; + this.name = name; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the name property: The name of the A2A agent card that was called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the output property: The output from the A2A tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the A2A tool call. + * + * @param output the output value to set. + * @return the A2AToolCallOutput object itself. + */ + @Generated + public A2AToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of A2AToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of A2AToolCallOutput if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the A2AToolCallOutput. + */ + @Generated + public static A2AToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String name = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + A2AToolCallOutput deserializedA2AToolCallOutput = new A2AToolCallOutput(callId, name, status); + deserializedA2AToolCallOutput.output = output; + return deserializedA2AToolCallOutput; + }); + } +} 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 281dd32a375c..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 @@ -112,6 +112,8 @@ public static AgentDefinition fromJson(JsonReader jsonReader) throws IOException return PromptAgentDefinition.fromJson(readerToUse.reset()); } else if ("workflow".equals(discriminatorValue)) { return WorkflowAgentDefinition.fromJson(readerToUse.reset()); + } else if ("external".equals(discriminatorValue)) { + return ExternalAgentDefinition.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java index 0924da83ec9d..e1e833c6a9b1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java @@ -19,14 +19,19 @@ public enum AgentDefinitionOptInKeys { WORKFLOW_AGENTS_V1_PREVIEW("WorkflowAgents=V1Preview"), /** - * Enum value ContainerAgents=V1Preview. + * Enum value AgentEndpoints=V1Preview. */ - CONTAINER_AGENTS_V1_PREVIEW("ContainerAgents=V1Preview"), + AGENT_ENDPOINT_V1_PREVIEW("AgentEndpoints=V1Preview"), /** - * Enum value AgentEndpoints=V1Preview. + * Enum value CodeAgents=V1Preview. + */ + CODE_AGENTS_V1_PREVIEW("CodeAgents=V1Preview"), + + /** + * Enum value ExternalAgents=V1Preview. */ - AGENT_ENDPOINT_V1_PREVIEW("AgentEndpoints=V1Preview"); + EXTERNAL_AGENTS_V1_PREVIEW("ExternalAgents=V1Preview"); /** * The actual serialized value for a AgentDefinitionOptInKeys instance. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDetails.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDetails.java index 4e8becf05f02..d43e734b034b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDetails.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentDetails.java @@ -96,9 +96,9 @@ public static AgentDetails fromJson(JsonReader jsonReader) throws IOException { String id = null; String name = null; AgentDetailsVersions versions = null; - AgentEndpoint agentEndpoint = null; + AgentEndpointConfig agentEndpoint = null; AgentIdentity instanceIdentity = null; - AgentIdentity blueprint = null; + AgentIdentity blueprintIdentity = null; AgentBlueprintReference blueprintReference = null; AgentCard agentCard = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -111,11 +111,11 @@ public static AgentDetails fromJson(JsonReader jsonReader) throws IOException { } else if ("versions".equals(fieldName)) { versions = AgentDetailsVersions.fromJson(reader); } else if ("agent_endpoint".equals(fieldName)) { - agentEndpoint = AgentEndpoint.fromJson(reader); + agentEndpoint = AgentEndpointConfig.fromJson(reader); } else if ("instance_identity".equals(fieldName)) { instanceIdentity = AgentIdentity.fromJson(reader); } else if ("blueprint".equals(fieldName)) { - blueprint = AgentIdentity.fromJson(reader); + blueprintIdentity = AgentIdentity.fromJson(reader); } else if ("blueprint_reference".equals(fieldName)) { blueprintReference = AgentBlueprintReference.fromJson(reader); } else if ("agent_card".equals(fieldName)) { @@ -127,7 +127,7 @@ public static AgentDetails fromJson(JsonReader jsonReader) throws IOException { AgentDetails deserializedAgentDetails = new AgentDetails(id, name, versions); deserializedAgentDetails.agentEndpoint = agentEndpoint; deserializedAgentDetails.instanceIdentity = instanceIdentity; - deserializedAgentDetails.blueprint = blueprint; + deserializedAgentDetails.blueprintIdentity = blueprintIdentity; deserializedAgentDetails.blueprintReference = blueprintReference; deserializedAgentDetails.agentCard = agentCard; return deserializedAgentDetails; @@ -168,7 +168,7 @@ public AgentObjectType getObjectType() { * The endpoint configuration for the agent */ @Generated - private AgentEndpoint agentEndpoint; + private AgentEndpointConfig agentEndpoint; /* * The instance identity of the agent @@ -176,12 +176,6 @@ public AgentObjectType getObjectType() { @Generated private AgentIdentity instanceIdentity; - /* - * The blueprint for the agent - */ - @Generated - private AgentIdentity blueprint; - /* * The blueprint for the agent */ @@ -200,7 +194,7 @@ public AgentObjectType getObjectType() { * @return the agentEndpoint value. */ @Generated - public AgentEndpoint getAgentEndpoint() { + public AgentEndpointConfig getAgentEndpoint() { return this.agentEndpoint; } @@ -214,16 +208,6 @@ public AgentIdentity getInstanceIdentity() { return this.instanceIdentity; } - /** - * Get the blueprint property: The blueprint for the agent. - * - * @return the blueprint value. - */ - @Generated - public AgentIdentity getBlueprint() { - return this.blueprint; - } - /** * Get the blueprintReference property: The blueprint for the agent. * @@ -243,4 +227,20 @@ public AgentBlueprintReference getBlueprintReference() { public AgentCard getAgentCard() { return this.agentCard; } + + /* + * The blueprint for the agent + */ + @Generated + private AgentIdentity blueprintIdentity; + + /** + * Get the blueprintIdentity property: The blueprint for the agent. + * + * @return the blueprintIdentity value. + */ + @Generated + public AgentIdentity getBlueprintIdentity() { + return this.blueprintIdentity; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpoint.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointConfig.java similarity index 80% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpoint.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointConfig.java index d1a116c3b403..e7e1c06e2947 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpoint.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointConfig.java @@ -16,10 +16,10 @@ import java.util.Set; /** - * The AgentEndpoint model. + * The AgentEndpointConfig model. */ @Fluent -public final class AgentEndpoint implements JsonSerializable { +public final class AgentEndpointConfig implements JsonSerializable { /* * The version selector of the agent endpoint determines how traffic is routed to different versions of the agent. @@ -54,26 +54,27 @@ private void serializeAsJsonMergePatch(boolean jsonMergePatch) { } static { - JsonMergePatchHelper.setAgentEndpointAccessor(new JsonMergePatchHelper.AgentEndpointAccessor() { + JsonMergePatchHelper.setAgentEndpointConfigAccessor(new JsonMergePatchHelper.AgentEndpointConfigAccessor() { @Override - public AgentEndpoint prepareModelForJsonMergePatch(AgentEndpoint model, boolean jsonMergePatchEnabled) { + public AgentEndpointConfig prepareModelForJsonMergePatch(AgentEndpointConfig model, + boolean jsonMergePatchEnabled) { model.serializeAsJsonMergePatch(jsonMergePatchEnabled); return model; } @Override - public boolean isJsonMergePatch(AgentEndpoint model) { + public boolean isJsonMergePatch(AgentEndpointConfig model) { return model.jsonMergePatch; } }); } /** - * Creates an instance of AgentEndpoint class. + * Creates an instance of AgentEndpointConfig class. */ @Generated - public AgentEndpoint() { + public AgentEndpointConfig() { } /** @@ -92,10 +93,10 @@ public VersionSelector getVersionSelector() { * different versions of the agent. * * @param versionSelector the versionSelector value to set. - * @return the AgentEndpoint object itself. + * @return the AgentEndpointConfig object itself. */ @Generated - public AgentEndpoint setVersionSelector(VersionSelector versionSelector) { + public AgentEndpointConfig setVersionSelector(VersionSelector versionSelector) { this.versionSelector = versionSelector; this.updatedProperties.add("versionSelector"); return this; @@ -115,10 +116,10 @@ public List getProtocols() { * Set the protocols property: The protocols that the agent supports. * * @param protocols the protocols value to set. - * @return the AgentEndpoint object itself. + * @return the AgentEndpointConfig object itself. */ @Generated - public AgentEndpoint setProtocols(List protocols) { + public AgentEndpointConfig setProtocols(List protocols) { this.protocols = protocols; this.updatedProperties.add("protocols"); return this; @@ -138,10 +139,10 @@ public List getAuthorizationSchemes() { * Set the authorizationSchemes property: The authorization schemes supported by the agent endpoint. * * @param authorizationSchemes the authorizationSchemes value to set. - * @return the AgentEndpoint object itself. + * @return the AgentEndpointConfig object itself. */ @Generated - public AgentEndpoint setAuthorizationSchemes(List authorizationSchemes) { + public AgentEndpointConfig setAuthorizationSchemes(List authorizationSchemes) { this.authorizationSchemes = authorizationSchemes; this.updatedProperties.add("authorizationSchemes"); return this; @@ -200,35 +201,35 @@ private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AgentEndpoint from the JsonReader. + * Reads an instance of AgentEndpointConfig from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AgentEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of AgentEndpointConfig 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 AgentEndpoint. + * @throws IOException If an error occurs while reading the AgentEndpointConfig. */ @Generated - public static AgentEndpoint fromJson(JsonReader jsonReader) throws IOException { + public static AgentEndpointConfig fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - AgentEndpoint deserializedAgentEndpoint = new AgentEndpoint(); + AgentEndpointConfig deserializedAgentEndpointConfig = new AgentEndpointConfig(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("version_selector".equals(fieldName)) { - deserializedAgentEndpoint.versionSelector = VersionSelector.fromJson(reader); + deserializedAgentEndpointConfig.versionSelector = VersionSelector.fromJson(reader); } else if ("protocols".equals(fieldName)) { List protocols = reader.readArray(reader1 -> AgentEndpointProtocol.fromString(reader1.getString())); - deserializedAgentEndpoint.protocols = protocols; + deserializedAgentEndpointConfig.protocols = protocols; } else if ("authorization_schemes".equals(fieldName)) { List authorizationSchemes = reader.readArray(reader1 -> AgentEndpointAuthorizationScheme.fromJson(reader1)); - deserializedAgentEndpoint.authorizationSchemes = authorizationSchemes; + deserializedAgentEndpointConfig.authorizationSchemes = authorizationSchemes; } else { reader.skipChildren(); } } - return deserializedAgentEndpoint; + return deserializedAgentEndpointConfig; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointProtocol.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointProtocol.java index c5e14c487786..2d3bd91d0e3a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointProtocol.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentEndpointProtocol.java @@ -66,4 +66,16 @@ public static AgentEndpointProtocol fromString(String name) { public static Collection values() { return values(AgentEndpointProtocol.class); } + + /** + * Static value mcp for AgentEndpointProtocol. + */ + @Generated + public static final AgentEndpointProtocol MCP = fromString("mcp"); + + /** + * WebSocket-based protocol for hosted voice and real-time streaming agents. + */ + @Generated + public static final AgentEndpointProtocol INVOCATIONS_WS = fromString("invocations_ws"); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentifier.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentifier.java new file mode 100644 index 000000000000..267090138d66 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentIdentifier.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.agents.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Identifies the registered Foundry agent to optimize (request-only). Skills, tools, and system_prompt are specified in + * options.optimization_config. + */ +@Fluent +public final class AgentIdentifier implements JsonSerializable { + + /* + * Registered Foundry agent name (required). + */ + @Generated + private final String agentName; + + /* + * Pinned agent version. Defaults to latest if omitted. + */ + @Generated + private String agentVersion; + + /** + * Creates an instance of AgentIdentifier class. + * + * @param agentName the agentName value to set. + */ + @Generated + public AgentIdentifier(String agentName) { + this.agentName = agentName; + } + + /** + * Get the agentName property: Registered Foundry agent name (required). + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: Pinned agent version. Defaults to latest if omitted. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: Pinned agent version. Defaults to latest if omitted. + * + * @param agentVersion the agentVersion value to set. + * @return the AgentIdentifier object itself. + */ + @Generated + public AgentIdentifier setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentIdentifier from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentIdentifier if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentIdentifier. + */ + @Generated + public static AgentIdentifier fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String agentName = null; + String agentVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + AgentIdentifier deserializedAgentIdentifier = new AgentIdentifier(agentName); + deserializedAgentIdentifier.agentVersion = agentVersion; + return deserializedAgentIdentifier; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentKind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentKind.java index 683a1c3542f8..4e0afa59b582 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentKind.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentKind.java @@ -60,4 +60,10 @@ public static AgentKind fromString(String name) { public static Collection values() { return values(AgentKind.class); } + + /** + * Static value external for AgentKind. + */ + @Generated + public static final AgentKind EXTERNAL = fromString("external"); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentProtocol.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentProtocol.java index 19e0df8ce288..69f4dbe23519 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentProtocol.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentProtocol.java @@ -60,4 +60,16 @@ public static Collection values() { */ @Generated public static final AgentProtocol INVOCATIONS = fromString("invocations"); + + /** + * Static value mcp for AgentProtocol. + */ + @Generated + public static final AgentProtocol MCP = fromString("mcp"); + + /** + * WebSocket-based protocol for hosted voice and real-time streaming agents. + */ + @Generated + public static final AgentProtocol INVOCATIONS_WS = fromString("invocations_ws"); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionDetails.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionDetails.java index b911543b5130..ae18f6f2872f 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionDetails.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionDetails.java @@ -185,6 +185,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeLongField("created_at", this.createdAt); jsonWriter.writeJsonField("definition", this.definition); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); return jsonWriter.writeEndObject(); } @@ -207,6 +208,7 @@ public static AgentVersionDetails fromJson(JsonReader jsonReader) throws IOExcep OffsetDateTime createdAt = null; AgentDefinition definition = null; String description = null; + AgentVersionStatus status = null; AgentIdentity instanceIdentity = null; AgentIdentity blueprint = null; AgentBlueprintReference blueprintReference = null; @@ -228,6 +230,8 @@ public static AgentVersionDetails fromJson(JsonReader jsonReader) throws IOExcep definition = AgentDefinition.fromJson(reader); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("status".equals(fieldName)) { + status = AgentVersionStatus.fromString(reader.getString()); } else if ("instance_identity".equals(fieldName)) { instanceIdentity = AgentIdentity.fromJson(reader); } else if ("blueprint".equals(fieldName)) { @@ -243,6 +247,7 @@ public static AgentVersionDetails fromJson(JsonReader jsonReader) throws IOExcep AgentVersionDetails deserializedAgentVersionDetails = new AgentVersionDetails(metadata, id, name, version, createdAt, definition); deserializedAgentVersionDetails.description = description; + deserializedAgentVersionDetails.status = status; deserializedAgentVersionDetails.instanceIdentity = instanceIdentity; deserializedAgentVersionDetails.blueprint = blueprint; deserializedAgentVersionDetails.blueprintReference = blueprintReference; @@ -330,4 +335,22 @@ public AgentBlueprintReference getBlueprintReference() { public String getAgentGuid() { return this.agentGuid; } + + /* + * The provisioning status of the agent version. Defaults to 'active' for non-hosted agents. For hosted agents, + * reflects infrastructure readiness. + */ + @Generated + private AgentVersionStatus status; + + /** + * Get the status property: The provisioning status of the agent version. Defaults to 'active' for non-hosted + * agents. For hosted agents, reflects infrastructure readiness. + * + * @return the status value. + */ + @Generated + public AgentVersionStatus getStatus() { + return this.status; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionStatus.java new file mode 100644 index 000000000000..da1971dc290a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AgentVersionStatus.java @@ -0,0 +1,71 @@ +// 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; + +/** + * The provisioning status of an agent version. + */ +public enum AgentVersionStatus { + /** + * The agent version is being provisioned. + */ + CREATING("creating"), + + /** + * The agent version is active and ready to serve requests. + */ + ACTIVE("active"), + + /** + * The agent version provisioning failed. + */ + FAILED("failed"), + + /** + * The agent version is being deleted. + */ + DELETING("deleting"), + + /** + * The agent version has been deleted. + */ + DELETED("deleted"); + + /** + * The actual serialized value for a AgentVersionStatus instance. + */ + private final String value; + + AgentVersionStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a AgentVersionStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed AgentVersionStatus object, or null if unable to parse. + */ + public static AgentVersionStatus fromString(String value) { + if (value == null) { + return null; + } + AgentVersionStatus[] items = AgentVersionStatus.values(); + for (AgentVersionStatus 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/AzureAISearchTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java index 19435e12d288..a08b058e32a0 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java @@ -3,17 +3,18 @@ // 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.Map; /** * The input definition information for an Azure AI search tool as used to configure an agent. */ -@Immutable +@Fluent public final class AzureAISearchTool extends Tool { /* @@ -68,6 +69,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("azure_ai_search", this.azureAISearch); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +89,9 @@ public static AzureAISearchTool fromJson(JsonReader jsonReader) throws IOExcepti return jsonReader.readObject(reader -> { AzureAISearchToolResource azureAISearch = null; ToolType type = ToolType.AZURE_AI_SEARCH; + String name = null; + String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,13 +99,112 @@ public static AzureAISearchTool fromJson(JsonReader jsonReader) throws IOExcepti azureAISearch = AzureAISearchToolResource.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } } AzureAISearchTool deserializedAzureAISearchTool = new AzureAISearchTool(azureAISearch); deserializedAzureAISearchTool.type = type; + deserializedAzureAISearchTool.name = name; + deserializedAzureAISearchTool.description = description; + deserializedAzureAISearchTool.toolConfigs = toolConfigs; return deserializedAzureAISearchTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the AzureAISearchTool object itself. + */ + @Generated + public AzureAISearchTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the AzureAISearchTool object itself. + */ + @Generated + public AzureAISearchTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the AzureAISearchTool object itself. + */ + @Generated + public AzureAISearchTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchToolCall.java new file mode 100644 index 000000000000..9e983363e7a8 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchToolCall.java @@ -0,0 +1,143 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An Azure AI Search tool call. + */ +@Immutable +public final class AzureAISearchToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "azure_ai_search_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of AzureAISearchToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public AzureAISearchToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAISearchToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAISearchToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureAISearchToolCall. + */ + @Generated + public static AzureAISearchToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new AzureAISearchToolCall(callId, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchToolCallOutput.java new file mode 100644 index 000000000000..2f23000e2dd1 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchToolCallOutput.java @@ -0,0 +1,160 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of an Azure AI Search tool call. + */ +@Fluent +public final class AzureAISearchToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "azure_ai_search_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The output from the Azure AI Search tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of AzureAISearchToolCallOutput class. + * + * @param callId the callId value to set. + * @param status the status value to set. + */ + @Generated + public AzureAISearchToolCallOutput(String callId, ToolCallStatus status) { + this.callId = callId; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the output property: The output from the Azure AI Search tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the Azure AI Search tool call. + * + * @param output the output value to set. + * @return the AzureAISearchToolCallOutput object itself. + */ + @Generated + public AzureAISearchToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureAISearchToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureAISearchToolCallOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureAISearchToolCallOutput. + */ + @Generated + public static AzureAISearchToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + AzureAISearchToolCallOutput deserializedAzureAISearchToolCallOutput + = new AzureAISearchToolCallOutput(callId, status); + deserializedAzureAISearchToolCallOutput.output = output; + return deserializedAzureAISearchToolCallOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java index 30b2d0f8b489..3998a25db323 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java @@ -3,17 +3,18 @@ // 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.Map; /** * The input definition information for an Azure Function Tool, as used to configure an Agent. */ -@Immutable +@Fluent public final class AzureFunctionTool extends Tool { /* @@ -68,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("azure_function", this.azureFunction); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +87,7 @@ public static AzureFunctionTool fromJson(JsonReader jsonReader) throws IOExcepti return jsonReader.readObject(reader -> { AzureFunctionDefinition azureFunction = null; ToolType type = ToolType.AZURE_FUNCTION; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,13 +95,50 @@ public static AzureFunctionTool fromJson(JsonReader jsonReader) throws IOExcepti azureFunction = AzureFunctionDefinition.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } } AzureFunctionTool deserializedAzureFunctionTool = new AzureFunctionTool(azureFunction); deserializedAzureFunctionTool.type = type; + deserializedAzureFunctionTool.toolConfigs = toolConfigs; return deserializedAzureFunctionTool; }); } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the AzureFunctionTool object itself. + */ + @Generated + public AzureFunctionTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionToolCall.java new file mode 100644 index 000000000000..16b133485d40 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionToolCall.java @@ -0,0 +1,165 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An Azure Function tool call. + */ +@Immutable +public final class AzureFunctionToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "azure_function_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The name of the Azure Function being called. + */ + @Generated + private final String name; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of AzureFunctionToolCall class. + * + * @param callId the callId value to set. + * @param name the name value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public AzureFunctionToolCall(String callId, String name, String arguments, ToolCallStatus status) { + this.callId = callId; + this.name = name; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the name property: The name of the Azure Function being called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFunctionToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFunctionToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureFunctionToolCall. + */ + @Generated + public static AzureFunctionToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String name = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new AzureFunctionToolCall(callId, name, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionToolCallOutput.java new file mode 100644 index 000000000000..35443ef16f06 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionToolCallOutput.java @@ -0,0 +1,182 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of an Azure Function tool call. + */ +@Fluent +public final class AzureFunctionToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "azure_function_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The name of the Azure Function that was called. + */ + @Generated + private final String name; + + /* + * The output from the Azure Function tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of AzureFunctionToolCallOutput class. + * + * @param callId the callId value to set. + * @param name the name value to set. + * @param status the status value to set. + */ + @Generated + public AzureFunctionToolCallOutput(String callId, String name, ToolCallStatus status) { + this.callId = callId; + this.name = name; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the name property: The name of the Azure Function that was called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the output property: The output from the Azure Function tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the Azure Function tool call. + * + * @param output the output value to set. + * @return the AzureFunctionToolCallOutput object itself. + */ + @Generated + public AzureFunctionToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureFunctionToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureFunctionToolCallOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureFunctionToolCallOutput. + */ + @Generated + public static AzureFunctionToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String name = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + AzureFunctionToolCallOutput deserializedAzureFunctionToolCallOutput + = new AzureFunctionToolCallOutput(callId, name, status); + deserializedAzureFunctionToolCallOutput.output = output; + return deserializedAzureFunctionToolCallOutput; + }); + } +} 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..2f2435ec7db4 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,17 +3,18 @@ // 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.Map; /** * The input definition information for a Bing custom search tool as used to configure an agent. */ -@Immutable +@Fluent public final class BingCustomSearchPreviewTool extends Tool { /* @@ -68,6 +69,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("bing_custom_search_preview", this.bingCustomSearchPreview); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +89,9 @@ public static BingCustomSearchPreviewTool fromJson(JsonReader jsonReader) throws return jsonReader.readObject(reader -> { BingCustomSearchToolParameters bingCustomSearchPreview = null; ToolType type = ToolType.BING_CUSTOM_SEARCH_PREVIEW; + String name = null; + String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,6 +99,12 @@ public static BingCustomSearchPreviewTool fromJson(JsonReader jsonReader) throws bingCustomSearchPreview = BingCustomSearchToolParameters.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -99,7 +112,100 @@ public static BingCustomSearchPreviewTool fromJson(JsonReader jsonReader) throws BingCustomSearchPreviewTool deserializedBingCustomSearchPreviewTool = new BingCustomSearchPreviewTool(bingCustomSearchPreview); deserializedBingCustomSearchPreviewTool.type = type; + deserializedBingCustomSearchPreviewTool.name = name; + deserializedBingCustomSearchPreviewTool.description = description; + deserializedBingCustomSearchPreviewTool.toolConfigs = toolConfigs; return deserializedBingCustomSearchPreviewTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the BingCustomSearchPreviewTool object itself. + */ + @Generated + public BingCustomSearchPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the BingCustomSearchPreviewTool object itself. + */ + @Generated + public BingCustomSearchPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the BingCustomSearchPreviewTool object itself. + */ + @Generated + public BingCustomSearchPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } 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 new file mode 100644 index 000000000000..56ad1b6713cf --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCall.java @@ -0,0 +1,143 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A Bing custom search tool call. + */ +@Immutable +public final class BingCustomSearchToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "bing_custom_search_preview_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of BingCustomSearchToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public BingCustomSearchToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BingCustomSearchToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BingCustomSearchToolCall if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BingCustomSearchToolCall. + */ + @Generated + public static BingCustomSearchToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new BingCustomSearchToolCall(callId, arguments, status); + }); + } +} 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 new file mode 100644 index 000000000000..3150656bb66c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCallOutput.java @@ -0,0 +1,160 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of a Bing custom search tool call. + */ +@Fluent +public final class BingCustomSearchToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "bing_custom_search_preview_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The output from the Bing custom search tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of BingCustomSearchToolCallOutput class. + * + * @param callId the callId value to set. + * @param status the status value to set. + */ + @Generated + public BingCustomSearchToolCallOutput(String callId, ToolCallStatus status) { + this.callId = callId; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the output property: The output from the Bing custom search tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the Bing custom search tool call. + * + * @param output the output value to set. + * @return the BingCustomSearchToolCallOutput object itself. + */ + @Generated + public BingCustomSearchToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BingCustomSearchToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BingCustomSearchToolCallOutput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BingCustomSearchToolCallOutput. + */ + @Generated + public static BingCustomSearchToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + BingCustomSearchToolCallOutput deserializedBingCustomSearchToolCallOutput + = new BingCustomSearchToolCallOutput(callId, status); + deserializedBingCustomSearchToolCallOutput.output = output; + return deserializedBingCustomSearchToolCallOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java index aa18a2a874c4..ebbe663799ee 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java @@ -3,17 +3,18 @@ // 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.Map; /** * The input definition information for a bing grounding search tool as used to configure an agent. */ -@Immutable +@Fluent public final class BingGroundingTool extends Tool { /* @@ -68,6 +69,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("bing_grounding", this.bingGrounding); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +89,9 @@ public static BingGroundingTool fromJson(JsonReader jsonReader) throws IOExcepti return jsonReader.readObject(reader -> { BingGroundingSearchToolParameters bingGrounding = null; ToolType type = ToolType.BING_GROUNDING; + String name = null; + String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,13 +99,112 @@ public static BingGroundingTool fromJson(JsonReader jsonReader) throws IOExcepti bingGrounding = BingGroundingSearchToolParameters.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } } BingGroundingTool deserializedBingGroundingTool = new BingGroundingTool(bingGrounding); deserializedBingGroundingTool.type = type; + deserializedBingGroundingTool.name = name; + deserializedBingGroundingTool.description = description; + deserializedBingGroundingTool.toolConfigs = toolConfigs; return deserializedBingGroundingTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the BingGroundingTool object itself. + */ + @Generated + public BingGroundingTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the BingGroundingTool object itself. + */ + @Generated + public BingGroundingTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the BingGroundingTool object itself. + */ + @Generated + public BingGroundingTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingToolCall.java new file mode 100644 index 000000000000..35b10569f1f9 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingToolCall.java @@ -0,0 +1,143 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A Bing grounding tool call. + */ +@Immutable +public final class BingGroundingToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "bing_grounding_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of BingGroundingToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public BingGroundingToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BingGroundingToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BingGroundingToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BingGroundingToolCall. + */ + @Generated + public static BingGroundingToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new BingGroundingToolCall(callId, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingToolCallOutput.java new file mode 100644 index 000000000000..10a48dcaca5d --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingToolCallOutput.java @@ -0,0 +1,160 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of a Bing grounding tool call. + */ +@Fluent +public final class BingGroundingToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "bing_grounding_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The output from the Bing grounding tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of BingGroundingToolCallOutput class. + * + * @param callId the callId value to set. + * @param status the status value to set. + */ + @Generated + public BingGroundingToolCallOutput(String callId, ToolCallStatus status) { + this.callId = callId; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the output property: The output from the Bing grounding tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the Bing grounding tool call. + * + * @param output the output value to set. + * @return the BingGroundingToolCallOutput object itself. + */ + @Generated + public BingGroundingToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BingGroundingToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BingGroundingToolCallOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BingGroundingToolCallOutput. + */ + @Generated + public static BingGroundingToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + BingGroundingToolCallOutput deserializedBingGroundingToolCallOutput + = new BingGroundingToolCallOutput(callId, status); + deserializedBingGroundingToolCallOutput.output = output; + return deserializedBingGroundingToolCallOutput; + }); + } +} 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..16fd6d813c1b 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,17 +3,18 @@ // 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.Map; /** * The input definition information for a Browser Automation Tool, as used to configure an Agent. */ -@Immutable +@Fluent public final class BrowserAutomationPreviewTool extends Tool { /* @@ -68,6 +69,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("browser_automation_preview", this.browserAutomationPreview); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +89,9 @@ public static BrowserAutomationPreviewTool fromJson(JsonReader jsonReader) throw return jsonReader.readObject(reader -> { BrowserAutomationToolParameters browserAutomationPreview = null; ToolType type = ToolType.BROWSER_AUTOMATION_PREVIEW; + String name = null; + String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,6 +99,12 @@ public static BrowserAutomationPreviewTool fromJson(JsonReader jsonReader) throw browserAutomationPreview = BrowserAutomationToolParameters.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -99,7 +112,100 @@ public static BrowserAutomationPreviewTool fromJson(JsonReader jsonReader) throw BrowserAutomationPreviewTool deserializedBrowserAutomationPreviewTool = new BrowserAutomationPreviewTool(browserAutomationPreview); deserializedBrowserAutomationPreviewTool.type = type; + deserializedBrowserAutomationPreviewTool.name = name; + deserializedBrowserAutomationPreviewTool.description = description; + deserializedBrowserAutomationPreviewTool.toolConfigs = toolConfigs; return deserializedBrowserAutomationPreviewTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the BrowserAutomationPreviewTool object itself. + */ + @Generated + public BrowserAutomationPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the BrowserAutomationPreviewTool object itself. + */ + @Generated + public BrowserAutomationPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the BrowserAutomationPreviewTool object itself. + */ + @Generated + public BrowserAutomationPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } 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 new file mode 100644 index 000000000000..cffa1cbdc749 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCall.java @@ -0,0 +1,143 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A browser automation tool call. + */ +@Immutable +public final class BrowserAutomationToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "browser_automation_preview_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of BrowserAutomationToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public BrowserAutomationToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BrowserAutomationToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BrowserAutomationToolCall if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BrowserAutomationToolCall. + */ + @Generated + public static BrowserAutomationToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new BrowserAutomationToolCall(callId, arguments, status); + }); + } +} 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 new file mode 100644 index 000000000000..83b824ace482 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCallOutput.java @@ -0,0 +1,160 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of a browser automation tool call. + */ +@Fluent +public final class BrowserAutomationToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "browser_automation_preview_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The output from the browser automation tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of BrowserAutomationToolCallOutput class. + * + * @param callId the callId value to set. + * @param status the status value to set. + */ + @Generated + public BrowserAutomationToolCallOutput(String callId, ToolCallStatus status) { + this.callId = callId; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the output property: The output from the browser automation tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the browser automation tool call. + * + * @param output the output value to set. + * @return the BrowserAutomationToolCallOutput object itself. + */ + @Generated + public BrowserAutomationToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BrowserAutomationToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BrowserAutomationToolCallOutput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BrowserAutomationToolCallOutput. + */ + @Generated + public static BrowserAutomationToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + BrowserAutomationToolCallOutput deserializedBrowserAutomationToolCallOutput + = new BrowserAutomationToolCallOutput(callId, status); + deserializedBrowserAutomationToolCallOutput.output = output; + return deserializedBrowserAutomationToolCallOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateDeployConfig.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateDeployConfig.java new file mode 100644 index 000000000000..5a5c92f1f444 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateDeployConfig.java @@ -0,0 +1,176 @@ +// 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.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Deploy-config blob for a candidate. Suitable for setting OPTIMIZATION_CONFIG on a hosted-agent version. + */ +@Immutable +public final class CandidateDeployConfig implements JsonSerializable { + + /* + * System prompt / instructions. + */ + @Generated + private String instructions; + + /* + * Foundry deployment name. + */ + @Generated + private String model; + + /* + * Optional sampling temperature. + */ + @Generated + private Double temperature; + + /* + * Optional skill overrides. + */ + @Generated + private List> skills; + + /** + * Creates an instance of CandidateDeployConfig class. + */ + @Generated + private CandidateDeployConfig() { + } + + /** + * Get the instructions property: System prompt / instructions. + * + * @return the instructions value. + */ + @Generated + public String getInstructions() { + return this.instructions; + } + + /** + * Get the model property: Foundry deployment name. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Get the temperature property: Optional sampling temperature. + * + * @return the temperature value. + */ + @Generated + public Double getTemperature() { + return this.temperature; + } + + /** + * Get the skills property: Optional skill overrides. + * + * @return the skills value. + */ + @Generated + public List> getSkills() { + return this.skills; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("instructions", this.instructions); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeArrayField("skills", this.skills, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + jsonWriter.writeArrayField("tools", this.tools, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CandidateDeployConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CandidateDeployConfig 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 CandidateDeployConfig. + */ + @Generated + public static CandidateDeployConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CandidateDeployConfig deserializedCandidateDeployConfig = new CandidateDeployConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("instructions".equals(fieldName)) { + deserializedCandidateDeployConfig.instructions = reader.getString(); + } else if ("model".equals(fieldName)) { + deserializedCandidateDeployConfig.model = reader.getString(); + } else if ("temperature".equals(fieldName)) { + deserializedCandidateDeployConfig.temperature = reader.getNullable(JsonReader::getDouble); + } else if ("skills".equals(fieldName)) { + List> skills + = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedCandidateDeployConfig.skills = skills; + } else if ("tools".equals(fieldName)) { + List> tools = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedCandidateDeployConfig.tools = tools; + } else { + reader.skipChildren(); + } + } + return deserializedCandidateDeployConfig; + }); + } + + /* + * Optional tool overrides. + */ + @Generated + private List> tools; + + /** + * Get the tools property: Optional tool overrides. + * + * @return the tools value. + */ + @Generated + public List> getTools() { + return this.tools; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchDeleteFileOperationParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateFileInfo.java similarity index 51% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchDeleteFileOperationParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateFileInfo.java index 17153dda056a..b828cd92d5d1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchDeleteFileOperationParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateFileInfo.java @@ -1,64 +1,82 @@ // 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.implementation.models; +package com.azure.ai.agents.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; /** - * Apply patch delete file operation - * - * Instruction for deleting an existing file via the apply_patch tool. + * File entry in a candidate's blob directory. */ @Immutable -public final class ApplyPatchDeleteFileOperationParam extends ApplyPatchOperationParam { +public final class CandidateFileInfo implements JsonSerializable { /* - * The type property. + * Relative path of the file. */ @Generated - private ApplyPatchOperationParamType type = ApplyPatchOperationParamType.DELETE_FILE; + private final String path; /* - * Path of the file to delete relative to the workspace root. + * File type category (e.g. 'config', 'results'). */ @Generated - private final String path; + private final String type; + + /* + * File size in bytes. + */ + @Generated + private final long sizeBytes; /** - * Creates an instance of ApplyPatchDeleteFileOperationParam class. + * Creates an instance of CandidateFileInfo class. * * @param path the path value to set. + * @param type the type value to set. + * @param sizeBytes the sizeBytes value to set. */ @Generated - public ApplyPatchDeleteFileOperationParam(String path) { + private CandidateFileInfo(String path, String type, long sizeBytes) { this.path = path; + this.type = type; + this.sizeBytes = sizeBytes; } /** - * Get the type property: The type property. + * Get the path property: Relative path of the file. + * + * @return the path value. + */ + @Generated + public String getPath() { + return this.path; + } + + /** + * Get the type property: File type category (e.g. 'config', 'results'). * * @return the type value. */ @Generated - @Override - public ApplyPatchOperationParamType getType() { + public String getType() { return this.type; } /** - * Get the path property: Path of the file to delete relative to the workspace root. + * Get the sizeBytes property: File size in bytes. * - * @return the path value. + * @return the sizeBytes value. */ @Generated - public String getPath() { - return this.path; + public long getSizeBytes() { + return this.sizeBytes; } /** @@ -69,39 +87,40 @@ public String getPath() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("path", this.path); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeLongField("size_bytes", this.sizeBytes); return jsonWriter.writeEndObject(); } /** - * Reads an instance of ApplyPatchDeleteFileOperationParam from the JsonReader. + * Reads an instance of CandidateFileInfo from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ApplyPatchDeleteFileOperationParam if the JsonReader was pointing to an instance of it, or - * null if it was pointing to JSON null. + * @return An instance of CandidateFileInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ApplyPatchDeleteFileOperationParam. + * @throws IOException If an error occurs while reading the CandidateFileInfo. */ @Generated - public static ApplyPatchDeleteFileOperationParam fromJson(JsonReader jsonReader) throws IOException { + public static CandidateFileInfo fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String path = null; - ApplyPatchOperationParamType type = ApplyPatchOperationParamType.DELETE_FILE; + String type = null; + long sizeBytes = 0L; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("path".equals(fieldName)) { path = reader.getString(); } else if ("type".equals(fieldName)) { - type = ApplyPatchOperationParamType.fromString(reader.getString()); + type = reader.getString(); + } else if ("size_bytes".equals(fieldName)) { + sizeBytes = reader.getLong(); } else { reader.skipChildren(); } } - ApplyPatchDeleteFileOperationParam deserializedApplyPatchDeleteFileOperationParam - = new ApplyPatchDeleteFileOperationParam(path); - deserializedApplyPatchDeleteFileOperationParam.type = type; - return deserializedApplyPatchDeleteFileOperationParam; + return new CandidateFileInfo(path, type, sizeBytes); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateMetadata.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateMetadata.java new file mode 100644 index 000000000000..4c23a2eb41b1 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateMetadata.java @@ -0,0 +1,293 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.List; + +/** + * Candidate metadata returned by GET /candidates/{id}. + */ +@Immutable +public final class CandidateMetadata implements JsonSerializable { + + /* + * Server-assigned candidate identifier. + */ + @Generated + private final String candidateId; + + /* + * Owning optimization job id. + */ + @Generated + private final String jobId; + + /* + * Display name of the candidate. + */ + @Generated + private final String candidateName; + + /* + * Candidate lifecycle status. + */ + @Generated + private final String status; + + /* + * Candidate's aggregate score. + */ + @Generated + private Double score; + + /* + * Whether detailed results are available for this candidate. + */ + @Generated + private final boolean hasResults; + + /* + * Timestamp when the candidate was created, represented in Unix time. + */ + @Generated + private final long createdAt; + + /* + * Timestamp when the candidate was last updated, represented in Unix time. + */ + @Generated + private final long updatedAt; + + /* + * Promotion metadata. Null if not promoted. + */ + @Generated + private PromotionInfo promotion; + + /* + * Files in the candidate's blob directory. + */ + @Generated + private final List files; + + /** + * Creates an instance of CandidateMetadata class. + * + * @param candidateId the candidateId value to set. + * @param jobId the jobId value to set. + * @param candidateName the candidateName value to set. + * @param status the status value to set. + * @param hasResults the hasResults value to set. + * @param createdAt the createdAt value to set. + * @param updatedAt the updatedAt value to set. + * @param files the files value to set. + */ + @Generated + private CandidateMetadata(String candidateId, String jobId, String candidateName, String status, boolean hasResults, + OffsetDateTime createdAt, OffsetDateTime updatedAt, List files) { + this.candidateId = candidateId; + this.jobId = jobId; + this.candidateName = candidateName; + this.status = status; + this.hasResults = hasResults; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + if (updatedAt == null) { + this.updatedAt = 0L; + } else { + this.updatedAt = updatedAt.toEpochSecond(); + } + this.files = files; + } + + /** + * Get the candidateId property: Server-assigned candidate identifier. + * + * @return the candidateId value. + */ + @Generated + public String getCandidateId() { + return this.candidateId; + } + + /** + * Get the jobId property: Owning optimization job id. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Get the candidateName property: Display name of the candidate. + * + * @return the candidateName value. + */ + @Generated + public String getCandidateName() { + return this.candidateName; + } + + /** + * Get the status property: Candidate lifecycle status. + * + * @return the status value. + */ + @Generated + public String getStatus() { + return this.status; + } + + /** + * Get the score property: Candidate's aggregate score. + * + * @return the score value. + */ + @Generated + public Double getScore() { + return this.score; + } + + /** + * Get the hasResults property: Whether detailed results are available for this candidate. + * + * @return the hasResults value. + */ + @Generated + public boolean isHasResults() { + return this.hasResults; + } + + /** + * Get the createdAt property: Timestamp when the candidate was created, represented in Unix time. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the updatedAt property: Timestamp when the candidate was last updated, represented in Unix time. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.updatedAt), ZoneOffset.UTC); + } + + /** + * Get the promotion property: Promotion metadata. Null if not promoted. + * + * @return the promotion value. + */ + @Generated + public PromotionInfo getPromotion() { + return this.promotion; + } + + /** + * Get the files property: Files in the candidate's blob directory. + * + * @return the files value. + */ + @Generated + public List getFiles() { + return this.files; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("candidate_id", this.candidateId); + jsonWriter.writeStringField("job_id", this.jobId); + jsonWriter.writeStringField("candidate_name", this.candidateName); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeBooleanField("has_results", this.hasResults); + jsonWriter.writeLongField("created_at", this.createdAt); + jsonWriter.writeLongField("updated_at", this.updatedAt); + jsonWriter.writeArrayField("files", this.files, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("score", this.score); + jsonWriter.writeJsonField("promotion", this.promotion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CandidateMetadata from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CandidateMetadata if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CandidateMetadata. + */ + @Generated + public static CandidateMetadata fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String candidateId = null; + String jobId = null; + String candidateName = null; + String status = null; + boolean hasResults = false; + OffsetDateTime createdAt = null; + OffsetDateTime updatedAt = null; + List files = null; + Double score = null; + PromotionInfo promotion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("candidate_id".equals(fieldName)) { + candidateId = reader.getString(); + } else if ("job_id".equals(fieldName)) { + jobId = reader.getString(); + } else if ("candidate_name".equals(fieldName)) { + candidateName = reader.getString(); + } else if ("status".equals(fieldName)) { + status = reader.getString(); + } else if ("has_results".equals(fieldName)) { + hasResults = reader.getBoolean(); + } else if ("created_at".equals(fieldName)) { + createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("updated_at".equals(fieldName)) { + updatedAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("files".equals(fieldName)) { + files = reader.readArray(reader1 -> CandidateFileInfo.fromJson(reader1)); + } else if ("score".equals(fieldName)) { + score = reader.getNullable(JsonReader::getDouble); + } else if ("promotion".equals(fieldName)) { + promotion = PromotionInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + CandidateMetadata deserializedCandidateMetadata = new CandidateMetadata(candidateId, jobId, candidateName, + status, hasResults, createdAt, updatedAt, files); + deserializedCandidateMetadata.score = score; + deserializedCandidateMetadata.promotion = promotion; + return deserializedCandidateMetadata; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateResults.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateResults.java new file mode 100644 index 000000000000..bc52fc380664 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CandidateResults.java @@ -0,0 +1,105 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Full per-task evaluation results for a candidate, returned by GET /candidates/{id}/results. + */ +@Immutable +public final class CandidateResults implements JsonSerializable { + + /* + * Owning candidate id. + */ + @Generated + private final String candidateId; + + /* + * Per-task evaluation rows. + */ + @Generated + private final List results; + + /** + * Creates an instance of CandidateResults class. + * + * @param candidateId the candidateId value to set. + * @param results the results value to set. + */ + @Generated + private CandidateResults(String candidateId, List results) { + this.candidateId = candidateId; + this.results = results; + } + + /** + * Get the candidateId property: Owning candidate id. + * + * @return the candidateId value. + */ + @Generated + public String getCandidateId() { + return this.candidateId; + } + + /** + * Get the results property: Per-task evaluation rows. + * + * @return the results value. + */ + @Generated + public List getResults() { + return this.results; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("candidate_id", this.candidateId); + jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CandidateResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CandidateResults if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CandidateResults. + */ + @Generated + public static CandidateResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String candidateId = null; + List results = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("candidate_id".equals(fieldName)) { + candidateId = reader.getString(); + } else if ("results".equals(fieldName)) { + results = reader.readArray(reader1 -> OptimizationTaskResult.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new CandidateResults(candidateId, results); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CaptureStructuredOutputsTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CaptureStructuredOutputsTool.java index 493e3c88765a..235de92778ef 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CaptureStructuredOutputsTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CaptureStructuredOutputsTool.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * A tool for capturing structured outputs. @@ -70,6 +71,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -89,6 +91,7 @@ public static CaptureStructuredOutputsTool fromJson(JsonReader jsonReader) throw ToolType type = ToolType.CAPTURE_STRUCTURED_OUTPUTS; String name = null; String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -100,6 +103,8 @@ public static CaptureStructuredOutputsTool fromJson(JsonReader jsonReader) throw name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -109,6 +114,7 @@ public static CaptureStructuredOutputsTool fromJson(JsonReader jsonReader) throw deserializedCaptureStructuredOutputsTool.type = type; deserializedCaptureStructuredOutputsTool.name = name; deserializedCaptureStructuredOutputsTool.description = description; + deserializedCaptureStructuredOutputsTool.toolConfigs = toolConfigs; return deserializedCaptureStructuredOutputsTool; }); } @@ -168,4 +174,38 @@ public CaptureStructuredOutputsTool setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the CaptureStructuredOutputsTool object itself. + */ + @Generated + public CaptureStructuredOutputsTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ChatSummaryMemoryItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ChatSummaryMemoryItem.java index 9eafc353a349..93360d50d4be 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ChatSummaryMemoryItem.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ChatSummaryMemoryItem.java @@ -34,7 +34,7 @@ public final class ChatSummaryMemoryItem extends MemoryItem { * @param content the content value to set. */ @Generated - private ChatSummaryMemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { + public ChatSummaryMemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { super(memoryId, updatedAt, scope, content); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeConfiguration.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeConfiguration.java index d6f75280f848..80e762577ae6 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeConfiguration.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeConfiguration.java @@ -30,18 +30,6 @@ public final class CodeConfiguration implements JsonSerializable entryPoint; - /** - * Creates an instance of CodeConfiguration class. - * - * @param runtime the runtime value to set. - * @param entryPoint the entryPoint value to set. - */ - @Generated - public CodeConfiguration(String runtime, List entryPoint) { - this.runtime = runtime; - this.entryPoint = entryPoint; - } - /** * Get the runtime property: The runtime identifier for code execution (e.g., 'python_3_11', 'python_3_12', * 'python_3_13'). @@ -72,6 +60,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("runtime", this.runtime); jsonWriter.writeArrayField("entry_point", this.entryPoint, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("dependency_resolution", + this.dependencyResolution == null ? null : this.dependencyResolution.toString()); return jsonWriter.writeEndObject(); } @@ -89,6 +79,8 @@ public static CodeConfiguration fromJson(JsonReader jsonReader) throws IOExcepti return jsonReader.readObject(reader -> { String runtime = null; List entryPoint = null; + CodeDependencyResolution dependencyResolution = null; + String contentSha256 = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -96,11 +88,73 @@ public static CodeConfiguration fromJson(JsonReader jsonReader) throws IOExcepti runtime = reader.getString(); } else if ("entry_point".equals(fieldName)) { entryPoint = reader.readArray(reader1 -> reader1.getString()); + } else if ("dependency_resolution".equals(fieldName)) { + dependencyResolution = CodeDependencyResolution.fromString(reader.getString()); + } else if ("content_hash".equals(fieldName)) { + contentSha256 = reader.getString(); } else { reader.skipChildren(); } } - return new CodeConfiguration(runtime, entryPoint); + CodeConfiguration deserializedCodeConfiguration + = new CodeConfiguration(runtime, entryPoint, dependencyResolution); + deserializedCodeConfiguration.contentSha256 = contentSha256; + return deserializedCodeConfiguration; }); } + + /* + * How package dependencies are resolved at deployment time. Defaults to `bundled`, + * where the caller bundles all dependencies into the uploaded zip and the service + * performs no remote build. `remote_build` instructs the service to build + * dependencies remotely from the manifest included in the uploaded zip. + */ + @Generated + private final CodeDependencyResolution dependencyResolution; + + /** + * Creates an instance of CodeConfiguration class. + * + * @param runtime the runtime value to set. + * @param entryPoint the entryPoint value to set. + * @param dependencyResolution the dependencyResolution value to set. + */ + @Generated + public CodeConfiguration(String runtime, List entryPoint, CodeDependencyResolution dependencyResolution) { + this.runtime = runtime; + this.entryPoint = entryPoint; + this.dependencyResolution = dependencyResolution; + } + + /** + * Get the dependencyResolution property: How package dependencies are resolved at deployment time. Defaults to + * `bundled`, + * where the caller bundles all dependencies into the uploaded zip and the service + * performs no remote build. `remote_build` instructs the service to build + * dependencies remotely from the manifest included in the uploaded zip. + * + * @return the dependencyResolution value. + */ + @Generated + public CodeDependencyResolution getDependencyResolution() { + return this.dependencyResolution; + } + + /* + * The SHA-256 hex digest of the uploaded code zip. Set by the service from the `x-ms-code-zip-sha256` request + * header; read-only in responses and never accepted in request payloads. + */ + @Generated + private String contentSha256; + + /** + * Get the contentSha256 property: The SHA-256 hex digest of the uploaded code zip. Set by the service from the + * `x-ms-code-zip-sha256` request header; read-only in responses and never accepted in request payloads. + * + * @return the contentSha256 value. + */ + @Generated + public String getContentSha256() { + return this.contentSha256; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeDependencyResolution.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeDependencyResolution.java new file mode 100644 index 000000000000..797d73542972 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeDependencyResolution.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; + +/** + * How package dependencies are resolved at deployment time for a code-based hosted agent. + */ +public final class CodeDependencyResolution extends ExpandableStringEnum { + + /** + * The caller has bundled all dependencies into the uploaded zip; the service performs no remote build. + */ + @Generated + public static final CodeDependencyResolution BUNDLED = fromString("bundled"); + + /** + * The service builds dependencies remotely from the manifest included in the uploaded zip. + */ + @Generated + public static final CodeDependencyResolution REMOTE_BUILD = fromString("remote_build"); + + /** + * Creates a new instance of CodeDependencyResolution value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CodeDependencyResolution() { + } + + /** + * Creates or finds a CodeDependencyResolution from its string representation. + * + * @param name a name to look for. + * @return the corresponding CodeDependencyResolution. + */ + @Generated + public static CodeDependencyResolution fromString(String name) { + return fromString(name, CodeDependencyResolution.class); + } + + /** + * Gets known CodeDependencyResolution values. + * + * @return known CodeDependencyResolution values. + */ + @Generated + public static Collection values() { + return values(CodeDependencyResolution.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeFileDetails.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeFileDetails.java new file mode 100644 index 000000000000..1bed6e5dd593 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeFileDetails.java @@ -0,0 +1,97 @@ +// 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.core.util.BinaryData; + +/** + * The file details for the "code" field. + */ +@Fluent +public final class CodeFileDetails { + + /* + * The content of the file. + */ + @Generated + private final BinaryData content; + + /* + * The filename of the file. + */ + @Generated + private String filename; + + /* + * The content-type of the file. + */ + @Generated + private String contentType = "application/octet-stream"; + + /** + * Creates an instance of CodeFileDetails class. + * + * @param content the content value to set. + */ + @Generated + public CodeFileDetails(BinaryData content) { + this.content = content; + } + + /** + * Get the content property: The content of the file. + * + * @return the content value. + */ + @Generated + public BinaryData getContent() { + return this.content; + } + + /** + * Get the filename property: The filename of the file. + * + * @return the filename value. + */ + @Generated + public String getFilename() { + return this.filename; + } + + /** + * Set the filename property: The filename of the file. + * + * @param filename the filename value to set. + * @return the CodeFileDetails object itself. + */ + @Generated + public CodeFileDetails setFilename(String filename) { + this.filename = filename; + return this; + } + + /** + * Get the contentType property: The content-type of the file. + * + * @return the contentType value. + */ + @Generated + public String getContentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content-type of the file. + * + * @param contentType the contentType value to set. + * @return the CodeFileDetails object itself. + */ + @Generated + public CodeFileDetails setContentType(String contentType) { + this.contentType = contentType; + return this; + } +} 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 b1937db8c1d9..70ddbe3e8764 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.Map; /** * Code interpreter @@ -68,6 +69,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); if (this.container != null) { jsonWriter.writeFieldName("container"); this.container.writeTo(jsonWriter); @@ -96,6 +98,9 @@ public static CodeInterpreterTool fromJson(JsonReader jsonReader) throws IOExcep deserializedCodeInterpreterTool.name = reader.getString(); } else if ("description".equals(fieldName)) { deserializedCodeInterpreterTool.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedCodeInterpreterTool.toolConfigs = toolConfigs; } else if ("container".equals(fieldName)) { deserializedCodeInterpreterTool.container = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); @@ -246,4 +251,38 @@ public CodeInterpreterTool setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the CodeInterpreterTool object itself. + */ + @Generated + public CodeInterpreterTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeContent.java new file mode 100644 index 000000000000..ac62bf498f57 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeContent.java @@ -0,0 +1,59 @@ +// 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.annotation.Immutable; + +/** + * Multipart request body for updating or versioning a code-based agent (POST /agents/{name} and POST + * /agents/{name}/versions). + */ +@Immutable +public final class CreateAgentVersionFromCodeContent { + + /* + * JSON metadata including description and hosted definition. + */ + @Generated + private final CreateAgentVersionFromCodeMetadata metadata; + + /* + * The code zip file (max 250 MB). + */ + @Generated + private final CodeFileDetails code; + + /** + * Creates an instance of CreateAgentVersionFromCodeContent class. + * + * @param metadata the metadata value to set. + * @param code the code value to set. + */ + @Generated + public CreateAgentVersionFromCodeContent(CreateAgentVersionFromCodeMetadata metadata, CodeFileDetails code) { + this.metadata = metadata; + this.code = code; + } + + /** + * Get the metadata property: JSON metadata including description and hosted definition. + * + * @return the metadata value. + */ + @Generated + public CreateAgentVersionFromCodeMetadata getMetadata() { + return this.metadata; + } + + /** + * Get the code property: The code zip file (max 250 MB). + * + * @return the code value. + */ + @Generated + public CodeFileDetails getCode() { + return this.code; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateSkillRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeMetadata.java similarity index 59% rename from sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateSkillRequest.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeMetadata.java index 9e6235dff4c1..087443b76b8c 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateSkillRequest.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeMetadata.java @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.projects.implementation.models; +package com.azure.ai.agents.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; @@ -13,29 +13,20 @@ import java.util.Map; /** - * The CreateSkillRequest model. + * JSON metadata for code-based agent operations (create, update, create version). + * The agent name comes from the URL path parameter or the `x-ms-agent-name` header, + * so it is not included in this model. + * The content hash (SHA-256 of the zip) is carried in the `x-ms-code-zip-sha256` header. */ @Fluent -public final class CreateSkillRequest implements JsonSerializable { +public final class CreateAgentVersionFromCodeMetadata implements JsonSerializable { /* - * The unique name of the skill. - */ - @Generated - private final String name; - - /* - * A human-readable description of the skill. + * A human-readable description of the agent. */ @Generated private String description; - /* - * Instructions that define the behavior of the skill. - */ - @Generated - private String instructions; - /* * Set of 16 key-value pairs that can be attached to an object. This can be * useful for storing additional information about the object in a structured @@ -47,28 +38,25 @@ public final class CreateSkillRequest implements JsonSerializable metadata; - /** - * Creates an instance of CreateSkillRequest class. - * - * @param name the name value to set. + /* + * The hosted agent definition including code_configuration (runtime, entry_point), cpu, memory, and + * protocol_versions. */ @Generated - public CreateSkillRequest(String name) { - this.name = name; - } + private final HostedAgentDefinition definition; /** - * Get the name property: The unique name of the skill. + * Creates an instance of CreateAgentVersionFromCodeMetadata class. * - * @return the name value. + * @param definition the definition value to set. */ @Generated - public String getName() { - return this.name; + public CreateAgentVersionFromCodeMetadata(HostedAgentDefinition definition) { + this.definition = definition; } /** - * Get the description property: A human-readable description of the skill. + * Get the description property: A human-readable description of the agent. * * @return the description value. */ @@ -78,39 +66,17 @@ public String getDescription() { } /** - * Set the description property: A human-readable description of the skill. + * Set the description property: A human-readable description of the agent. * * @param description the description value to set. - * @return the CreateSkillRequest object itself. + * @return the CreateAgentVersionFromCodeMetadata object itself. */ @Generated - public CreateSkillRequest setDescription(String description) { + public CreateAgentVersionFromCodeMetadata setDescription(String description) { this.description = description; return this; } - /** - * Get the instructions property: Instructions that define the behavior of the skill. - * - * @return the instructions value. - */ - @Generated - public String getInstructions() { - return this.instructions; - } - - /** - * Set the instructions property: Instructions that define the behavior of the skill. - * - * @param instructions the instructions value to set. - * @return the CreateSkillRequest object itself. - */ - @Generated - public CreateSkillRequest setInstructions(String instructions) { - this.instructions = instructions; - return this; - } - /** * Get the metadata property: Set of 16 key-value pairs that can be attached to an object. This can be * useful for storing additional information about the object in a structured @@ -135,14 +101,25 @@ public Map getMetadata() { * with a maximum length of 512 characters. * * @param metadata the metadata value to set. - * @return the CreateSkillRequest object itself. + * @return the CreateAgentVersionFromCodeMetadata object itself. */ @Generated - public CreateSkillRequest setMetadata(Map metadata) { + public CreateAgentVersionFromCodeMetadata setMetadata(Map metadata) { this.metadata = metadata; return this; } + /** + * Get the definition property: The hosted agent definition including code_configuration (runtime, entry_point), + * cpu, memory, and protocol_versions. + * + * @return the definition value. + */ + @Generated + public HostedAgentDefinition getDefinition() { + return this.definition; + } + /** * {@inheritDoc} */ @@ -150,49 +127,45 @@ public CreateSkillRequest setMetadata(Map metadata) { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("definition", this.definition); jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("instructions", this.instructions); jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); return jsonWriter.writeEndObject(); } /** - * Reads an instance of CreateSkillRequest from the JsonReader. + * Reads an instance of CreateAgentVersionFromCodeMetadata from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of CreateSkillRequest if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of CreateAgentVersionFromCodeMetadata if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CreateSkillRequest. + * @throws IOException If an error occurs while reading the CreateAgentVersionFromCodeMetadata. */ @Generated - public static CreateSkillRequest fromJson(JsonReader jsonReader) throws IOException { + public static CreateAgentVersionFromCodeMetadata fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String name = null; + HostedAgentDefinition definition = null; String description = null; - String instructions = null; Map metadata = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("name".equals(fieldName)) { - name = reader.getString(); + if ("definition".equals(fieldName)) { + definition = HostedAgentDefinition.fromJson(reader); } else if ("description".equals(fieldName)) { description = reader.getString(); - } else if ("instructions".equals(fieldName)) { - instructions = reader.getString(); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); } else { reader.skipChildren(); } } - CreateSkillRequest deserializedCreateSkillRequest = new CreateSkillRequest(name); - deserializedCreateSkillRequest.description = description; - deserializedCreateSkillRequest.instructions = instructions; - deserializedCreateSkillRequest.metadata = metadata; - return deserializedCreateSkillRequest; + CreateAgentVersionFromCodeMetadata deserializedCreateAgentVersionFromCodeMetadata + = new CreateAgentVersionFromCodeMetadata(definition); + deserializedCreateAgentVersionFromCodeMetadata.description = description; + deserializedCreateAgentVersionFromCodeMetadata.metadata = metadata; + return deserializedCreateAgentVersionFromCodeMetadata; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DatasetInfo.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DatasetInfo.java new file mode 100644 index 000000000000..bf416b7d2a7a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DatasetInfo.java @@ -0,0 +1,147 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Metadata about the dataset used for optimization, surfaced in the response. + */ +@Immutable +public final class DatasetInfo implements JsonSerializable { + + /* + * Dataset name when using a registered dataset reference. Null for inline datasets. + */ + @Generated + private String name; + + /* + * Dataset version when using a registered dataset reference. Null for inline datasets. + */ + @Generated + private String version; + + /* + * Number of tasks/rows in the dataset. + */ + @Generated + private final int taskCount; + + /* + * True when the dataset was provided inline in the request body. + */ + @Generated + private final boolean isInline; + + /** + * Creates an instance of DatasetInfo class. + * + * @param taskCount the taskCount value to set. + * @param isInline the isInline value to set. + */ + @Generated + private DatasetInfo(int taskCount, boolean isInline) { + this.taskCount = taskCount; + this.isInline = isInline; + } + + /** + * Get the name property: Dataset name when using a registered dataset reference. Null for inline datasets. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: Dataset version when using a registered dataset reference. Null for inline datasets. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the taskCount property: Number of tasks/rows in the dataset. + * + * @return the taskCount value. + */ + @Generated + public int getTaskCount() { + return this.taskCount; + } + + /** + * Get the isInline property: True when the dataset was provided inline in the request body. + * + * @return the isInline value. + */ + @Generated + public boolean isInline() { + return this.isInline; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("task_count", this.taskCount); + jsonWriter.writeBooleanField("is_inline", this.isInline); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatasetInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatasetInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatasetInfo. + */ + @Generated + public static DatasetInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int taskCount = 0; + boolean isInline = false; + String name = null; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("task_count".equals(fieldName)) { + taskCount = reader.getInt(); + } else if ("is_inline".equals(fieldName)) { + isInline = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + DatasetInfo deserializedDatasetInfo = new DatasetInfo(taskCount, isInline); + deserializedDatasetInfo.name = name; + deserializedDatasetInfo.version = version; + return deserializedDatasetInfo; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DatasetRef.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DatasetRef.java new file mode 100644 index 000000000000..397f1a0fe424 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DatasetRef.java @@ -0,0 +1,116 @@ +// 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; + +/** + * Reference to a registered dataset in the Foundry Dataset Service. + */ +@Fluent +public final class DatasetRef implements JsonSerializable { + + /* + * Dataset name. + */ + @Generated + private final String name; + + /* + * Dataset version. If not specified, the latest version is used. + */ + @Generated + private String version; + + /** + * Creates an instance of DatasetRef class. + * + * @param name the name value to set. + */ + @Generated + public DatasetRef(String name) { + this.name = name; + } + + /** + * Get the name property: Dataset name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: Dataset version. If not specified, the latest version is used. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Set the version property: Dataset version. If not specified, the latest version is used. + * + * @param version the version value to set. + * @return the DatasetRef object itself. + */ + @Generated + public DatasetRef setVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatasetRef from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatasetRef if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatasetRef. + */ + @Generated + public static DatasetRef fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + DatasetRef deserializedDatasetRef = new DatasetRef(name); + deserializedDatasetRef.version = version; + return deserializedDatasetRef; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EntraAuthorizationScheme.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EntraAuthorizationScheme.java index 706ee54cfd87..8f34e5615547 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EntraAuthorizationScheme.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EntraAuthorizationScheme.java @@ -25,12 +25,6 @@ public final class EntraAuthorizationScheme extends AgentEndpointAuthorizationSc @Generated private AgentEndpointAuthorizationSchemeType type = AgentEndpointAuthorizationSchemeType.ENTRA; - /* - * The isolation_key_source property. - */ - @Generated - private IsolationKeySource isolationKeySource; - /** * Stores updated model property, the value is property name, not serialized name. */ @@ -55,30 +49,6 @@ public AgentEndpointAuthorizationSchemeType getType() { return this.type; } - /** - * Get the isolationKeySource property: The isolation_key_source property. - * - * @return the isolationKeySource value. - */ - @Generated - public IsolationKeySource getIsolationKeySource() { - return this.isolationKeySource; - } - - /** - * Set the isolationKeySource property: The isolation_key_source property. - *

Required when create the resource.

- * - * @param isolationKeySource the isolationKeySource value to set. - * @return the EntraAuthorizationScheme object itself. - */ - @Generated - public EntraAuthorizationScheme setIsolationKeySource(IsolationKeySource isolationKeySource) { - this.isolationKeySource = isolationKeySource; - this.updatedProperties.add("isolationKeySource"); - return this; - } - /** * {@inheritDoc} */ @@ -140,4 +110,36 @@ public static EntraAuthorizationScheme fromJson(JsonReader jsonReader) throws IO return deserializedEntraAuthorizationScheme; }); } + + /* + * The source from which the per-user isolation key is derived for requests authorized via this scheme. Defaults to + * Entra-based isolation when omitted. + */ + @Generated + private IsolationKeySource isolationKeySource; + + /** + * Get the isolationKeySource property: The source from which the per-user isolation key is derived for requests + * authorized via this scheme. Defaults to Entra-based isolation when omitted. + * + * @return the isolationKeySource value. + */ + @Generated + public IsolationKeySource getIsolationKeySource() { + return this.isolationKeySource; + } + + /** + * Set the isolationKeySource property: The source from which the per-user isolation key is derived for requests + * authorized via this scheme. Defaults to Entra-based isolation when omitted. + * + * @param isolationKeySource the isolationKeySource value to set. + * @return the EntraAuthorizationScheme object itself. + */ + @Generated + public EntraAuthorizationScheme setIsolationKeySource(IsolationKeySource isolationKeySource) { + this.isolationKeySource = isolationKeySource; + this.updatedProperties.add("isolationKeySource"); + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EvaluationLevel.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EvaluationLevel.java new file mode 100644 index 000000000000..211f44e6956f --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/EvaluationLevel.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 level at which evaluation is performed. + */ +public final class EvaluationLevel extends ExpandableStringEnum { + + /** + * Evaluation is performed at the turn level. + */ + @Generated + public static final EvaluationLevel TURN = fromString("turn"); + + /** + * Evaluation is performed at the conversation level. + */ + @Generated + public static final EvaluationLevel CONVERSATION = fromString("conversation"); + + /** + * Creates a new instance of EvaluationLevel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public EvaluationLevel() { + } + + /** + * Creates or finds a EvaluationLevel from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvaluationLevel. + */ + @Generated + public static EvaluationLevel fromString(String name) { + return fromString(name, EvaluationLevel.class); + } + + /** + * Gets known EvaluationLevel values. + * + * @return known EvaluationLevel values. + */ + @Generated + public static Collection values() { + return values(EvaluationLevel.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ExternalAgentDefinition.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ExternalAgentDefinition.java new file mode 100644 index 000000000000..6168d3b769e4 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ExternalAgentDefinition.java @@ -0,0 +1,139 @@ +// 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.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The external agent definition. Represents a third-party agent hosted outside Foundry (for example, on GCP or AWS). + * Registration is metadata-only: Foundry records the agent definition to light up observability experiences (traces, + * evaluations) + * over customer-emitted OpenTelemetry data. + */ +@Fluent +public final class ExternalAgentDefinition extends AgentDefinition { + + /* + * The kind property. + */ + @Generated + private AgentKind kind = AgentKind.EXTERNAL; + + /* + * The OpenTelemetry agent identifier used to attribute customer-emitted spans to this Foundry agent. + * Spans must include the attribute `gen_ai.agent.id = ` to appear under this registration. + * Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios + * where the running external agent already emits a stable id that differs from the Foundry agent name. + * The resolved value is always echoed on read. + */ + @Generated + private String otelAgentId; + + /** + * Creates an instance of ExternalAgentDefinition class. + */ + @Generated + public ExternalAgentDefinition() { + } + + /** + * Get the kind property: The kind property. + * + * @return the kind value. + */ + @Generated + @Override + public AgentKind getKind() { + return this.kind; + } + + /** + * Get the otelAgentId property: The OpenTelemetry agent identifier used to attribute customer-emitted spans to this + * Foundry agent. + * Spans must include the attribute `gen_ai.agent.id = <otel_agent_id>` to appear under this registration. + * Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios + * where the running external agent already emits a stable id that differs from the Foundry agent name. + * The resolved value is always echoed on read. + * + * @return the otelAgentId value. + */ + @Generated + public String getOtelAgentId() { + return this.otelAgentId; + } + + /** + * Set the otelAgentId property: The OpenTelemetry agent identifier used to attribute customer-emitted spans to this + * Foundry agent. + * Spans must include the attribute `gen_ai.agent.id = <otel_agent_id>` to appear under this registration. + * Defaults to the top-level agent name when omitted. Provide an explicit value only for migration scenarios + * where the running external agent already emits a stable id that differs from the Foundry agent name. + * The resolved value is always echoed on read. + * + * @param otelAgentId the otelAgentId value to set. + * @return the ExternalAgentDefinition object itself. + */ + @Generated + public ExternalAgentDefinition setOtelAgentId(String otelAgentId) { + this.otelAgentId = otelAgentId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public ExternalAgentDefinition setRaiConfig(RaiConfig raiConfig) { + super.setRaiConfig(raiConfig); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("rai_config", getRaiConfig()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeStringField("otel_agent_id", this.otelAgentId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ExternalAgentDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ExternalAgentDefinition 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 ExternalAgentDefinition. + */ + @Generated + public static ExternalAgentDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ExternalAgentDefinition deserializedExternalAgentDefinition = new ExternalAgentDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("rai_config".equals(fieldName)) { + deserializedExternalAgentDefinition.setRaiConfig(RaiConfig.fromJson(reader)); + } else if ("kind".equals(fieldName)) { + deserializedExternalAgentDefinition.kind = AgentKind.fromString(reader.getString()); + } else if ("otel_agent_id".equals(fieldName)) { + deserializedExternalAgentDefinition.otelAgentId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedExternalAgentDefinition; + }); + } +} 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 new file mode 100644 index 000000000000..13cb085a551b --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCall.java @@ -0,0 +1,143 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A Fabric data agent tool call. + */ +@Immutable +public final class FabricDataAgentToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "fabric_dataagent_preview_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of FabricDataAgentToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public FabricDataAgentToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricDataAgentToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricDataAgentToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricDataAgentToolCall. + */ + @Generated + public static FabricDataAgentToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new FabricDataAgentToolCall(callId, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCallOutput.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java index bbc33c4d29ca..44a81a6d12a2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCallOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java @@ -1,59 +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.implementation.models; +package com.azure.ai.agents.models; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; /** - * Custom tool call output - * - * The output of a custom tool call from your code, being sent back to the model. + * The output of a Fabric data agent tool call. */ @Fluent -public final class InputItemCustomToolCallOutput extends InputItem { +public final class FabricDataAgentToolCallOutput implements JsonSerializable { /* * The type property. */ @Generated - private InputItemType type = InputItemType.CUSTOM_TOOL_CALL_OUTPUT; + private final String type = "fabric_dataagent_preview_call_output"; /* - * The unique ID of the custom tool call output in the OpenAI platform. + * The unique ID of the tool call generated by the model. */ @Generated - private String id; + private final String callId; /* - * The call ID, used to map this custom tool call output to a custom tool call. + * The output from the Fabric data agent tool call. */ @Generated - private final String callId; + private BinaryData output; /* - * The output from the custom tool call generated by your code. - * Can be a string or an list of output content. + * The status of the tool call. */ @Generated - private final BinaryData output; + private final ToolCallStatus status; /** - * Creates an instance of InputItemCustomToolCallOutput class. + * Creates an instance of FabricDataAgentToolCallOutput class. * * @param callId the callId value to set. - * @param output the output value to set. + * @param status the status value to set. */ @Generated - public InputItemCustomToolCallOutput(String callId, BinaryData output) { + public FabricDataAgentToolCallOutput(String callId, ToolCallStatus status) { this.callId = callId; - this.output = output; + this.status = status; } /** @@ -62,52 +60,50 @@ public InputItemCustomToolCallOutput(String callId, BinaryData output) { * @return the type value. */ @Generated - @Override - public InputItemType getType() { + public String getType() { return this.type; } /** - * Get the id property: The unique ID of the custom tool call output in the OpenAI platform. + * Get the callId property: The unique ID of the tool call generated by the model. * - * @return the id value. + * @return the callId value. */ @Generated - public String getId() { - return this.id; + public String getCallId() { + return this.callId; } /** - * Set the id property: The unique ID of the custom tool call output in the OpenAI platform. + * Get the output property: The output from the Fabric data agent tool call. * - * @param id the id value to set. - * @return the InputItemCustomToolCallOutput object itself. + * @return the output value. */ @Generated - public InputItemCustomToolCallOutput setId(String id) { - this.id = id; - return this; + public BinaryData getOutput() { + return this.output; } /** - * Get the callId property: The call ID, used to map this custom tool call output to a custom tool call. + * Set the output property: The output from the Fabric data agent tool call. * - * @return the callId value. + * @param output the output value to set. + * @return the FabricDataAgentToolCallOutput object itself. */ @Generated - public String getCallId() { - return this.callId; + public FabricDataAgentToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; } /** - * Get the output property: The output from the custom tool call generated by your code. - * Can be a string or an list of output content. + * Get the status property: The status of the tool call. * - * @return the output value. + * @return the status value. */ @Generated - public BinaryData getOutput() { - return this.output; + public ToolCallStatus getStatus() { + return this.status; } /** @@ -117,50 +113,48 @@ public BinaryData getOutput() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeFieldName("output"); - this.output.writeTo(jsonWriter); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } return jsonWriter.writeEndObject(); } /** - * Reads an instance of InputItemCustomToolCallOutput from the JsonReader. + * Reads an instance of FabricDataAgentToolCallOutput from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of InputItemCustomToolCallOutput if the JsonReader was pointing to an instance of it, or null + * @return An instance of FabricDataAgentToolCallOutput if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the InputItemCustomToolCallOutput. + * @throws IOException If an error occurs while reading the FabricDataAgentToolCallOutput. */ @Generated - public static InputItemCustomToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + public static FabricDataAgentToolCallOutput fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String callId = null; + ToolCallStatus status = null; BinaryData output = null; - InputItemType type = InputItemType.CUSTOM_TOOL_CALL_OUTPUT; - String id = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("call_id".equals(fieldName)) { callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); } else if ("output".equals(fieldName)) { output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("type".equals(fieldName)) { - type = InputItemType.fromString(reader.getString()); - } else if ("id".equals(fieldName)) { - id = reader.getString(); } else { reader.skipChildren(); } } - InputItemCustomToolCallOutput deserializedInputItemCustomToolCallOutput - = new InputItemCustomToolCallOutput(callId, output); - deserializedInputItemCustomToolCallOutput.type = type; - deserializedInputItemCustomToolCallOutput.id = id; - return deserializedInputItemCustomToolCallOutput; + FabricDataAgentToolCallOutput deserializedFabricDataAgentToolCallOutput + = new FabricDataAgentToolCallOutput(callId, status); + deserializedFabricDataAgentToolCallOutput.output = output; + return deserializedFabricDataAgentToolCallOutput; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricIqPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricIqPreviewTool.java new file mode 100644 index 000000000000..6c2004657f18 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FabricIqPreviewTool.java @@ -0,0 +1,372 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A FabricIQ server-side tool. + */ +@Fluent +public final class FabricIqPreviewTool extends Tool { + + /* + * The type property. + */ + @Generated + private ToolType type = ToolType.FABRIC_IQ_PREVIEW; + + /* + * The ID of the FabricIQ project connection. + */ + @Generated + private final String projectConnectionId; + + /* + * (Optional) The label of the FabricIQ MCP server to connect to. + */ + @Generated + private String serverLabel; + + /* + * (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the project connection will be used. + */ + @Generated + private String serverUrl; + + /* + * (Optional) Whether the agent requires approval before executing actions. Default is always. + */ + @Generated + private BinaryData requireApproval; + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Creates an instance of FabricIqPreviewTool class. + * + * @param projectConnectionId the projectConnectionId value to set. + */ + @Generated + public FabricIqPreviewTool(String projectConnectionId) { + this.projectConnectionId = projectConnectionId; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public ToolType getType() { + return this.type; + } + + /** + * Get the projectConnectionId property: The ID of the FabricIQ project connection. + * + * @return the projectConnectionId value. + */ + @Generated + public String getProjectConnectionId() { + return this.projectConnectionId; + } + + /** + * Get the serverLabel property: (Optional) The label of the FabricIQ MCP server to connect to. + * + * @return the serverLabel value. + */ + @Generated + public String getServerLabel() { + return this.serverLabel; + } + + /** + * Set the serverLabel property: (Optional) The label of the FabricIQ MCP server to connect to. + * + * @param serverLabel the serverLabel value to set. + * @return the FabricIqPreviewTool object itself. + */ + @Generated + public FabricIqPreviewTool setServerLabel(String serverLabel) { + this.serverLabel = serverLabel; + return this; + } + + /** + * Get the serverUrl property: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the + * project connection will be used. + * + * @return the serverUrl value. + */ + @Generated + public String getServerUrl() { + return this.serverUrl; + } + + /** + * Set the serverUrl property: (Optional) The URL of the FabricIQ MCP server. If not provided, the URL from the + * project connection will be used. + * + * @param serverUrl the serverUrl value to set. + * @return the FabricIqPreviewTool object itself. + */ + @Generated + public FabricIqPreviewTool setServerUrl(String serverUrl) { + this.serverUrl = serverUrl; + return this; + } + + /** + * Get the requireApproval property: (Optional) Whether the agent requires approval before executing actions. + * Default is always. + * + * @return the requireApproval value. + */ + @Generated + public BinaryData getRequireApproval() { + return this.requireApproval; + } + + /** + * Set the requireApproval property: (Optional) Whether the agent requires approval before executing actions. + * Default is always. + * + * @param requireApproval the requireApproval value to set. + * @return the FabricIqPreviewTool object itself. + */ + @Generated + public FabricIqPreviewTool setRequireApproval(BinaryData requireApproval) { + this.requireApproval = requireApproval; + return this; + } + + /** + * Set the requireApproval property: (Optional) Whether the agent requires approval before executing actions. + * Default is always. + * + * @param requireApproval the approval setting string to set (e.g., "always" or "never"). + * @return the FabricIqPreviewTool object itself. + */ + public FabricIqPreviewTool setRequireApproval(String requireApproval) { + // AI Tooling: union type + this.requireApproval = BinaryData.fromString(requireApproval); + return this; + } + + /** + * Set the requireApproval property: (Optional) Whether the agent requires approval before executing actions. + * Default is always. + * + * @param requireApproval the {@link McpToolRequireApproval} filter to set. + * @return the FabricIqPreviewTool object itself. + */ + public FabricIqPreviewTool setRequireApproval(McpToolRequireApproval requireApproval) { + // AI Tooling: union type + this.requireApproval = BinaryData.fromObject(requireApproval); + return this; + } + + /** + * Get the requireApproval property: (Optional) Whether the agent requires approval before executing actions. + * Default is always. + * + * @return the requireApproval value as a String. + */ + public String getRequireApprovalAsString() { + // AI Tooling: union type + if (this.requireApproval == null) { + return null; + } + return this.requireApproval.toObject(String.class); + } + + /** + * Get the requireApproval property: (Optional) Whether the agent requires approval before executing actions. + * Default is always. + * + * @return the requireApproval value as a {@link McpToolRequireApproval}. + */ + public McpToolRequireApproval getRequireApprovalAsMcpToolRequireApproval() { + // AI Tooling: union type + if (this.requireApproval == null) { + return null; + } + return this.requireApproval.toObject(McpToolRequireApproval.class); + } + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the FabricIqPreviewTool object itself. + */ + @Generated + public FabricIqPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the FabricIqPreviewTool object itself. + */ + @Generated + public FabricIqPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the FabricIqPreviewTool object itself. + */ + @Generated + public FabricIqPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("project_connection_id", this.projectConnectionId); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("server_label", this.serverLabel); + jsonWriter.writeStringField("server_url", this.serverUrl); + if (this.requireApproval != null) { + jsonWriter.writeFieldName("require_approval"); + this.requireApproval.writeTo(jsonWriter); + } + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FabricIqPreviewTool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FabricIqPreviewTool if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FabricIqPreviewTool. + */ + @Generated + public static FabricIqPreviewTool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String projectConnectionId = null; + ToolType type = ToolType.FABRIC_IQ_PREVIEW; + String serverLabel = null; + String serverUrl = null; + BinaryData requireApproval = null; + String name = null; + String description = null; + Map toolConfigs = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("project_connection_id".equals(fieldName)) { + projectConnectionId = reader.getString(); + } else if ("type".equals(fieldName)) { + type = ToolType.fromString(reader.getString()); + } else if ("server_label".equals(fieldName)) { + serverLabel = reader.getString(); + } else if ("server_url".equals(fieldName)) { + serverUrl = reader.getString(); + } else if ("require_approval".equals(fieldName)) { + requireApproval + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + FabricIqPreviewTool deserializedFabricIqPreviewTool = new FabricIqPreviewTool(projectConnectionId); + deserializedFabricIqPreviewTool.type = type; + deserializedFabricIqPreviewTool.serverLabel = serverLabel; + deserializedFabricIqPreviewTool.serverUrl = serverUrl; + deserializedFabricIqPreviewTool.requireApproval = requireApproval; + deserializedFabricIqPreviewTool.name = name; + deserializedFabricIqPreviewTool.description = description; + deserializedFabricIqPreviewTool.toolConfigs = toolConfigs; + return deserializedFabricIqPreviewTool; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java index fd2076c29a01..98eed1412e07 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java @@ -13,6 +13,7 @@ import com.openai.models.CompoundFilter; import java.io.IOException; import java.util.List; +import java.util.Map; /** * File search @@ -118,6 +119,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -140,6 +142,7 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException BinaryData filters = null; String name = null; String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -157,6 +160,8 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -168,6 +173,7 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException deserializedFileSearchTool.filters = filters; deserializedFileSearchTool.name = name; deserializedFileSearchTool.description = description; + deserializedFileSearchTool.toolConfigs = toolConfigs; return deserializedFileSearchTool; }); } @@ -239,6 +245,21 @@ public FileSearchTool setComparisonFilter(ComparisonFilter filter) { return this; } + /** + * Gets the file search filters as an openai-java {@link ComparisonFilter}. + * + * @return the openai-java ComparisonFilter, or {@code null} if filters are not set or contain a different filter + * type. + */ + public ComparisonFilter getComparisonFilter() { + // AI Tooling: openai-java de-dup + Object filter = getOpenAIFileSearchFilter(); + if (filter instanceof ComparisonFilter) { + return (ComparisonFilter) filter; + } + return null; + } + /** * Sets the file search filters using an openai-java {@link CompoundFilter}. *

@@ -254,6 +275,51 @@ public FileSearchTool setCompoundFilter(CompoundFilter filter) { return this; } + /** + * Gets the file search filters as an openai-java {@link CompoundFilter}. + * + * @return the openai-java CompoundFilter, or {@code null} if filters are not set or contain a different filter + * type. + */ + public CompoundFilter getCompoundFilter() { + // AI Tooling: openai-java de-dup + Object filter = getOpenAIFileSearchFilter(); + if (filter instanceof CompoundFilter) { + return (CompoundFilter) filter; + } + return null; + } + + private Object getOpenAIFileSearchFilter() { + // AI Tooling: openai-java de-dup + com.openai.models.responses.FileSearchTool.Filters filter = com.azure.ai.agents.implementation.OpenAIJsonHelper + .fromBinaryData(this.filters, com.openai.models.responses.FileSearchTool.Filters.class); + if (filter == null) { + return null; + } + if (filter.isComparisonFilter()) { + ComparisonFilter comparisonFilter = filter.asComparisonFilter(); + if (!comparisonFilter._key().isMissing() + && !comparisonFilter._key().isNull() + && !comparisonFilter._type().isMissing() + && !comparisonFilter._type().isNull() + && !comparisonFilter._value().isMissing() + && !comparisonFilter._value().isNull()) { + return comparisonFilter; + } + } + if (filter.isCompoundFilter()) { + CompoundFilter compoundFilter = filter.asCompoundFilter(); + if (!compoundFilter._type().isMissing() + && !compoundFilter._type().isNull() + && !compoundFilter._filters().isMissing() + && !compoundFilter._filters().isNull()) { + return compoundFilter; + } + } + return null; + } + /* * Optional user-defined name for this tool or configuration. */ @@ -309,4 +375,38 @@ public FileSearchTool setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the FileSearchTool object itself. + */ + @Generated + public FileSearchTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FixedRatioVersionSelectionRule.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FixedRatioVersionSelectionRule.java index 9b7ac82251cb..80ebec2ec6e0 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FixedRatioVersionSelectionRule.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FixedRatioVersionSelectionRule.java @@ -40,8 +40,17 @@ public final class FixedRatioVersionSelectionRule extends VersionSelectionRule { /** * Creates an instance of FixedRatioVersionSelectionRule class. */ - @Generated - public FixedRatioVersionSelectionRule() { + FixedRatioVersionSelectionRule() { + } + + /** + * Creates an instance of FixedRatioVersionSelectionRule class. + * + * @param trafficPercentage the percentage of traffic to route to the version. Must be between 0 and 100. + */ + public FixedRatioVersionSelectionRule(int trafficPercentage) { + this.trafficPercentage = trafficPercentage; + this.updatedProperties.add("trafficPercentage"); } /** diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java index 3aa02501ebfe..53346b08034c 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java @@ -33,6 +33,11 @@ public enum FoundryFeaturesOptInKeys { */ MEMORY_STORES_V1_PREVIEW("MemoryStores=V1Preview"), + /** + * Enum value Routines=V1Preview. + */ + ROUTINES_V1_PREVIEW("Routines=V1Preview"), + /** * Enum value Toolboxes=V1Preview. */ @@ -41,7 +46,22 @@ public enum FoundryFeaturesOptInKeys { /** * Enum value Skills=V1Preview. */ - SKILLS_V1_PREVIEW("Skills=V1Preview"); + SKILLS_V1_PREVIEW("Skills=V1Preview"), + + /** + * Enum value DataGenerationJobs=V1Preview. + */ + DATA_GENERATION_JOBS_V1_PREVIEW("DataGenerationJobs=V1Preview"), + + /** + * Enum value Models=V1Preview. + */ + MODELS_V1_PREVIEW("Models=V1Preview"), + + /** + * Enum value AgentsOptimization=V1Preview. + */ + AGENTS_OPTIMIZATION_V1_PREVIEW("AgentsOptimization=V1Preview"); /** * The actual serialized value for a FoundryFeaturesOptInKeys instance. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellToolParameter.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellToolParameter.java index d95c33d7398d..4bd14c443cfc 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellToolParameter.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellToolParameter.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Shell tool @@ -81,6 +82,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("environment", this.environment); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -108,6 +110,9 @@ public static FunctionShellToolParameter fromJson(JsonReader jsonReader) throws deserializedFunctionShellToolParameter.name = reader.getString(); } else if ("description".equals(fieldName)) { deserializedFunctionShellToolParameter.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedFunctionShellToolParameter.toolConfigs = toolConfigs; } else { reader.skipChildren(); } @@ -171,4 +176,38 @@ public FunctionShellToolParameter setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the FunctionShellToolParameter object itself. + */ + @Generated + public FunctionShellToolParameter setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderIsolationKeySource.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderIsolationKeySource.java index c29c338d2304..71ad0305bce6 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderIsolationKeySource.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderIsolationKeySource.java @@ -4,8 +4,8 @@ package com.azure.ai.agents.models; import com.azure.ai.agents.implementation.JsonMergePatchHelper; -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; @@ -16,7 +16,7 @@ /** * The HeaderIsolationKeySource model. */ -@Fluent +@Immutable public final class HeaderIsolationKeySource extends IsolationKeySource { /* @@ -25,18 +25,6 @@ public final class HeaderIsolationKeySource extends IsolationKeySource { @Generated private IsolationKeySourceKind kind = IsolationKeySourceKind.HEADER; - /* - * The user isolation key header value - */ - @Generated - private String userIsolationKey; - - /* - * The chat isolation key header value - */ - @Generated - private String chatIsolationKey; - /** * Stores updated model property, the value is property name, not serialized name. */ @@ -61,54 +49,6 @@ public IsolationKeySourceKind getKind() { return this.kind; } - /** - * Get the userIsolationKey property: The user isolation key header value. - * - * @return the userIsolationKey value. - */ - @Generated - public String getUserIsolationKey() { - return this.userIsolationKey; - } - - /** - * Set the userIsolationKey property: The user isolation key header value. - *

Required when create the resource.

- * - * @param userIsolationKey the userIsolationKey value to set. - * @return the HeaderIsolationKeySource object itself. - */ - @Generated - public HeaderIsolationKeySource setUserIsolationKey(String userIsolationKey) { - this.userIsolationKey = userIsolationKey; - this.updatedProperties.add("userIsolationKey"); - return this; - } - - /** - * Get the chatIsolationKey property: The chat isolation key header value. - * - * @return the chatIsolationKey value. - */ - @Generated - public String getChatIsolationKey() { - return this.chatIsolationKey; - } - - /** - * Set the chatIsolationKey property: The chat isolation key header value. - *

Required when create the resource.

- * - * @param chatIsolationKey the chatIsolationKey value to set. - * @return the HeaderIsolationKeySource object itself. - */ - @Generated - public HeaderIsolationKeySource setChatIsolationKey(String chatIsolationKey) { - this.chatIsolationKey = chatIsolationKey; - this.updatedProperties.add("chatIsolationKey"); - return this; - } - /** * {@inheritDoc} */ @@ -120,8 +60,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } else { jsonWriter.writeStartObject(); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeStringField("user_isolation_key", this.userIsolationKey); - jsonWriter.writeStringField("chat_isolation_key", this.chatIsolationKey); return jsonWriter.writeEndObject(); } } @@ -130,20 +68,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("kind", this.kind.toString()); - if (updatedProperties.contains("userIsolationKey")) { - if (this.userIsolationKey == null) { - jsonWriter.writeNullField("user_isolation_key"); - } else { - jsonWriter.writeStringField("user_isolation_key", this.userIsolationKey); - } - } - if (updatedProperties.contains("chatIsolationKey")) { - if (this.chatIsolationKey == null) { - jsonWriter.writeNullField("chat_isolation_key"); - } else { - jsonWriter.writeStringField("chat_isolation_key", this.chatIsolationKey); - } - } return jsonWriter.writeEndObject(); } @@ -164,10 +88,6 @@ public static HeaderIsolationKeySource fromJson(JsonReader jsonReader) throws IO reader.nextToken(); if ("kind".equals(fieldName)) { deserializedHeaderIsolationKeySource.kind = IsolationKeySourceKind.fromString(reader.getString()); - } else if ("user_isolation_key".equals(fieldName)) { - deserializedHeaderIsolationKeySource.userIsolationKey = reader.getString(); - } else if ("chat_isolation_key".equals(fieldName)) { - deserializedHeaderIsolationKeySource.chatIsolationKey = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderTelemetryEndpointAuth.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderTelemetryEndpointAuth.java new file mode 100644 index 000000000000..a54e42eb985e --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HeaderTelemetryEndpointAuth.java @@ -0,0 +1,149 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Header-based secret authentication for a telemetry endpoint. The resolved secret value is injected as an HTTP header. + */ +@Immutable +public final class HeaderTelemetryEndpointAuth extends TelemetryEndpointAuth { + + /* + * The authentication type. + */ + @Generated + private TelemetryEndpointAuthType type = TelemetryEndpointAuthType.HEADER; + + /* + * The name of the HTTP header to inject the secret value into. + */ + @Generated + private final String headerName; + + /* + * The identifier of the secret store or connection. + */ + @Generated + private final String secretId; + + /* + * The key within the secret to retrieve the authentication value. + */ + @Generated + private final String secretKey; + + /** + * Creates an instance of HeaderTelemetryEndpointAuth class. + * + * @param headerName the headerName value to set. + * @param secretId the secretId value to set. + * @param secretKey the secretKey value to set. + */ + @Generated + public HeaderTelemetryEndpointAuth(String headerName, String secretId, String secretKey) { + this.headerName = headerName; + this.secretId = secretId; + this.secretKey = secretKey; + } + + /** + * Get the type property: The authentication type. + * + * @return the type value. + */ + @Generated + @Override + public TelemetryEndpointAuthType getType() { + return this.type; + } + + /** + * Get the headerName property: The name of the HTTP header to inject the secret value into. + * + * @return the headerName value. + */ + @Generated + public String getHeaderName() { + return this.headerName; + } + + /** + * Get the secretId property: The identifier of the secret store or connection. + * + * @return the secretId value. + */ + @Generated + public String getSecretId() { + return this.secretId; + } + + /** + * Get the secretKey property: The key within the secret to retrieve the authentication value. + * + * @return the secretKey value. + */ + @Generated + public String getSecretKey() { + return this.secretKey; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("header_name", this.headerName); + jsonWriter.writeStringField("secret_id", this.secretId); + jsonWriter.writeStringField("secret_key", this.secretKey); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HeaderTelemetryEndpointAuth from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HeaderTelemetryEndpointAuth if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the HeaderTelemetryEndpointAuth. + */ + @Generated + public static HeaderTelemetryEndpointAuth fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String headerName = null; + String secretId = null; + String secretKey = null; + TelemetryEndpointAuthType type = TelemetryEndpointAuthType.HEADER; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("header_name".equals(fieldName)) { + headerName = reader.getString(); + } else if ("secret_id".equals(fieldName)) { + secretId = reader.getString(); + } else if ("secret_key".equals(fieldName)) { + secretKey = reader.getString(); + } else if ("type".equals(fieldName)) { + type = TelemetryEndpointAuthType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + HeaderTelemetryEndpointAuth deserializedHeaderTelemetryEndpointAuth + = new HeaderTelemetryEndpointAuth(headerName, secretId, secretKey); + deserializedHeaderTelemetryEndpointAuth.type = type; + return deserializedHeaderTelemetryEndpointAuth; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java index 2a4fa5ca0c73..d8b9c81a5fc1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java @@ -31,12 +31,6 @@ public final class HostedAgentDefinition extends AgentDefinition { @Generated private List tools; - /* - * The protocols that the agent supports for ingress communication of the containers. - */ - @Generated - private List containerProtocolVersions; - /* * The CPU configuration for the hosted agent. */ @@ -90,17 +84,6 @@ public HostedAgentDefinition setTools(List tools) { return this; } - /** - * Get the containerProtocolVersions property: The protocols that the agent supports for ingress communication of - * the containers. - * - * @return the containerProtocolVersions value. - */ - @Generated - public List getContainerProtocolVersions() { - return this.containerProtocolVersions; - } - /** * Get the cpu property: The CPU configuration for the hosted agent. * @@ -165,15 +148,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("memory", this.memory); jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeArrayField("container_protocol_versions", this.containerProtocolVersions, - (writer, element) -> writer.writeJson(element)); jsonWriter.writeMapField("environment_variables", this.environmentVariables, (writer, element) -> writer.writeString(element)); - jsonWriter.writeStringField("image", this.image); jsonWriter.writeJsonField("container_configuration", this.containerConfiguration); jsonWriter.writeArrayField("protocol_versions", this.protocolVersions, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("code_configuration", this.codeConfiguration); + jsonWriter.writeJsonField("telemetry_config", this.telemetryConfig); return jsonWriter.writeEndObject(); } @@ -194,12 +175,11 @@ public static HostedAgentDefinition fromJson(JsonReader jsonReader) throws IOExc String memory = null; AgentKind kind = AgentKind.HOSTED; List tools = null; - List containerProtocolVersions = null; Map environmentVariables = null; - String image = null; ContainerConfiguration containerConfiguration = null; List protocolVersions = null; CodeConfiguration codeConfiguration = null; + TelemetryConfig telemetryConfig = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -213,18 +193,16 @@ public static HostedAgentDefinition fromJson(JsonReader jsonReader) throws IOExc kind = AgentKind.fromString(reader.getString()); } else if ("tools".equals(fieldName)) { tools = reader.readArray(reader1 -> Tool.fromJson(reader1)); - } else if ("container_protocol_versions".equals(fieldName)) { - containerProtocolVersions = reader.readArray(reader1 -> ProtocolVersionRecord.fromJson(reader1)); } else if ("environment_variables".equals(fieldName)) { environmentVariables = reader.readMap(reader1 -> reader1.getString()); - } else if ("image".equals(fieldName)) { - image = reader.getString(); } else if ("container_configuration".equals(fieldName)) { containerConfiguration = ContainerConfiguration.fromJson(reader); } else if ("protocol_versions".equals(fieldName)) { protocolVersions = reader.readArray(reader1 -> ProtocolVersionRecord.fromJson(reader1)); } else if ("code_configuration".equals(fieldName)) { codeConfiguration = CodeConfiguration.fromJson(reader); + } else if ("telemetry_config".equals(fieldName)) { + telemetryConfig = TelemetryConfig.fromJson(reader); } else { reader.skipChildren(); } @@ -233,44 +211,15 @@ public static HostedAgentDefinition fromJson(JsonReader jsonReader) throws IOExc deserializedHostedAgentDefinition.setRaiConfig(raiConfig); deserializedHostedAgentDefinition.kind = kind; deserializedHostedAgentDefinition.tools = tools; - deserializedHostedAgentDefinition.containerProtocolVersions = containerProtocolVersions; deserializedHostedAgentDefinition.environmentVariables = environmentVariables; - deserializedHostedAgentDefinition.image = image; deserializedHostedAgentDefinition.containerConfiguration = containerConfiguration; deserializedHostedAgentDefinition.protocolVersions = protocolVersions; deserializedHostedAgentDefinition.codeConfiguration = codeConfiguration; + deserializedHostedAgentDefinition.telemetryConfig = telemetryConfig; return deserializedHostedAgentDefinition; }); } - /* - * The image ID for the agent, applicable to image-based hosted agents. - */ - @Generated - private String image; - - /** - * Get the image property: The image ID for the agent, applicable to image-based hosted agents. - * - * @return the image value. - */ - @Generated - public String getImage() { - return this.image; - } - - /** - * Set the image property: The image ID for the agent, applicable to image-based hosted agents. - * - * @param image the image value to set. - * @return the HostedAgentDefinition object itself. - */ - @Generated - public HostedAgentDefinition setImage(String image) { - this.image = image; - return this; - } - /* * Container-based deployment configuration. Provide this for image-based deployments. Mutually exclusive with * code_configuration — the service validates that exactly one is set. @@ -303,19 +252,6 @@ public HostedAgentDefinition(String cpu, String memory) { this.memory = memory; } - /** - * Set the containerProtocolVersions property: The protocols that the agent supports for ingress communication of - * the containers. - * - * @param containerProtocolVersions the containerProtocolVersions value to set. - * @return the HostedAgentDefinition object itself. - */ - @Generated - public HostedAgentDefinition setContainerProtocolVersions(List containerProtocolVersions) { - this.containerProtocolVersions = containerProtocolVersions; - return this; - } - /** * Get the containerConfiguration property: Container-based deployment configuration. Provide this for image-based * deployments. Mutually exclusive with code_configuration — the service validates that exactly one is set. @@ -386,16 +322,33 @@ public HostedAgentDefinition setCodeConfiguration(CodeConfiguration codeConfigur return this; } + /* + * Optional customer-supplied telemetry configuration for exporting container logs, traces, and metrics. + */ + @Generated + private TelemetryConfig telemetryConfig; + /** - * Creates an instance of HostedAgentDefinition class. + * Get the telemetryConfig property: Optional customer-supplied telemetry configuration for exporting container + * logs, traces, and metrics. * - * @param containerProtocolVersions the containerProtocolVersions value to set. - * @param cpu the cpu value to set. - * @param memory the memory value to set. + * @return the telemetryConfig value. */ - public HostedAgentDefinition(List containerProtocolVersions, String cpu, String memory) { - this.containerProtocolVersions = containerProtocolVersions; - this.cpu = cpu; - this.memory = memory; + @Generated + public TelemetryConfig getTelemetryConfig() { + return this.telemetryConfig; + } + + /** + * Set the telemetryConfig property: Optional customer-supplied telemetry configuration for exporting container + * logs, traces, and metrics. + * + * @param telemetryConfig the telemetryConfig value to set. + * @return the HostedAgentDefinition object itself. + */ + @Generated + public HostedAgentDefinition setTelemetryConfig(TelemetryConfig telemetryConfig) { + this.telemetryConfig = telemetryConfig; + return this; } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenTool.java index c544f14e3cd5..43bfffada030 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenTool.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Image generation tool @@ -308,6 +309,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -354,6 +356,9 @@ public static ImageGenTool fromJson(JsonReader jsonReader) throws IOException { deserializedImageGenTool.name = reader.getString(); } else if ("description".equals(fieldName)) { deserializedImageGenTool.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedImageGenTool.toolConfigs = toolConfigs; } else { reader.skipChildren(); } @@ -498,4 +503,38 @@ public ImageGenTool setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the ImageGenTool object itself. + */ + @Generated + public ImageGenTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/JobStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/JobStatus.java new file mode 100644 index 000000000000..4b055a994113 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/JobStatus.java @@ -0,0 +1,75 @@ +// 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; + +/** + * Extensible status values shared by Foundry jobs. + */ +public final class JobStatus extends ExpandableStringEnum { + + /** + * Job is waiting to start. + */ + @Generated + public static final JobStatus QUEUED = fromString("queued"); + + /** + * Job is actively processing. + */ + @Generated + public static final JobStatus IN_PROGRESS = fromString("in_progress"); + + /** + * Job completed successfully. + */ + @Generated + public static final JobStatus SUCCEEDED = fromString("succeeded"); + + /** + * Job failed. + */ + @Generated + public static final JobStatus FAILED = fromString("failed"); + + /** + * Job was cancelled by the caller. + */ + @Generated + public static final JobStatus CANCELLED = fromString("cancelled"); + + /** + * Creates a new instance of JobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public JobStatus() { + } + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + @Generated + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * Gets known JobStatus values. + * + * @return known JobStatus values. + */ + @Generated + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ListMemoriesOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ListMemoriesOptions.java new file mode 100644 index 000000000000..7515b042991b --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ListMemoriesOptions.java @@ -0,0 +1,224 @@ +// 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; + +/** + * Options for listMemories API. + */ +@Fluent +public final class ListMemoriesOptions { + + /* + * The name of the memory store. + */ + @Generated + private final String name; + + /* + * The kind of the memory item. + */ + @Generated + private MemoryItemKind kind; + + /* + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + */ + @Generated + private Integer limit; + + /* + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + */ + @Generated + private PageOrder order; + + /* + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + */ + @Generated + private String after; + + /* + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + */ + @Generated + private String before; + + /* + * The namespace that logically groups and isolates memories, such as a user ID. + */ + @Generated + private final String scope; + + /** + * Creates an instance of ListMemoriesOptions class. + * + * @param name the name value to set. + * @param scope the scope value to set. + */ + @Generated + public ListMemoriesOptions(String name, String scope) { + this.name = name; + this.scope = scope; + } + + /** + * Get the name property: The name of the memory store. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the kind property: The kind of the memory item. + * + * @return the kind value. + */ + @Generated + public MemoryItemKind getKind() { + return this.kind; + } + + /** + * Set the kind property: The kind of the memory item. + * + * @param kind the kind value to set. + * @return the ListMemoriesOptions object itself. + */ + @Generated + public ListMemoriesOptions setKind(MemoryItemKind kind) { + this.kind = kind; + return this; + } + + /** + * Get the limit property: A limit on the number of objects to be returned. Limit can range between 1 and 100, and + * the + * default is 20. + * + * @return the limit value. + */ + @Generated + public Integer getLimit() { + return this.limit; + } + + /** + * Set the limit property: A limit on the number of objects to be returned. Limit can range between 1 and 100, and + * the + * default is 20. + * + * @param limit the limit value to set. + * @return the ListMemoriesOptions object itself. + */ + @Generated + public ListMemoriesOptions setLimit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Get the order property: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order + * and`desc` + * for descending order. + * + * @return the order value. + */ + @Generated + public PageOrder getOrder() { + return this.order; + } + + /** + * Set the order property: Sort order by the `created_at` timestamp of the objects. `asc` for ascending order + * and`desc` + * for descending order. + * + * @param order the order value to set. + * @return the ListMemoriesOptions object itself. + */ + @Generated + public ListMemoriesOptions setOrder(PageOrder order) { + this.order = order; + return this; + } + + /** + * Get the after property: A cursor for use in pagination. `after` is an object ID that defines your place in the + * list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + * @return the after value. + */ + @Generated + public String getAfter() { + return this.after; + } + + /** + * Set the after property: A cursor for use in pagination. `after` is an object ID that defines your place in the + * list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + * @param after the after value to set. + * @return the ListMemoriesOptions object itself. + */ + @Generated + public ListMemoriesOptions setAfter(String after) { + this.after = after; + return this; + } + + /** + * Get the before property: A cursor for use in pagination. `before` is an object ID that defines your place in the + * list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + * @return the before value. + */ + @Generated + public String getBefore() { + return this.before; + } + + /** + * Set the before property: A cursor for use in pagination. `before` is an object ID that defines your place in the + * list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + * @param before the before value to set. + * @return the ListMemoriesOptions object itself. + */ + @Generated + public ListMemoriesOptions setBefore(String before) { + this.before = before; + return this; + } + + /** + * Get the scope property: The namespace that logically groups and isolates memories, such as a user ID. + * + * @return the scope value. + */ + @Generated + public String getScope() { + return this.scope; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParameter.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParameter.java index 64c2dcbbf82f..efa91a08af11 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParameter.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParameter.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * Local shell tool @@ -52,6 +53,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -76,6 +78,9 @@ public static LocalShellToolParameter fromJson(JsonReader jsonReader) throws IOE deserializedLocalShellToolParameter.name = reader.getString(); } else if ("description".equals(fieldName)) { deserializedLocalShellToolParameter.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedLocalShellToolParameter.toolConfigs = toolConfigs; } else { reader.skipChildren(); } @@ -139,4 +144,38 @@ public LocalShellToolParameter setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the LocalShellToolParameter object itself. + */ + @Generated + public LocalShellToolParameter setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/McpTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/McpTool.java index cfdf317b0419..fef484e701ba 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/McpTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/McpTool.java @@ -435,6 +435,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.requireApproval.writeTo(jsonWriter); } jsonWriter.writeStringField("project_connection_id", this.projectConnectionId); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -460,6 +461,7 @@ public static McpTool fromJson(JsonReader jsonReader) throws IOException { BinaryData allowedTools = null; BinaryData requireApproval = null; String projectConnectionId = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -485,6 +487,8 @@ public static McpTool fromJson(JsonReader jsonReader) throws IOException { = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); } else if ("project_connection_id".equals(fieldName)) { projectConnectionId = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -499,6 +503,7 @@ public static McpTool fromJson(JsonReader jsonReader) throws IOException { deserializedMcpTool.allowedTools = allowedTools; deserializedMcpTool.requireApproval = requireApproval; deserializedMcpTool.projectConnectionId = projectConnectionId; + deserializedMcpTool.toolConfigs = toolConfigs; return deserializedMcpTool; }); } @@ -525,4 +530,38 @@ public McpTool setConnectorType(McpToolConnectorId connectorType) { this.connectorType = connectorType; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the McpTool object itself. + */ + @Generated + public McpTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryCommandToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryCommandToolCall.java new file mode 100644 index 000000000000..9ff89224a468 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryCommandToolCall.java @@ -0,0 +1,144 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A memory command tool call. + */ +@Immutable +public final class MemoryCommandToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "memory_command_preview_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool, including `action` (`remember` or `forget`) and `content`. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of MemoryCommandToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public MemoryCommandToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool, including `action` (`remember` or + * `forget`) and `content`. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MemoryCommandToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MemoryCommandToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MemoryCommandToolCall. + */ + @Generated + public static MemoryCommandToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new MemoryCommandToolCall(callId, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryCommandToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryCommandToolCallOutput.java new file mode 100644 index 000000000000..11f83e773d67 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryCommandToolCallOutput.java @@ -0,0 +1,121 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of a memory command tool call. + */ +@Immutable +public final class MemoryCommandToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "memory_command_preview_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of MemoryCommandToolCallOutput class. + * + * @param callId the callId value to set. + * @param status the status value to set. + */ + @Generated + public MemoryCommandToolCallOutput(String callId, ToolCallStatus status) { + this.callId = callId; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MemoryCommandToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MemoryCommandToolCallOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MemoryCommandToolCallOutput. + */ + @Generated + public static MemoryCommandToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new MemoryCommandToolCallOutput(callId, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItem.java index 342431b6d01c..d1fa16618cee 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItem.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItem.java @@ -59,7 +59,7 @@ public class MemoryItem implements JsonSerializable { * @param content the content value to set. */ @Generated - protected MemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { + public MemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { this.memoryId = memoryId; if (updatedAt == null) { this.updatedAt = 0L; @@ -166,6 +166,8 @@ public static MemoryItem fromJson(JsonReader jsonReader) throws IOException { return UserProfileMemoryItem.fromJson(readerToUse.reset()); } else if ("chat_summary".equals(discriminatorValue)) { return ChatSummaryMemoryItem.fromJson(readerToUse.reset()); + } else if ("procedural".equals(discriminatorValue)) { + return ProceduralMemoryItem.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItemKind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItemKind.java index 7cdb84c75594..6db3e0b32123 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItemKind.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryItemKind.java @@ -54,4 +54,10 @@ public static MemoryItemKind fromString(String name) { public static Collection values() { return values(MemoryItemKind.class); } + + /** + * Routine procedures extracted from conversations. + */ + @Generated + public static final MemoryItemKind PROCEDURAL = fromString("procedural"); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchPreviewTool.java index 668b94075228..9111dbb15491 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchPreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchPreviewTool.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * A tool for integrating memories into the agent. @@ -119,6 +120,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("memory_store_name", this.memoryStoreName); jsonWriter.writeStringField("scope", this.scope); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("search_options", this.searchOptions); jsonWriter.writeNumberField("update_delay", this.updateDelaySeconds); return jsonWriter.writeEndObject(); @@ -139,6 +143,9 @@ public static MemorySearchPreviewTool fromJson(JsonReader jsonReader) throws IOE String memoryStoreName = null; String scope = null; ToolType type = ToolType.MEMORY_SEARCH_PREVIEW; + String name = null; + String description = null; + Map toolConfigs = null; MemorySearchOptions searchOptions = null; Integer updateDelaySeconds = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -150,6 +157,12 @@ public static MemorySearchPreviewTool fromJson(JsonReader jsonReader) throws IOE scope = reader.getString(); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else if ("search_options".equals(fieldName)) { searchOptions = MemorySearchOptions.fromJson(reader); } else if ("update_delay".equals(fieldName)) { @@ -161,6 +174,9 @@ public static MemorySearchPreviewTool fromJson(JsonReader jsonReader) throws IOE MemorySearchPreviewTool deserializedMemorySearchPreviewTool = new MemorySearchPreviewTool(memoryStoreName, scope); deserializedMemorySearchPreviewTool.type = type; + deserializedMemorySearchPreviewTool.name = name; + deserializedMemorySearchPreviewTool.description = description; + deserializedMemorySearchPreviewTool.toolConfigs = toolConfigs; deserializedMemorySearchPreviewTool.searchOptions = searchOptions; deserializedMemorySearchPreviewTool.updateDelaySeconds = updateDelaySeconds; return deserializedMemorySearchPreviewTool; @@ -196,4 +212,94 @@ public MemorySearchPreviewTool setUpdateDelaySeconds(Integer updateDelaySeconds) this.updateDelaySeconds = updateDelaySeconds; return this; } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the MemorySearchPreviewTool object itself. + */ + @Generated + public MemorySearchPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the MemorySearchPreviewTool object itself. + */ + @Generated + public MemorySearchPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the MemorySearchPreviewTool object itself. + */ + @Generated + public MemorySearchPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchToolCall.java new file mode 100644 index 000000000000..d9c9ea9465df --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchToolCall.java @@ -0,0 +1,134 @@ +// 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; +import java.util.List; + +/** + * A memory search tool call. + */ +@Fluent +public final class MemorySearchToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "memory_search_call"; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /* + * The results returned from the memory search. + */ + @Generated + private List memories; + + /** + * Creates an instance of MemorySearchToolCall class. + * + * @param status the status value to set. + */ + @Generated + public MemorySearchToolCall(ToolCallStatus status) { + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * Get the memories property: The results returned from the memory search. + * + * @return the memories value. + */ + @Generated + public List getMemories() { + return this.memories; + } + + /** + * Set the memories property: The results returned from the memory search. + * + * @param memories the memories value to set. + * @return the MemorySearchToolCall object itself. + */ + @Generated + public MemorySearchToolCall setMemories(List memories) { + this.memories = memories; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeArrayField("memories", this.memories, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MemorySearchToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MemorySearchToolCall if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MemorySearchToolCall. + */ + @Generated + public static MemorySearchToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ToolCallStatus status = null; + List memories = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("memories".equals(fieldName)) { + memories = reader.readArray(reader1 -> MemoryItem.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + MemorySearchToolCall deserializedMemorySearchToolCall = new MemorySearchToolCall(status); + deserializedMemorySearchToolCall.memories = memories; + return deserializedMemorySearchToolCall; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultOptions.java index 357b0b3cb62a..4f28184d0634 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultOptions.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultOptions.java @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.Duration; /** * Default memory store configurations. @@ -30,7 +31,7 @@ public final class MemoryStoreDefaultOptions implements JsonSerializable writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +89,9 @@ public static MicrosoftFabricPreviewTool fromJson(JsonReader jsonReader) throws return jsonReader.readObject(reader -> { FabricDataAgentToolParameters fabricDataAgentPreview = null; ToolType type = ToolType.FABRIC_DATAAGENT_PREVIEW; + String name = null; + String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,6 +99,12 @@ public static MicrosoftFabricPreviewTool fromJson(JsonReader jsonReader) throws fabricDataAgentPreview = FabricDataAgentToolParameters.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -99,7 +112,100 @@ public static MicrosoftFabricPreviewTool fromJson(JsonReader jsonReader) throws MicrosoftFabricPreviewTool deserializedMicrosoftFabricPreviewTool = new MicrosoftFabricPreviewTool(fabricDataAgentPreview); deserializedMicrosoftFabricPreviewTool.type = type; + deserializedMicrosoftFabricPreviewTool.name = name; + deserializedMicrosoftFabricPreviewTool.description = description; + deserializedMicrosoftFabricPreviewTool.toolConfigs = toolConfigs; return deserializedMicrosoftFabricPreviewTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the MicrosoftFabricPreviewTool object itself. + */ + @Generated + public MicrosoftFabricPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the MicrosoftFabricPreviewTool object itself. + */ + @Generated + public MicrosoftFabricPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the MicrosoftFabricPreviewTool object itself. + */ + @Generated + public MicrosoftFabricPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java index 107f3b0365d0..ea64fac092be 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java @@ -3,17 +3,18 @@ // 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.Map; /** * The input definition information for an OpenAPI tool as used to configure an agent. */ -@Immutable +@Fluent public final class OpenApiTool extends Tool { /* @@ -52,6 +53,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("openapi", this.openApi); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -69,6 +71,7 @@ public static OpenApiTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { OpenApiFunctionDefinition openApi = null; ToolType type = ToolType.OPENAPI; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -76,12 +79,15 @@ public static OpenApiTool fromJson(JsonReader jsonReader) throws IOException { openApi = OpenApiFunctionDefinition.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } } OpenApiTool deserializedOpenApiTool = new OpenApiTool(openApi); deserializedOpenApiTool.type = type; + deserializedOpenApiTool.toolConfigs = toolConfigs; return deserializedOpenApiTool; }); } @@ -101,4 +107,38 @@ public static OpenApiTool fromJson(JsonReader jsonReader) throws IOException { public OpenApiFunctionDefinition getOpenApi() { return this.openApi; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the OpenApiTool object itself. + */ + @Generated + public OpenApiTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiToolCall.java new file mode 100644 index 000000000000..4e2bd66d5b48 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiToolCall.java @@ -0,0 +1,165 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An OpenAPI tool call. + */ +@Immutable +public final class OpenApiToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "openapi_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The name of the OpenAPI operation being called. + */ + @Generated + private final String name; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of OpenApiToolCall class. + * + * @param callId the callId value to set. + * @param name the name value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public OpenApiToolCall(String callId, String name, String arguments, ToolCallStatus status) { + this.callId = callId; + this.name = name; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the name property: The name of the OpenAPI operation being called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenApiToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenApiToolCall if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenApiToolCall. + */ + @Generated + public static OpenApiToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String name = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new OpenApiToolCall(callId, name, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiToolCallOutput.java new file mode 100644 index 000000000000..8daae3bb0c9f --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiToolCallOutput.java @@ -0,0 +1,181 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of an OpenAPI tool call. + */ +@Fluent +public final class OpenApiToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "openapi_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The name of the OpenAPI operation that was called. + */ + @Generated + private final String name; + + /* + * The output from the OpenAPI tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of OpenApiToolCallOutput class. + * + * @param callId the callId value to set. + * @param name the name value to set. + * @param status the status value to set. + */ + @Generated + public OpenApiToolCallOutput(String callId, String name, ToolCallStatus status) { + this.callId = callId; + this.name = name; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the name property: The name of the OpenAPI operation that was called. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the output property: The output from the OpenAPI tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the OpenAPI tool call. + * + * @param output the output value to set. + * @return the OpenApiToolCallOutput object itself. + */ + @Generated + public OpenApiToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OpenApiToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OpenApiToolCallOutput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OpenApiToolCallOutput. + */ + @Generated + public static OpenApiToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String name = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + OpenApiToolCallOutput deserializedOpenApiToolCallOutput = new OpenApiToolCallOutput(callId, name, status); + deserializedOpenApiToolCallOutput.output = output; + return deserializedOpenApiToolCallOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationAgentDefinition.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationAgentDefinition.java new file mode 100644 index 000000000000..dc2b2666b2d3 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationAgentDefinition.java @@ -0,0 +1,195 @@ +// 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.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Agent definition returned in response payloads (includes resolved config). + */ +@Immutable +public final class OptimizationAgentDefinition implements JsonSerializable { + + /* + * Agent name. + */ + @Generated + private String agentName; + + /* + * Agent version. + */ + @Generated + private String agentVersion; + + /* + * Model deployment name. + */ + @Generated + private String model; + + /* + * System prompt / instructions. + */ + @Generated + private String systemPrompt; + + /* + * Agent skills. + */ + @Generated + private List> skills; + + /** + * Get the agentName property: Agent name. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: Agent version. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * Get the model property: Model deployment name. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Get the systemPrompt property: System prompt / instructions. + * + * @return the systemPrompt value. + */ + @Generated + public String getSystemPrompt() { + return this.systemPrompt; + } + + /** + * Get the skills property: Agent skills. + * + * @return the skills value. + */ + @Generated + public List> getSkills() { + return this.skills; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeStringField("system_prompt", this.systemPrompt); + jsonWriter.writeArrayField("skills", this.skills, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + jsonWriter.writeArrayField("tools", this.tools, + (writer, element) -> writer.writeMap(element, (writer1, element1) -> { + if (element1 == null) { + writer1.writeNull(); + } else { + element1.writeTo(writer1); + } + })); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationAgentDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationAgentDefinition 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 OptimizationAgentDefinition. + */ + @Generated + public static OptimizationAgentDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptimizationAgentDefinition deserializedOptimizationAgentDefinition = new OptimizationAgentDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agent_name".equals(fieldName)) { + deserializedOptimizationAgentDefinition.agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + deserializedOptimizationAgentDefinition.agentVersion = reader.getString(); + } else if ("model".equals(fieldName)) { + deserializedOptimizationAgentDefinition.model = reader.getString(); + } else if ("system_prompt".equals(fieldName)) { + deserializedOptimizationAgentDefinition.systemPrompt = reader.getString(); + } else if ("skills".equals(fieldName)) { + List> skills + = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedOptimizationAgentDefinition.skills = skills; + } else if ("tools".equals(fieldName)) { + List> tools = reader.readArray(reader1 -> reader1.readMap(reader2 -> reader2 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())))); + deserializedOptimizationAgentDefinition.tools = tools; + } else { + reader.skipChildren(); + } + } + return deserializedOptimizationAgentDefinition; + }); + } + + /* + * Agent tools. + */ + @Generated + private List> tools; + + /** + * Creates an instance of OptimizationAgentDefinition class. + */ + @Generated + private OptimizationAgentDefinition() { + } + + /** + * Get the tools property: Agent tools. + * + * @return the tools value. + */ + @Generated + public List> getTools() { + return this.tools; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationCandidate.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationCandidate.java new file mode 100644 index 000000000000..d9c3e70600ad --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationCandidate.java @@ -0,0 +1,334 @@ +// 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.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Aggregated evaluation result for a single candidate agent configuration across all tasks. + */ +@Immutable +public final class OptimizationCandidate implements JsonSerializable { + + /* + * Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints. + */ + @Generated + private String candidateId; + + /* + * Display name of the candidate (e.g., 'baseline', 'instruction-v2'). + */ + @Generated + private final String name; + + /* + * The agent configuration that produced this candidate. + */ + @Generated + private final OptimizationAgentDefinition config; + + /* + * What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + */ + @Generated + private final Map mutations; + + /* + * Fraction of tasks that met the pass threshold. + */ + @Generated + private final double passRate; + + /* + * Individual task-level scores. + */ + @Generated + private final List taskScores; + + /* + * Whether this candidate is on the Pareto frontier (score vs cost). + */ + @Generated + private final boolean isParetoOptimal; + + /** + * Get the candidateId property: Server-assigned candidate identifier. Use with GET /candidates/{id} sub-endpoints. + * + * @return the candidateId value. + */ + @Generated + public String getCandidateId() { + return this.candidateId; + } + + /** + * Get the name property: Display name of the candidate (e.g., 'baseline', 'instruction-v2'). + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the config property: The agent configuration that produced this candidate. + * + * @return the config value. + */ + @Generated + public OptimizationAgentDefinition getConfig() { + return this.config; + } + + /** + * Get the mutations property: What was mutated from the baseline (e.g., {system_prompt: 'new prompt'}). + * + * @return the mutations value. + */ + @Generated + public Map getMutations() { + return this.mutations; + } + + /** + * Get the passRate property: Fraction of tasks that met the pass threshold. + * + * @return the passRate value. + */ + @Generated + public double getPassRate() { + return this.passRate; + } + + /** + * Get the taskScores property: Individual task-level scores. + * + * @return the taskScores value. + */ + @Generated + public List getTaskScores() { + return this.taskScores; + } + + /** + * Get the isParetoOptimal property: Whether this candidate is on the Pareto frontier (score vs cost). + * + * @return the isParetoOptimal value. + */ + @Generated + public boolean isParetoOptimal() { + return this.isParetoOptimal; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("config", this.config); + jsonWriter.writeMapField("mutations", this.mutations, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeDoubleField("avg_score", this.averageScore); + jsonWriter.writeDoubleField("avg_tokens", this.averageTokens); + jsonWriter.writeDoubleField("pass_rate", this.passRate); + jsonWriter.writeArrayField("task_scores", this.taskScores, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("is_pareto_optimal", this.isParetoOptimal); + jsonWriter.writeStringField("candidate_id", this.candidateId); + jsonWriter.writeStringField("eval_id", this.evaluationId); + jsonWriter.writeStringField("eval_run_id", this.evaluationRunId); + jsonWriter.writeJsonField("promotion", this.promotion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationCandidate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationCandidate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OptimizationCandidate. + */ + @Generated + public static OptimizationCandidate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + OptimizationAgentDefinition config = null; + Map mutations = null; + double averageScore = 0.0; + double averageTokens = 0.0; + double passRate = 0.0; + List taskScores = null; + boolean isParetoOptimal = false; + String candidateId = null; + String evaluationId = null; + String evaluationRunId = null; + PromotionInfo promotion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("config".equals(fieldName)) { + config = OptimizationAgentDefinition.fromJson(reader); + } else if ("mutations".equals(fieldName)) { + mutations = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("avg_score".equals(fieldName)) { + averageScore = reader.getDouble(); + } else if ("avg_tokens".equals(fieldName)) { + averageTokens = reader.getDouble(); + } else if ("pass_rate".equals(fieldName)) { + passRate = reader.getDouble(); + } else if ("task_scores".equals(fieldName)) { + taskScores = reader.readArray(reader1 -> OptimizationTaskResult.fromJson(reader1)); + } else if ("is_pareto_optimal".equals(fieldName)) { + isParetoOptimal = reader.getBoolean(); + } else if ("candidate_id".equals(fieldName)) { + candidateId = reader.getString(); + } else if ("eval_id".equals(fieldName)) { + evaluationId = reader.getString(); + } else if ("eval_run_id".equals(fieldName)) { + evaluationRunId = reader.getString(); + } else if ("promotion".equals(fieldName)) { + promotion = PromotionInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + OptimizationCandidate deserializedOptimizationCandidate = new OptimizationCandidate(name, config, mutations, + averageScore, averageTokens, passRate, taskScores, isParetoOptimal); + deserializedOptimizationCandidate.candidateId = candidateId; + deserializedOptimizationCandidate.evaluationId = evaluationId; + deserializedOptimizationCandidate.evaluationRunId = evaluationRunId; + deserializedOptimizationCandidate.promotion = promotion; + return deserializedOptimizationCandidate; + }); + } + + /* + * Promotion metadata. Null if the candidate has not been promoted. + */ + @Generated + private PromotionInfo promotion; + + /** + * Creates an instance of OptimizationCandidate class. + * + * @param name the name value to set. + * @param config the config value to set. + * @param mutations the mutations value to set. + * @param averageScore the averageScore value to set. + * @param averageTokens the averageTokens value to set. + * @param passRate the passRate value to set. + * @param taskScores the taskScores value to set. + * @param isParetoOptimal the isParetoOptimal value to set. + */ + @Generated + private OptimizationCandidate(String name, OptimizationAgentDefinition config, Map mutations, + double averageScore, double averageTokens, double passRate, List taskScores, + boolean isParetoOptimal) { + this.name = name; + this.config = config; + this.mutations = mutations; + this.averageScore = averageScore; + this.averageTokens = averageTokens; + this.passRate = passRate; + this.taskScores = taskScores; + this.isParetoOptimal = isParetoOptimal; + } + + /** + * Get the promotion property: Promotion metadata. Null if the candidate has not been promoted. + * + * @return the promotion value. + */ + @Generated + public PromotionInfo getPromotion() { + return this.promotion; + } + + /* + * Average composite score across all tasks. + */ + @Generated + private final double averageScore; + + /* + * Average token usage across all tasks. + */ + @Generated + private final double averageTokens; + + /** + * Get the averageScore property: Average composite score across all tasks. + * + * @return the averageScore value. + */ + @Generated + public double getAverageScore() { + return this.averageScore; + } + + /** + * Get the averageTokens property: Average token usage across all tasks. + * + * @return the averageTokens value. + */ + @Generated + public double getAverageTokens() { + return this.averageTokens; + } + + /* + * Foundry evaluation identifier used to score this candidate. + */ + @Generated + private String evaluationId; + + /* + * Foundry evaluation run identifier for this candidate's scoring run. + */ + @Generated + private String evaluationRunId; + + /** + * Get the evaluationId property: Foundry evaluation identifier used to score this candidate. + * + * @return the evaluationId value. + */ + @Generated + public String getEvaluationId() { + return this.evaluationId; + } + + /** + * Get the evaluationRunId property: Foundry evaluation run identifier for this candidate's scoring run. + * + * @return the evaluationRunId value. + */ + @Generated + public String getEvaluationRunId() { + return this.evaluationRunId; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationCandidatePagedResult.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationCandidatePagedResult.java new file mode 100644 index 000000000000..76867b71bbec --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationCandidatePagedResult.java @@ -0,0 +1,150 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The response data for a requested list of items. + */ +@Immutable +public final class OptimizationCandidatePagedResult implements JsonSerializable { + + /* + * The requested list of items. + */ + @Generated + private final List data; + + /* + * The first ID represented in this list. + */ + @Generated + private String firstId; + + /* + * The last ID represented in this list. + */ + @Generated + private String lastId; + + /* + * A value indicating whether there are additional values available not captured in this list. + */ + @Generated + private final boolean hasMore; + + /** + * Creates an instance of OptimizationCandidatePagedResult class. + * + * @param data the data value to set. + * @param hasMore the hasMore value to set. + */ + @Generated + private OptimizationCandidatePagedResult(List data, boolean hasMore) { + this.data = data; + this.hasMore = hasMore; + } + + /** + * Get the data property: The requested list of items. + * + * @return the data value. + */ + @Generated + public List getData() { + return this.data; + } + + /** + * Get the firstId property: The first ID represented in this list. + * + * @return the firstId value. + */ + @Generated + public String getFirstId() { + return this.firstId; + } + + /** + * Get the lastId property: The last ID represented in this list. + * + * @return the lastId value. + */ + @Generated + public String getLastId() { + return this.lastId; + } + + /** + * Get the hasMore property: A value indicating whether there are additional values available not captured in this + * list. + * + * @return the hasMore value. + */ + @Generated + public boolean isHasMore() { + return this.hasMore; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("data", this.data, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("has_more", this.hasMore); + jsonWriter.writeStringField("first_id", this.firstId); + jsonWriter.writeStringField("last_id", this.lastId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationCandidatePagedResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationCandidatePagedResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OptimizationCandidatePagedResult. + */ + @Generated + public static OptimizationCandidatePagedResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List data = null; + boolean hasMore = false; + String firstId = null; + String lastId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("data".equals(fieldName)) { + data = reader.readArray(reader1 -> OptimizationCandidate.fromJson(reader1)); + } else if ("has_more".equals(fieldName)) { + hasMore = reader.getBoolean(); + } else if ("first_id".equals(fieldName)) { + firstId = reader.getString(); + } else if ("last_id".equals(fieldName)) { + lastId = reader.getString(); + } else { + reader.skipChildren(); + } + } + OptimizationCandidatePagedResult deserializedOptimizationCandidatePagedResult + = new OptimizationCandidatePagedResult(data, hasMore); + deserializedOptimizationCandidatePagedResult.firstId = firstId; + deserializedOptimizationCandidatePagedResult.lastId = lastId; + return deserializedOptimizationCandidatePagedResult; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJob.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJob.java new file mode 100644 index 000000000000..65a261c8d865 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJob.java @@ -0,0 +1,231 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Agent optimization job resource — a long-running job that optimizes an agent's configuration (instructions, model, + * skills, tools) to maximize evaluation scores. On success, the result contains scored candidates. + */ +@Immutable +public final class OptimizationJob implements JsonSerializable { + + /* + * Server-assigned unique identifier. + */ + @Generated + private String id; + + /* + * Caller-supplied inputs. + */ + @Generated + private OptimizationJobInputs inputs; + + /* + * Result produced on success. + */ + @Generated + private OptimizationJobResult result; + + /* + * Current lifecycle status. + */ + @Generated + private JobStatus status; + + /* + * Error details — populated only on failure. + */ + @Generated + private ApiError error; + + /* + * The timestamp when the job was created, represented in Unix time. + */ + @Generated + private long createdAt; + + /* + * The timestamp when the job was last updated (status, progress, or result change), represented in Unix time. + */ + @Generated + private Long updatedAt; + + /* + * Progress while in flight. Absent in terminal states. + */ + @Generated + private OptimizationJobProgress progress; + + /** + * Creates an instance of OptimizationJob class. + */ + @Generated + private OptimizationJob() { + } + + /** + * Get the id property: Server-assigned unique identifier. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the inputs property: Caller-supplied inputs. + * + * @return the inputs value. + */ + @Generated + public OptimizationJobInputs getInputs() { + return this.inputs; + } + + /** + * Get the result property: Result produced on success. + * + * @return the result value. + */ + @Generated + public OptimizationJobResult getResult() { + return this.result; + } + + /** + * Get the status property: Current lifecycle status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the error property: Error details — populated only on failure. + * + * @return the error value. + */ + @Generated + public ApiError getError() { + return this.error; + } + + /** + * Get the createdAt property: The timestamp when the job was created, represented in Unix time. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the updatedAt property: The timestamp when the job was last updated (status, progress, or result change), + * represented in Unix time. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + if (this.updatedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.updatedAt), ZoneOffset.UTC); + } + + /** + * Get the progress property: Progress while in flight. Absent in terminal states. + * + * @return the progress value. + */ + @Generated + public OptimizationJobProgress getProgress() { + return this.progress; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("inputs", this.inputs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OptimizationJob. + */ + @Generated + public static OptimizationJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptimizationJob deserializedOptimizationJob = new OptimizationJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedOptimizationJob.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedOptimizationJob.status = JobStatus.fromString(reader.getString()); + } else if ("created_at".equals(fieldName)) { + deserializedOptimizationJob.createdAt = reader.getLong(); + } else if ("error".equals(fieldName)) { + deserializedOptimizationJob.error = ApiError.fromJson(reader); + } else if ("result".equals(fieldName)) { + deserializedOptimizationJob.result = OptimizationJobResult.fromJson(reader); + } else if ("inputs".equals(fieldName)) { + deserializedOptimizationJob.inputs = OptimizationJobInputs.fromJson(reader); + } else if ("updated_at".equals(fieldName)) { + deserializedOptimizationJob.updatedAt = reader.getNullable(JsonReader::getLong); + } else if ("progress".equals(fieldName)) { + deserializedOptimizationJob.progress = OptimizationJobProgress.fromJson(reader); + } else if ("dataset".equals(fieldName)) { + deserializedOptimizationJob.dataset = DatasetInfo.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedOptimizationJob; + }); + } + + /* + * Metadata about the dataset used for this optimization job. + */ + @Generated + private DatasetInfo dataset; + + /** + * Get the dataset property: Metadata about the dataset used for this optimization job. + * + * @return the dataset value. + */ + @Generated + public DatasetInfo getDataset() { + return this.dataset; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobInputs.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobInputs.java new file mode 100644 index 000000000000..a960bb191263 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobInputs.java @@ -0,0 +1,210 @@ +// 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; +import java.util.List; + +/** + * Caller-supplied inputs for an optimization job. + */ +@Fluent +public final class OptimizationJobInputs implements JsonSerializable { + + /* + * The agent (and pinned version) being optimized. + */ + @Generated + private final AgentIdentifier agent; + + /* + * Reference to a registered training dataset (required). + */ + @Generated + private final DatasetRef trainDatasetReference; + + /* + * Optional held-out validation dataset for measuring generalization of the final candidate. + */ + @Generated + private DatasetRef validationDatasetReference; + + /* + * Job-level evaluators (referenced by name). Per-task criteria may override. Default: ['task_adherence']. + */ + @Generated + private List evaluators; + + /* + * Tuning knobs and run-mode. + */ + @Generated + private OptimizationOptions options; + + /** + * Get the agent property: The agent (and pinned version) being optimized. + * + * @return the agent value. + */ + @Generated + public AgentIdentifier getAgent() { + return this.agent; + } + + /** + * Get the trainDatasetReference property: Reference to a registered training dataset (required). + * + * @return the trainDatasetReference value. + */ + @Generated + public DatasetRef getTrainDatasetReference() { + return this.trainDatasetReference; + } + + /** + * Get the validationDatasetReference property: Optional held-out validation dataset for measuring generalization of + * the final candidate. + * + * @return the validationDatasetReference value. + */ + @Generated + public DatasetRef getValidationDatasetReference() { + return this.validationDatasetReference; + } + + /** + * Set the validationDatasetReference property: Optional held-out validation dataset for measuring generalization of + * the final candidate. + * + * @param validationDatasetReference the validationDatasetReference value to set. + * @return the OptimizationJobInputs object itself. + */ + @Generated + public OptimizationJobInputs setValidationDatasetReference(DatasetRef validationDatasetReference) { + this.validationDatasetReference = validationDatasetReference; + return this; + } + + /** + * Get the evaluators property: Job-level evaluators (referenced by name). Per-task criteria may override. Default: + * ['task_adherence']. + * + * @return the evaluators value. + */ + @Generated + public List getEvaluators() { + return this.evaluators; + } + + /** + * Set the evaluators property: Job-level evaluators (referenced by name). Per-task criteria may override. Default: + * ['task_adherence']. + * + * @param evaluators the evaluators value to set. + * @return the OptimizationJobInputs object itself. + */ + @Generated + public OptimizationJobInputs setEvaluators(List evaluators) { + this.evaluators = evaluators; + return this; + } + + /** + * Get the options property: Tuning knobs and run-mode. + * + * @return the options value. + */ + @Generated + public OptimizationOptions getOptions() { + return this.options; + } + + /** + * Set the options property: Tuning knobs and run-mode. + * + * @param options the options value to set. + * @return the OptimizationJobInputs object itself. + */ + @Generated + public OptimizationJobInputs setOptions(OptimizationOptions options) { + this.options = options; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("agent", this.agent); + jsonWriter.writeJsonField("train_dataset_reference", this.trainDatasetReference); + jsonWriter.writeJsonField("validation_dataset_reference", this.validationDatasetReference); + jsonWriter.writeArrayField("evaluators", this.evaluators, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationJobInputs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationJobInputs if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OptimizationJobInputs. + */ + @Generated + public static OptimizationJobInputs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AgentIdentifier agent = null; + DatasetRef trainDatasetReference = null; + DatasetRef validationDatasetReference = null; + List evaluators = null; + OptimizationOptions options = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agent".equals(fieldName)) { + agent = AgentIdentifier.fromJson(reader); + } else if ("train_dataset_reference".equals(fieldName)) { + trainDatasetReference = DatasetRef.fromJson(reader); + } else if ("validation_dataset_reference".equals(fieldName)) { + validationDatasetReference = DatasetRef.fromJson(reader); + } else if ("evaluators".equals(fieldName)) { + evaluators = reader.readArray(reader1 -> reader1.getString()); + } else if ("options".equals(fieldName)) { + options = OptimizationOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + OptimizationJobInputs deserializedOptimizationJobInputs + = new OptimizationJobInputs(agent, trainDatasetReference); + deserializedOptimizationJobInputs.validationDatasetReference = validationDatasetReference; + deserializedOptimizationJobInputs.evaluators = evaluators; + deserializedOptimizationJobInputs.options = options; + return deserializedOptimizationJobInputs; + }); + } + + /** + * Creates an instance of OptimizationJobInputs class. + * + * @param agent the agent value to set. + * @param trainDatasetReference the trainDatasetReference value to set. + */ + @Generated + public OptimizationJobInputs(AgentIdentifier agent, DatasetRef trainDatasetReference) { + this.agent = agent; + this.trainDatasetReference = trainDatasetReference; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobProgress.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobProgress.java new file mode 100644 index 000000000000..080a8336f92a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobProgress.java @@ -0,0 +1,126 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * In-flight progress; only populated while status is queued or in_progress. + */ +@Immutable +public final class OptimizationJobProgress implements JsonSerializable { + + /* + * 1-based current iteration index. + */ + @Generated + private final int currentIteration; + + /* + * Best score observed so far across all candidates. + */ + @Generated + private final double bestScore; + + /* + * Wall-clock time elapsed in seconds since the job began executing. + */ + @Generated + private final double elapsedSeconds; + + /** + * Get the currentIteration property: 1-based current iteration index. + * + * @return the currentIteration value. + */ + @Generated + public int getCurrentIteration() { + return this.currentIteration; + } + + /** + * Get the bestScore property: Best score observed so far across all candidates. + * + * @return the bestScore value. + */ + @Generated + public double getBestScore() { + return this.bestScore; + } + + /** + * Get the elapsedSeconds property: Wall-clock time elapsed in seconds since the job began executing. + * + * @return the elapsedSeconds value. + */ + @Generated + public double getElapsedSeconds() { + return this.elapsedSeconds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("current_iteration", this.currentIteration); + jsonWriter.writeDoubleField("best_score", this.bestScore); + jsonWriter.writeDoubleField("elapsed_seconds", this.elapsedSeconds); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationJobProgress from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationJobProgress if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OptimizationJobProgress. + */ + @Generated + public static OptimizationJobProgress fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int currentIteration = 0; + double bestScore = 0.0; + double elapsedSeconds = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("current_iteration".equals(fieldName)) { + currentIteration = reader.getInt(); + } else if ("best_score".equals(fieldName)) { + bestScore = reader.getDouble(); + } else if ("elapsed_seconds".equals(fieldName)) { + elapsedSeconds = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new OptimizationJobProgress(currentIteration, bestScore, elapsedSeconds); + }); + } + + /** + * Creates an instance of OptimizationJobProgress class. + * + * @param currentIteration the currentIteration value to set. + * @param bestScore the bestScore value to set. + * @param elapsedSeconds the elapsedSeconds value to set. + */ + @Generated + private OptimizationJobProgress(int currentIteration, double bestScore, double elapsedSeconds) { + this.currentIteration = currentIteration; + this.bestScore = bestScore; + this.elapsedSeconds = elapsedSeconds; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobResult.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobResult.java new file mode 100644 index 000000000000..e807b45c5278 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationJobResult.java @@ -0,0 +1,180 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Terminal-state result body. Populated when status is succeeded or failed. + */ +@Immutable +public final class OptimizationJobResult implements JsonSerializable { + + /* + * Evaluation scores for the original (un-optimized) agent configuration. + */ + @Generated + private OptimizationCandidate baseline; + + /* + * The highest-scoring candidate found during optimization. + */ + @Generated + private OptimizationCandidate best; + + /* + * All evaluated candidates including baseline. + */ + @Generated + private List candidates; + + /* + * The options used for this optimization run. + */ + @Generated + private OptimizationOptions options; + + /* + * Non-fatal warnings from the optimization run (e.g., target attribute failures that were skipped). + */ + @Generated + private List warnings; + + /** + * Creates an instance of OptimizationJobResult class. + */ + @Generated + private OptimizationJobResult() { + } + + /** + * Get the baseline property: Evaluation scores for the original (un-optimized) agent configuration. + * + * @return the baseline value. + */ + @Generated + public OptimizationCandidate getBaseline() { + return this.baseline; + } + + /** + * Get the best property: The highest-scoring candidate found during optimization. + * + * @return the best value. + */ + @Generated + public OptimizationCandidate getBest() { + return this.best; + } + + /** + * Get the candidates property: All evaluated candidates including baseline. + * + * @return the candidates value. + */ + @Generated + public List getCandidates() { + return this.candidates; + } + + /** + * Get the options property: The options used for this optimization run. + * + * @return the options value. + */ + @Generated + public OptimizationOptions getOptions() { + return this.options; + } + + /** + * Get the warnings property: Non-fatal warnings from the optimization run (e.g., target attribute failures that + * were skipped). + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("baseline", this.baseline); + jsonWriter.writeJsonField("best", this.best); + jsonWriter.writeArrayField("candidates", this.candidates, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("options", this.options); + jsonWriter.writeArrayField("warnings", this.warnings, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("all_target_attributes_failed", this.allTargetAttributesFailed); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationJobResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationJobResult 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 OptimizationJobResult. + */ + @Generated + public static OptimizationJobResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptimizationJobResult deserializedOptimizationJobResult = new OptimizationJobResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("baseline".equals(fieldName)) { + deserializedOptimizationJobResult.baseline = OptimizationCandidate.fromJson(reader); + } else if ("best".equals(fieldName)) { + deserializedOptimizationJobResult.best = OptimizationCandidate.fromJson(reader); + } else if ("candidates".equals(fieldName)) { + List candidates + = reader.readArray(reader1 -> OptimizationCandidate.fromJson(reader1)); + deserializedOptimizationJobResult.candidates = candidates; + } else if ("options".equals(fieldName)) { + deserializedOptimizationJobResult.options = OptimizationOptions.fromJson(reader); + } else if ("warnings".equals(fieldName)) { + List warnings = reader.readArray(reader1 -> reader1.getString()); + deserializedOptimizationJobResult.warnings = warnings; + } else if ("all_target_attributes_failed".equals(fieldName)) { + deserializedOptimizationJobResult.allTargetAttributesFailed + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedOptimizationJobResult; + }); + } + + /* + * True when all target attributes failed — only the baseline was evaluated. + */ + @Generated + private Boolean allTargetAttributesFailed; + + /** + * Get the allTargetAttributesFailed property: True when all target attributes failed — only the baseline was + * evaluated. + * + * @return the allTargetAttributesFailed value. + */ + @Generated + public Boolean isAllTargetAttributesFailed() { + return this.allTargetAttributesFailed; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationOptions.java new file mode 100644 index 000000000000..b8e43b91a0bb --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationOptions.java @@ -0,0 +1,234 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Tuning knobs and run-mode for an optimization job. + */ +@Fluent +public final class OptimizationOptions implements JsonSerializable { + + /* + * Maximum optimization iterations per strategy. Must be >= 1. Default: 5. + */ + @Generated + private Integer maxIterations; + + /* + * Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o'). + */ + @Generated + private String evalModel; + + /** + * Creates an instance of OptimizationOptions class. + */ + @Generated + public OptimizationOptions() { + } + + /** + * Get the maxIterations property: Maximum optimization iterations per strategy. Must be >= 1. Default: 5. + * + * @return the maxIterations value. + */ + @Generated + public Integer getMaxIterations() { + return this.maxIterations; + } + + /** + * Set the maxIterations property: Maximum optimization iterations per strategy. Must be >= 1. Default: 5. + * + * @param maxIterations the maxIterations value to set. + * @return the OptimizationOptions object itself. + */ + @Generated + public OptimizationOptions setMaxIterations(Integer maxIterations) { + this.maxIterations = maxIterations; + return this; + } + + /** + * Get the evalModel property: Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o'). + * + * @return the evalModel value. + */ + @Generated + public String getEvalModel() { + return this.evalModel; + } + + /** + * Set the evalModel property: Model deployment used for evaluation. Defaults to server config (typically 'gpt-4o'). + * + * @param evalModel the evalModel value to set. + * @return the OptimizationOptions object itself. + */ + @Generated + public OptimizationOptions setEvalModel(String evalModel) { + this.evalModel = evalModel; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("max_iterations", this.maxIterations); + jsonWriter.writeMapField("optimization_config", this.optimizationConfig, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeStringField("eval_model", this.evalModel); + jsonWriter.writeStringField("optimization_model", this.optimizationModel); + jsonWriter.writeStringField("evaluation_level", + this.evaluationLevel == null ? null : this.evaluationLevel.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationOptions 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 OptimizationOptions. + */ + @Generated + public static OptimizationOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OptimizationOptions deserializedOptimizationOptions = new OptimizationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_iterations".equals(fieldName)) { + deserializedOptimizationOptions.maxIterations = reader.getNullable(JsonReader::getInt); + } else if ("optimization_config".equals(fieldName)) { + Map optimizationConfig = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + deserializedOptimizationOptions.optimizationConfig = optimizationConfig; + } else if ("eval_model".equals(fieldName)) { + deserializedOptimizationOptions.evalModel = reader.getString(); + } else if ("optimization_model".equals(fieldName)) { + deserializedOptimizationOptions.optimizationModel = reader.getString(); + } else if ("evaluation_level".equals(fieldName)) { + deserializedOptimizationOptions.evaluationLevel = EvaluationLevel.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedOptimizationOptions; + }); + } + + /* + * Per-target-attribute configuration overrides. Contains skills, tools, system_prompt for the agent, plus model + * space for model optimization. + */ + @Generated + private Map optimizationConfig; + + /* + * Model deployment for optimization reasoning (must be gpt-5 family). Falls back to the default eval model when not + * set. + */ + @Generated + private String optimizationModel; + + /* + * Evaluation granularity. Null/omitted means per-item single-turn. Set to 'conversation' for per-conversation + * multi-turn simulation scoring. + */ + @Generated + private EvaluationLevel evaluationLevel; + + /** + * Get the optimizationConfig property: Per-target-attribute configuration overrides. Contains skills, tools, + * system_prompt for the agent, plus model space for model optimization. + * + * @return the optimizationConfig value. + */ + @Generated + public Map getOptimizationConfig() { + return this.optimizationConfig; + } + + /** + * Set the optimizationConfig property: Per-target-attribute configuration overrides. Contains skills, tools, + * system_prompt for the agent, plus model space for model optimization. + * + * @param optimizationConfig the optimizationConfig value to set. + * @return the OptimizationOptions object itself. + */ + @Generated + public OptimizationOptions setOptimizationConfig(Map optimizationConfig) { + this.optimizationConfig = optimizationConfig; + return this; + } + + /** + * Get the optimizationModel property: Model deployment for optimization reasoning (must be gpt-5 family). Falls + * back to the default eval model when not set. + * + * @return the optimizationModel value. + */ + @Generated + public String getOptimizationModel() { + return this.optimizationModel; + } + + /** + * Set the optimizationModel property: Model deployment for optimization reasoning (must be gpt-5 family). Falls + * back to the default eval model when not set. + * + * @param optimizationModel the optimizationModel value to set. + * @return the OptimizationOptions object itself. + */ + @Generated + public OptimizationOptions setOptimizationModel(String optimizationModel) { + this.optimizationModel = optimizationModel; + return this; + } + + /** + * Get the evaluationLevel property: Evaluation granularity. Null/omitted means per-item single-turn. Set to + * 'conversation' for per-conversation multi-turn simulation scoring. + * + * @return the evaluationLevel value. + */ + @Generated + public EvaluationLevel getEvaluationLevel() { + return this.evaluationLevel; + } + + /** + * Set the evaluationLevel property: Evaluation granularity. Null/omitted means per-item single-turn. Set to + * 'conversation' for per-conversation multi-turn simulation scoring. + * + * @param evaluationLevel the evaluationLevel value to set. + * @return the OptimizationOptions object itself. + */ + @Generated + public OptimizationOptions setEvaluationLevel(EvaluationLevel evaluationLevel) { + this.evaluationLevel = evaluationLevel; + return this; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationTaskResult.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationTaskResult.java new file mode 100644 index 000000000000..14ad2a76e33c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OptimizationTaskResult.java @@ -0,0 +1,306 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Duration; +import java.util.Map; + +/** + * Per-task evaluation result for a single candidate. + */ +@Immutable +public final class OptimizationTaskResult implements JsonSerializable { + + /* + * Task name (from the dataset). + */ + @Generated + private final String taskName; + + /* + * The user query / input for the task. + */ + @Generated + private String query; + + /* + * Per-evaluator scores keyed by evaluator name. + */ + @Generated + private final Map scores; + + /* + * Composite score combining all evaluator scores. + */ + @Generated + private final double compositeScore; + + /* + * Total tokens consumed during the agent run for this task. + */ + @Generated + private final long tokens; + + /* + * Wall-clock seconds for this task's agent execution. + */ + @Generated + private final double durationSeconds; + + /* + * Whether the task met the pass threshold. + */ + @Generated + private final boolean passed; + + /* + * Error message if the task failed during execution. + */ + @Generated + private String errorMessage; + + /* + * Per-evaluator reasoning keyed by evaluator name. + */ + @Generated + private Map rationales; + + /* + * Raw agent response text. + */ + @Generated + private String response; + + /* + * Identifier of the agent run that produced this result. + */ + @Generated + private String runId; + + /** + * Get the taskName property: Task name (from the dataset). + * + * @return the taskName value. + */ + @Generated + public String getTaskName() { + return this.taskName; + } + + /** + * Get the query property: The user query / input for the task. + * + * @return the query value. + */ + @Generated + public String getQuery() { + return this.query; + } + + /** + * Get the scores property: Per-evaluator scores keyed by evaluator name. + * + * @return the scores value. + */ + @Generated + public Map getScores() { + return this.scores; + } + + /** + * Get the compositeScore property: Composite score combining all evaluator scores. + * + * @return the compositeScore value. + */ + @Generated + public double getCompositeScore() { + return this.compositeScore; + } + + /** + * Get the tokens property: Total tokens consumed during the agent run for this task. + * + * @return the tokens value. + */ + @Generated + public long getTokens() { + return this.tokens; + } + + /** + * Get the durationSeconds property: Wall-clock seconds for this task's agent execution. + * + * @return the durationSeconds value. + */ + @Generated + public Duration getDurationSeconds() { + return Duration.ofNanos((long) (this.durationSeconds * 1000_000_000L)); + } + + /** + * Get the passed property: Whether the task met the pass threshold. + * + * @return the passed value. + */ + @Generated + public boolean isPassed() { + return this.passed; + } + + /** + * Get the errorMessage property: Error message if the task failed during execution. + * + * @return the errorMessage value. + */ + @Generated + public String getErrorMessage() { + return this.errorMessage; + } + + /** + * Get the rationales property: Per-evaluator reasoning keyed by evaluator name. + * + * @return the rationales value. + */ + @Generated + public Map getRationales() { + return this.rationales; + } + + /** + * Get the response property: Raw agent response text. + * + * @return the response value. + */ + @Generated + public String getResponse() { + return this.response; + } + + /** + * Get the runId property: Identifier of the agent run that produced this result. + * + * @return the runId value. + */ + @Generated + public String getRunId() { + return this.runId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("task_name", this.taskName); + jsonWriter.writeMapField("scores", this.scores, (writer, element) -> writer.writeDouble(element)); + jsonWriter.writeDoubleField("composite_score", this.compositeScore); + jsonWriter.writeLongField("tokens", this.tokens); + jsonWriter.writeDoubleField("duration_seconds", this.durationSeconds); + jsonWriter.writeBooleanField("passed", this.passed); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeStringField("error_message", this.errorMessage); + jsonWriter.writeMapField("rationales", this.rationales, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("response", this.response); + jsonWriter.writeStringField("run_id", this.runId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OptimizationTaskResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OptimizationTaskResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OptimizationTaskResult. + */ + @Generated + public static OptimizationTaskResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String taskName = null; + Map scores = null; + double compositeScore = 0.0; + long tokens = 0L; + Duration durationSeconds = null; + boolean passed = false; + String query = null; + String errorMessage = null; + Map rationales = null; + String response = null; + String runId = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("task_name".equals(fieldName)) { + taskName = reader.getString(); + } else if ("scores".equals(fieldName)) { + scores = reader.readMap(reader1 -> reader1.getDouble()); + } else if ("composite_score".equals(fieldName)) { + compositeScore = reader.getDouble(); + } else if ("tokens".equals(fieldName)) { + tokens = reader.getLong(); + } else if ("duration_seconds".equals(fieldName)) { + durationSeconds = Duration.ofNanos((long) (reader.getDouble() * 1000_000_000L)); + } else if ("passed".equals(fieldName)) { + passed = reader.getBoolean(); + } else if ("query".equals(fieldName)) { + query = reader.getString(); + } else if ("error_message".equals(fieldName)) { + errorMessage = reader.getString(); + } else if ("rationales".equals(fieldName)) { + rationales = reader.readMap(reader1 -> reader1.getString()); + } else if ("response".equals(fieldName)) { + response = reader.getString(); + } else if ("run_id".equals(fieldName)) { + runId = reader.getString(); + } else { + reader.skipChildren(); + } + } + OptimizationTaskResult deserializedOptimizationTaskResult + = new OptimizationTaskResult(taskName, scores, compositeScore, tokens, durationSeconds, passed); + deserializedOptimizationTaskResult.query = query; + deserializedOptimizationTaskResult.errorMessage = errorMessage; + deserializedOptimizationTaskResult.rationales = rationales; + deserializedOptimizationTaskResult.response = response; + deserializedOptimizationTaskResult.runId = runId; + return deserializedOptimizationTaskResult; + }); + } + + /** + * Creates an instance of OptimizationTaskResult class. + * + * @param taskName the taskName value to set. + * @param scores the scores value to set. + * @param compositeScore the compositeScore value to set. + * @param tokens the tokens value to set. + * @param durationSeconds the durationSeconds value to set. + * @param passed the passed value to set. + */ + @Generated + private OptimizationTaskResult(String taskName, Map scores, double compositeScore, long tokens, + Duration durationSeconds, boolean passed) { + this.taskName = taskName; + this.scores = scores; + this.compositeScore = compositeScore; + this.tokens = tokens; + if (durationSeconds == null) { + this.durationSeconds = 0.0; + } else { + this.durationSeconds = (double) durationSeconds.toNanos() / 1000_000_000L; + } + this.passed = passed; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OtlpTelemetryEndpoint.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OtlpTelemetryEndpoint.java new file mode 100644 index 000000000000..9e4d5b2c8982 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OtlpTelemetryEndpoint.java @@ -0,0 +1,150 @@ +// 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.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * An OTLP (OpenTelemetry Protocol) telemetry export endpoint. + */ +@Fluent +public final class OtlpTelemetryEndpoint extends TelemetryEndpoint { + + /* + * The telemetry export endpoint kind. + */ + @Generated + private TelemetryEndpointKind kind = TelemetryEndpointKind.OTLP; + + /* + * The OTLP collector endpoint URL. + */ + @Generated + private final String endpoint; + + /* + * The transport protocol for the OTLP endpoint. + */ + @Generated + private final TelemetryTransportProtocol protocol; + + /** + * Creates an instance of OtlpTelemetryEndpoint class. + * + * @param data the data value to set. + * @param endpoint the endpoint value to set. + * @param protocol the protocol value to set. + */ + @Generated + public OtlpTelemetryEndpoint(List data, String endpoint, TelemetryTransportProtocol protocol) { + super(data); + this.endpoint = endpoint; + this.protocol = protocol; + } + + /** + * Get the kind property: The telemetry export endpoint kind. + * + * @return the kind value. + */ + @Generated + @Override + public TelemetryEndpointKind getKind() { + return this.kind; + } + + /** + * Get the endpoint property: The OTLP collector endpoint URL. + * + * @return the endpoint value. + */ + @Generated + public String getEndpoint() { + return this.endpoint; + } + + /** + * Get the protocol property: The transport protocol for the OTLP endpoint. + * + * @return the protocol value. + */ + @Generated + public TelemetryTransportProtocol getProtocol() { + return this.protocol; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public OtlpTelemetryEndpoint setAuth(TelemetryEndpointAuth auth) { + super.setAuth(auth); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("data", getData(), + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeJsonField("auth", getAuth()); + jsonWriter.writeStringField("endpoint", this.endpoint); + jsonWriter.writeStringField("protocol", this.protocol == null ? null : this.protocol.toString()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OtlpTelemetryEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OtlpTelemetryEndpoint if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the OtlpTelemetryEndpoint. + */ + @Generated + public static OtlpTelemetryEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List data = null; + TelemetryEndpointAuth auth = null; + String endpoint = null; + TelemetryTransportProtocol protocol = null; + TelemetryEndpointKind kind = TelemetryEndpointKind.OTLP; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("data".equals(fieldName)) { + data = reader.readArray(reader1 -> TelemetryDataKind.fromString(reader1.getString())); + } else if ("auth".equals(fieldName)) { + auth = TelemetryEndpointAuth.fromJson(reader); + } else if ("endpoint".equals(fieldName)) { + endpoint = reader.getString(); + } else if ("protocol".equals(fieldName)) { + protocol = TelemetryTransportProtocol.fromString(reader.getString()); + } else if ("kind".equals(fieldName)) { + kind = TelemetryEndpointKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + OtlpTelemetryEndpoint deserializedOtlpTelemetryEndpoint + = new OtlpTelemetryEndpoint(data, endpoint, protocol); + deserializedOtlpTelemetryEndpoint.setAuth(auth); + deserializedOtlpTelemetryEndpoint.kind = kind; + return deserializedOtlpTelemetryEndpoint; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ProceduralMemoryItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ProceduralMemoryItem.java new file mode 100644 index 000000000000..46b6535247dd --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ProceduralMemoryItem.java @@ -0,0 +1,109 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * A memory item containing a procedure extracted from conversations. + */ +@Immutable +public final class ProceduralMemoryItem extends MemoryItem { + + /* + * The kind of the memory item. + */ + @Generated + private MemoryItemKind kind = MemoryItemKind.PROCEDURAL; + + /** + * Creates an instance of ProceduralMemoryItem class. + * + * @param memoryId the memoryId value to set. + * @param updatedAt the updatedAt value to set. + * @param scope the scope value to set. + * @param content the content value to set. + */ + @Generated + public ProceduralMemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { + super(memoryId, updatedAt, scope, content); + } + + /** + * Get the kind property: The kind of the memory item. + * + * @return the kind value. + */ + @Generated + @Override + public MemoryItemKind getKind() { + return this.kind; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("memory_id", getMemoryId()); + if (getUpdatedAt() != null) { + jsonWriter.writeLongField("updated_at", getUpdatedAt().toEpochSecond()); + } + jsonWriter.writeStringField("scope", getScope()); + jsonWriter.writeStringField("content", getContent()); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProceduralMemoryItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProceduralMemoryItem if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ProceduralMemoryItem. + */ + @Generated + public static ProceduralMemoryItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String memoryId = null; + OffsetDateTime updatedAt = null; + String scope = null; + String content = null; + MemoryItemKind kind = MemoryItemKind.PROCEDURAL; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("memory_id".equals(fieldName)) { + memoryId = reader.getString(); + } else if ("updated_at".equals(fieldName)) { + updatedAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("scope".equals(fieldName)) { + scope = reader.getString(); + } else if ("content".equals(fieldName)) { + content = reader.getString(); + } else if ("kind".equals(fieldName)) { + kind = MemoryItemKind.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ProceduralMemoryItem deserializedProceduralMemoryItem + = new ProceduralMemoryItem(memoryId, updatedAt, scope, content); + deserializedProceduralMemoryItem.kind = kind; + return deserializedProceduralMemoryItem; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromoteCandidateInput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromoteCandidateInput.java new file mode 100644 index 000000000000..afc74fc8b27a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromoteCandidateInput.java @@ -0,0 +1,104 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for promoting a candidate to a Foundry agent version. + */ +@Immutable +public final class PromoteCandidateInput implements JsonSerializable { + + /* + * Name of the Foundry agent to promote to. + */ + @Generated + private final String agentName; + + /* + * Version of the Foundry agent to promote to. + */ + @Generated + private final String agentVersion; + + /** + * Creates an instance of PromoteCandidateInput class. + * + * @param agentName the agentName value to set. + * @param agentVersion the agentVersion value to set. + */ + @Generated + public PromoteCandidateInput(String agentName, String agentVersion) { + this.agentName = agentName; + this.agentVersion = agentVersion; + } + + /** + * Get the agentName property: Name of the Foundry agent to promote to. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: Version of the Foundry agent to promote to. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PromoteCandidateInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PromoteCandidateInput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PromoteCandidateInput. + */ + @Generated + public static PromoteCandidateInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String agentName = null; + String agentVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new PromoteCandidateInput(agentName, agentVersion); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromoteCandidateResult.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromoteCandidateResult.java new file mode 100644 index 000000000000..3b73e73d2679 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromoteCandidateResult.java @@ -0,0 +1,178 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Response after successfully promoting a candidate. + */ +@Immutable +public final class PromoteCandidateResult implements JsonSerializable { + + /* + * The promoted candidate id. + */ + @Generated + private final String candidateId; + + /* + * Status after promotion. + */ + @Generated + private final String status; + + /* + * Timestamp when promotion occurred, represented in Unix time. + */ + @Generated + private final long promotedAt; + + /* + * Name of the Foundry agent promoted to. + */ + @Generated + private final String agentName; + + /* + * Version of the Foundry agent promoted to. + */ + @Generated + private final String agentVersion; + + /** + * Creates an instance of PromoteCandidateResult class. + * + * @param candidateId the candidateId value to set. + * @param status the status value to set. + * @param promotedAt the promotedAt value to set. + * @param agentName the agentName value to set. + * @param agentVersion the agentVersion value to set. + */ + @Generated + private PromoteCandidateResult(String candidateId, String status, OffsetDateTime promotedAt, String agentName, + String agentVersion) { + this.candidateId = candidateId; + this.status = status; + if (promotedAt == null) { + this.promotedAt = 0L; + } else { + this.promotedAt = promotedAt.toEpochSecond(); + } + this.agentName = agentName; + this.agentVersion = agentVersion; + } + + /** + * Get the candidateId property: The promoted candidate id. + * + * @return the candidateId value. + */ + @Generated + public String getCandidateId() { + return this.candidateId; + } + + /** + * Get the status property: Status after promotion. + * + * @return the status value. + */ + @Generated + public String getStatus() { + return this.status; + } + + /** + * Get the promotedAt property: Timestamp when promotion occurred, represented in Unix time. + * + * @return the promotedAt value. + */ + @Generated + public OffsetDateTime getPromotedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.promotedAt), ZoneOffset.UTC); + } + + /** + * Get the agentName property: Name of the Foundry agent promoted to. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: Version of the Foundry agent promoted to. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("candidate_id", this.candidateId); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeLongField("promoted_at", this.promotedAt); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PromoteCandidateResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PromoteCandidateResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PromoteCandidateResult. + */ + @Generated + public static PromoteCandidateResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String candidateId = null; + String status = null; + OffsetDateTime promotedAt = null; + String agentName = null; + String agentVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("candidate_id".equals(fieldName)) { + candidateId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = reader.getString(); + } else if ("promoted_at".equals(fieldName)) { + promotedAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new PromoteCandidateResult(candidateId, status, promotedAt, agentName, agentVersion); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromotionInfo.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromotionInfo.java new file mode 100644 index 000000000000..28a64d567154 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromotionInfo.java @@ -0,0 +1,133 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Promotion metadata recorded when a candidate is deployed to a Foundry agent. + */ +@Immutable +public final class PromotionInfo implements JsonSerializable { + + /* + * Timestamp when promotion occurred, represented in Unix time. + */ + @Generated + private final long promotedAt; + + /* + * Name of the Foundry agent this candidate was promoted to. + */ + @Generated + private final String agentName; + + /* + * Version of the Foundry agent this candidate was promoted to. + */ + @Generated + private final String agentVersion; + + /** + * Creates an instance of PromotionInfo class. + * + * @param promotedAt the promotedAt value to set. + * @param agentName the agentName value to set. + * @param agentVersion the agentVersion value to set. + */ + @Generated + private PromotionInfo(OffsetDateTime promotedAt, String agentName, String agentVersion) { + if (promotedAt == null) { + this.promotedAt = 0L; + } else { + this.promotedAt = promotedAt.toEpochSecond(); + } + this.agentName = agentName; + this.agentVersion = agentVersion; + } + + /** + * Get the promotedAt property: Timestamp when promotion occurred, represented in Unix time. + * + * @return the promotedAt value. + */ + @Generated + public OffsetDateTime getPromotedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.promotedAt), ZoneOffset.UTC); + } + + /** + * Get the agentName property: Name of the Foundry agent this candidate was promoted to. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: Version of the Foundry agent this candidate was promoted to. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("promoted_at", this.promotedAt); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PromotionInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PromotionInfo if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PromotionInfo. + */ + @Generated + public static PromotionInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime promotedAt = null; + String agentName = null; + String agentVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("promoted_at".equals(fieldName)) { + promotedAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new PromotionInfo(promotedAt, agentName, agentVersion); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java index 1061c9e2a476..aca87b1a51dd 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java @@ -43,7 +43,7 @@ public final class PromptAgentDefinition extends AgentDefinition { /* * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while * lower values like 0.2 will make it more focused and deterministic. - * We generally recommend altering this or `top_p` but not both. + * We generally recommend altering this or `top_p` but not both. Defaults to `1`. */ @Generated private Double temperature; @@ -52,9 +52,8 @@ public final class PromptAgentDefinition extends AgentDefinition { * An alternative to sampling with temperature, called nucleus sampling, * where the model considers the results of the tokens with top_p probability * mass. So 0.1 means only the tokens comprising the top 10% probability mass - * are considered. - * - * We generally recommend altering this or `temperature` but not both. + * are considered. We generally recommend altering this or `temperature` but not both. + * Defaults to `1`. */ @Generated private Double topP; @@ -137,7 +136,7 @@ public PromptAgentDefinition setInstructions(String instructions) { /** * Get the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make * the output more random, while lower values like 0.2 will make it more focused and deterministic. - * We generally recommend altering this or `top_p` but not both. + * We generally recommend altering this or `top_p` but not both. Defaults to `1`. * * @return the temperature value. */ @@ -149,7 +148,7 @@ public Double getTemperature() { /** * Set the temperature property: What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make * the output more random, while lower values like 0.2 will make it more focused and deterministic. - * We generally recommend altering this or `top_p` but not both. + * We generally recommend altering this or `top_p` but not both. Defaults to `1`. * * @param temperature the temperature value to set. * @return the PromptAgentDefinition object itself. @@ -164,9 +163,8 @@ public PromptAgentDefinition setTemperature(Double temperature) { * Get the topP property: An alternative to sampling with temperature, called nucleus sampling, * where the model considers the results of the tokens with top_p probability * mass. So 0.1 means only the tokens comprising the top 10% probability mass - * are considered. - * - * We generally recommend altering this or `temperature` but not both. + * are considered. We generally recommend altering this or `temperature` but not both. + * Defaults to `1`. * * @return the topP value. */ @@ -179,9 +177,8 @@ public Double getTopP() { * Set the topP property: An alternative to sampling with temperature, called nucleus sampling, * where the model considers the results of the tokens with top_p probability * mass. So 0.1 means only the tokens comprising the top 10% probability mass - * are considered. - * - * We generally recommend altering this or `temperature` but not both. + * are considered. We generally recommend altering this or `temperature` but not both. + * Defaults to `1`. * * @param topP the topP value to set. * @return the PromptAgentDefinition object itself. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryEntry.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryEntry.java index d4f543ca4406..20b1351ae2e3 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryEntry.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryEntry.java @@ -5,14 +5,14 @@ import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; -import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.time.Instant; import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; +import java.time.ZoneOffset; /** * A single entry in a directory listing. @@ -39,10 +39,10 @@ public final class SessionDirectoryEntry implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + modifiedTime = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); } else { reader.skipChildren(); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryListResponse.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryListResponse.java deleted file mode 100644 index b2cdc1cfe8a7..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionDirectoryListResponse.java +++ /dev/null @@ -1,105 +0,0 @@ -// 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.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * Response from listing a directory in a session sandbox. - */ -@Immutable -public final class SessionDirectoryListResponse implements JsonSerializable { - - /* - * The path that was listed, relative to the session home directory. - */ - @Generated - private final String path; - - /* - * The directory entries. - */ - @Generated - private final List entries; - - /** - * Creates an instance of SessionDirectoryListResponse class. - * - * @param path the path value to set. - * @param entries the entries value to set. - */ - @Generated - private SessionDirectoryListResponse(String path, List entries) { - this.path = path; - this.entries = entries; - } - - /** - * Get the path property: The path that was listed, relative to the session home directory. - * - * @return the path value. - */ - @Generated - public String getPath() { - return this.path; - } - - /** - * Get the entries property: The directory entries. - * - * @return the entries value. - */ - @Generated - public List getEntries() { - return this.entries; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("path", this.path); - jsonWriter.writeArrayField("entries", this.entries, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SessionDirectoryListResponse from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SessionDirectoryListResponse if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SessionDirectoryListResponse. - */ - @Generated - public static SessionDirectoryListResponse fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String path = null; - List entries = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("path".equals(fieldName)) { - path = reader.getString(); - } else if ("entries".equals(fieldName)) { - entries = reader.readArray(reader1 -> SessionDirectoryEntry.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - return new SessionDirectoryListResponse(path, entries); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionFileWriteResponse.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionFileWriteResult.java similarity index 80% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionFileWriteResponse.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionFileWriteResult.java index d9e4a6925916..396c0fc96460 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionFileWriteResponse.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SessionFileWriteResult.java @@ -15,7 +15,7 @@ * Response from uploading a file to a session sandbox. */ @Immutable -public final class SessionFileWriteResponse implements JsonSerializable { +public final class SessionFileWriteResult implements JsonSerializable { /* * The path where the file was written, relative to the session home directory. @@ -30,13 +30,13 @@ public final class SessionFileWriteResponse implements JsonSerializable { String path = null; long bytesWritten = 0L; @@ -98,7 +98,7 @@ public static SessionFileWriteResponse fromJson(JsonReader jsonReader) throws IO reader.skipChildren(); } } - return new SessionFileWriteResponse(path, bytesWritten); + return new SessionFileWriteResult(path, bytesWritten); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCall.java new file mode 100644 index 000000000000..ecdb21c03ba6 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCall.java @@ -0,0 +1,143 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A SharePoint grounding tool call. + */ +@Immutable +public final class SharepointGroundingToolCall implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "sharepoint_grounding_preview_call"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * A JSON string of the arguments to pass to the tool. + */ + @Generated + private final String arguments; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of SharepointGroundingToolCall class. + * + * @param callId the callId value to set. + * @param arguments the arguments value to set. + * @param status the status value to set. + */ + @Generated + public SharepointGroundingToolCall(String callId, String arguments, ToolCallStatus status) { + this.callId = callId; + this.arguments = arguments; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the arguments property: A JSON string of the arguments to pass to the tool. + * + * @return the arguments value. + */ + @Generated + public String getArguments() { + return this.arguments; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("arguments", this.arguments); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharepointGroundingToolCall from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharepointGroundingToolCall if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SharepointGroundingToolCall. + */ + @Generated + public static SharepointGroundingToolCall fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + String arguments = null; + ToolCallStatus status = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + arguments = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return new SharepointGroundingToolCall(callId, arguments, status); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCallOutput.java new file mode 100644 index 000000000000..354846c7659a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCallOutput.java @@ -0,0 +1,160 @@ +// 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.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The output of a SharePoint grounding tool call. + */ +@Fluent +public final class SharepointGroundingToolCallOutput implements JsonSerializable { + + /* + * The type property. + */ + @Generated + private final String type = "sharepoint_grounding_preview_call_output"; + + /* + * The unique ID of the tool call generated by the model. + */ + @Generated + private final String callId; + + /* + * The output from the SharePoint grounding tool call. + */ + @Generated + private BinaryData output; + + /* + * The status of the tool call. + */ + @Generated + private final ToolCallStatus status; + + /** + * Creates an instance of SharepointGroundingToolCallOutput class. + * + * @param callId the callId value to set. + * @param status the status value to set. + */ + @Generated + public SharepointGroundingToolCallOutput(String callId, ToolCallStatus status) { + this.callId = callId; + this.status = status; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the callId property: The unique ID of the tool call generated by the model. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * Get the output property: The output from the SharePoint grounding tool call. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * Set the output property: The output from the SharePoint grounding tool call. + * + * @param output the output value to set. + * @return the SharepointGroundingToolCallOutput object itself. + */ + @Generated + public SharepointGroundingToolCallOutput setOutput(BinaryData output) { + this.output = output; + return this; + } + + /** + * Get the status property: The status of the tool call. + * + * @return the status value. + */ + @Generated + public ToolCallStatus getStatus() { + return this.status; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("call_id", this.callId); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + if (this.output != null) { + jsonWriter.writeFieldName("output"); + this.output.writeTo(jsonWriter); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SharepointGroundingToolCallOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SharepointGroundingToolCallOutput if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SharepointGroundingToolCallOutput. + */ + @Generated + public static SharepointGroundingToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = null; + ToolCallStatus status = null; + BinaryData output = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("call_id".equals(fieldName)) { + callId = reader.getString(); + } else if ("status".equals(fieldName)) { + status = ToolCallStatus.fromString(reader.getString()); + } else if ("output".equals(fieldName)) { + output = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else { + reader.skipChildren(); + } + } + SharepointGroundingToolCallOutput deserializedSharepointGroundingToolCallOutput + = new SharepointGroundingToolCallOutput(callId, status); + deserializedSharepointGroundingToolCallOutput.output = output; + return deserializedSharepointGroundingToolCallOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java index 6cdc2f1101d0..4c4e1ee37649 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java @@ -3,17 +3,18 @@ // 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.Map; /** * The input definition information for a sharepoint tool as used to configure an agent. */ -@Immutable +@Fluent public final class SharepointPreviewTool extends Tool { /* @@ -68,6 +69,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("sharepoint_grounding_preview", this.sharepointGroundingPreview); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -85,6 +89,9 @@ public static SharepointPreviewTool fromJson(JsonReader jsonReader) throws IOExc return jsonReader.readObject(reader -> { SharepointGroundingToolParameters sharepointGroundingPreview = null; ToolType type = ToolType.SHAREPOINT_GROUNDING_PREVIEW; + String name = null; + String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -92,6 +99,12 @@ public static SharepointPreviewTool fromJson(JsonReader jsonReader) throws IOExc sharepointGroundingPreview = SharepointGroundingToolParameters.fromJson(reader); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } @@ -99,7 +112,100 @@ public static SharepointPreviewTool fromJson(JsonReader jsonReader) throws IOExc SharepointPreviewTool deserializedSharepointPreviewTool = new SharepointPreviewTool(sharepointGroundingPreview); deserializedSharepointPreviewTool.type = type; + deserializedSharepointPreviewTool.name = name; + deserializedSharepointPreviewTool.description = description; + deserializedSharepointPreviewTool.toolConfigs = toolConfigs; return deserializedSharepointPreviewTool; }); } + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the SharepointPreviewTool object itself. + */ + @Generated + public SharepointPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the SharepointPreviewTool object itself. + */ + @Generated + public SharepointPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the SharepointPreviewTool object itself. + */ + @Generated + public SharepointPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/StructuredInputDefinition.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/StructuredInputDefinition.java index d72f2a45b49b..60d5c0cf49ec 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/StructuredInputDefinition.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/StructuredInputDefinition.java @@ -38,7 +38,8 @@ public final class StructuredInputDefinition implements JsonSerializable schema; /* - * Whether the input property is required when the agent is invoked. + * Whether the input property is required when the agent is invoked. The service defaults to `false` if a value is + * not specified by the caller. */ @Generated private Boolean required; @@ -105,7 +106,8 @@ public Map getSchema() { } /** - * Get the required property: Whether the input property is required when the agent is invoked. + * Get the required property: Whether the input property is required when the agent is invoked. The service defaults + * to `false` if a value is not specified by the caller. * * @return the required value. */ @@ -115,7 +117,8 @@ public Boolean isRequired() { } /** - * Set the required property: Whether the input property is required when the agent is invoked. + * Set the required property: Whether the input property is required when the agent is invoked. The service defaults + * to `false` if a value is not specified by the caller. * * @param required the required value to set. * @return the StructuredInputDefinition object itself. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryConfig.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryConfig.java new file mode 100644 index 000000000000..1be6ae6ad382 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryConfig.java @@ -0,0 +1,83 @@ +// 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.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Customer-supplied telemetry configuration for exporting container logs, traces, and metrics. + */ +@Immutable +public final class TelemetryConfig implements JsonSerializable { + + /* + * Customer-supplied telemetry export endpoint configurations. + */ + @Generated + private final List endpoints; + + /** + * Creates an instance of TelemetryConfig class. + * + * @param endpoints the endpoints value to set. + */ + @Generated + public TelemetryConfig(List endpoints) { + this.endpoints = endpoints; + } + + /** + * Get the endpoints property: Customer-supplied telemetry export endpoint configurations. + * + * @return the endpoints value. + */ + @Generated + public List getEndpoints() { + return this.endpoints; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("endpoints", this.endpoints, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TelemetryConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TelemetryConfig if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TelemetryConfig. + */ + @Generated + public static TelemetryConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List endpoints = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("endpoints".equals(fieldName)) { + endpoints = reader.readArray(reader1 -> TelemetryEndpoint.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TelemetryConfig(endpoints); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryDataKind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryDataKind.java new file mode 100644 index 000000000000..e42b9c927d9c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryDataKind.java @@ -0,0 +1,63 @@ +// 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 type of telemetry data to export. + */ +public final class TelemetryDataKind extends ExpandableStringEnum { + + /** + * Container stdout and stderr logs. + */ + @Generated + public static final TelemetryDataKind CONTAINER_STDOUT_STDERR = fromString("ContainerStdoutStderr"); + + /** + * Container OpenTelemetry signals. + */ + @Generated + public static final TelemetryDataKind CONTAINER_OTEL = fromString("ContainerOtel"); + + /** + * Container metrics. + */ + @Generated + public static final TelemetryDataKind METRICS = fromString("Metrics"); + + /** + * Creates a new instance of TelemetryDataKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TelemetryDataKind() { + } + + /** + * Creates or finds a TelemetryDataKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding TelemetryDataKind. + */ + @Generated + public static TelemetryDataKind fromString(String name) { + return fromString(name, TelemetryDataKind.class); + } + + /** + * Gets known TelemetryDataKind values. + * + * @return known TelemetryDataKind values. + */ + @Generated + public static Collection values() { + return values(TelemetryDataKind.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpoint.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpoint.java new file mode 100644 index 000000000000..cddb20a8caa4 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpoint.java @@ -0,0 +1,166 @@ +// 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; +import java.util.List; + +/** + * A telemetry export endpoint configuration. + */ +@Fluent +public class TelemetryEndpoint implements JsonSerializable { + + /* + * The telemetry export endpoint kind. + */ + @Generated + private TelemetryEndpointKind kind = TelemetryEndpointKind.fromString("TelemetryEndpoint"); + + /* + * Data types to export to this endpoint. Use an empty array to export no data. + */ + @Generated + private final List data; + + /* + * Optional authentication configuration. + */ + @Generated + private TelemetryEndpointAuth auth; + + /** + * Creates an instance of TelemetryEndpoint class. + * + * @param data the data value to set. + */ + @Generated + public TelemetryEndpoint(List data) { + this.data = data; + } + + /** + * Get the kind property: The telemetry export endpoint kind. + * + * @return the kind value. + */ + @Generated + public TelemetryEndpointKind getKind() { + return this.kind; + } + + /** + * Get the data property: Data types to export to this endpoint. Use an empty array to export no data. + * + * @return the data value. + */ + @Generated + public List getData() { + return this.data; + } + + /** + * Get the auth property: Optional authentication configuration. + * + * @return the auth value. + */ + @Generated + public TelemetryEndpointAuth getAuth() { + return this.auth; + } + + /** + * Set the auth property: Optional authentication configuration. + * + * @param auth the auth value to set. + * @return the TelemetryEndpoint object itself. + */ + @Generated + public TelemetryEndpoint setAuth(TelemetryEndpointAuth auth) { + this.auth = auth; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("data", this.data, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); + jsonWriter.writeJsonField("auth", this.auth); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TelemetryEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TelemetryEndpoint if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TelemetryEndpoint. + */ + @Generated + public static TelemetryEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("kind".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("OTLP".equals(discriminatorValue)) { + return OtlpTelemetryEndpoint.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static TelemetryEndpoint fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List data = null; + TelemetryEndpointKind kind = null; + TelemetryEndpointAuth auth = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("data".equals(fieldName)) { + data = reader.readArray(reader1 -> TelemetryDataKind.fromString(reader1.getString())); + } else if ("kind".equals(fieldName)) { + kind = TelemetryEndpointKind.fromString(reader.getString()); + } else if ("auth".equals(fieldName)) { + auth = TelemetryEndpointAuth.fromJson(reader); + } else { + reader.skipChildren(); + } + } + TelemetryEndpoint deserializedTelemetryEndpoint = new TelemetryEndpoint(data); + deserializedTelemetryEndpoint.kind = kind; + deserializedTelemetryEndpoint.auth = auth; + return deserializedTelemetryEndpoint; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuth.java similarity index 62% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContent.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuth.java index 0105c569543d..aaa2802ebaf3 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContent.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuth.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.agents.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,31 +12,31 @@ import java.io.IOException; /** - * The OutputMessageContent model. + * Authentication configuration for a telemetry endpoint. */ @Immutable -public class OutputMessageContent implements JsonSerializable { +public class TelemetryEndpointAuth implements JsonSerializable { /* - * The type property. + * The authentication type. */ @Generated - private OutputMessageContentType type = OutputMessageContentType.fromString("OutputMessageContent"); + private TelemetryEndpointAuthType type = TelemetryEndpointAuthType.fromString("TelemetryEndpointAuth"); /** - * Creates an instance of OutputMessageContent class. + * Creates an instance of TelemetryEndpointAuth class. */ @Generated - public OutputMessageContent() { + public TelemetryEndpointAuth() { } /** - * Get the type property: The type property. + * Get the type property: The authentication type. * * @return the type value. */ @Generated - public OutputMessageContentType getType() { + public TelemetryEndpointAuthType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of OutputMessageContent from the JsonReader. + * Reads an instance of TelemetryEndpointAuth from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of OutputMessageContent if the JsonReader was pointing to an instance of it, or null if it + * @return An instance of TelemetryEndpointAuth 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 OutputMessageContent. + * @throws IOException If an error occurs while reading the TelemetryEndpointAuth. */ @Generated - public static OutputMessageContent fromJson(JsonReader jsonReader) throws IOException { + public static TelemetryEndpointAuth fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,10 +77,8 @@ public static OutputMessageContent fromJson(JsonReader jsonReader) throws IOExce } } // Use the discriminator value to determine which subtype should be deserialized. - if ("output_text".equals(discriminatorValue)) { - return OutputMessageContentOutputTextContent.fromJson(readerToUse.reset()); - } else if ("refusal".equals(discriminatorValue)) { - return OutputMessageContentRefusalContent.fromJson(readerToUse.reset()); + if ("header".equals(discriminatorValue)) { + return HeaderTelemetryEndpointAuth.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -89,19 +87,19 @@ public static OutputMessageContent fromJson(JsonReader jsonReader) throws IOExce } @Generated - static OutputMessageContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static TelemetryEndpointAuth fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - OutputMessageContent deserializedOutputMessageContent = new OutputMessageContent(); + TelemetryEndpointAuth deserializedTelemetryEndpointAuth = new TelemetryEndpointAuth(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedOutputMessageContent.type = OutputMessageContentType.fromString(reader.getString()); + deserializedTelemetryEndpointAuth.type = TelemetryEndpointAuthType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedOutputMessageContent; + return deserializedTelemetryEndpointAuth; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuthType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuthType.java new file mode 100644 index 000000000000..01e610a655eb --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuthType.java @@ -0,0 +1,51 @@ +// 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 type of authentication for a telemetry endpoint. + */ +public final class TelemetryEndpointAuthType extends ExpandableStringEnum { + + /** + * Header-based secret authentication. + */ + @Generated + public static final TelemetryEndpointAuthType HEADER = fromString("header"); + + /** + * Creates a new instance of TelemetryEndpointAuthType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TelemetryEndpointAuthType() { + } + + /** + * Creates or finds a TelemetryEndpointAuthType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TelemetryEndpointAuthType. + */ + @Generated + public static TelemetryEndpointAuthType fromString(String name) { + return fromString(name, TelemetryEndpointAuthType.class); + } + + /** + * Gets known TelemetryEndpointAuthType values. + * + * @return known TelemetryEndpointAuthType values. + */ + @Generated + public static Collection values() { + return values(TelemetryEndpointAuthType.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointKind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointKind.java new file mode 100644 index 000000000000..aa77cc337cf4 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryEndpointKind.java @@ -0,0 +1,51 @@ +// 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 kind of telemetry export endpoint. + */ +public final class TelemetryEndpointKind extends ExpandableStringEnum { + + /** + * OpenTelemetry Protocol (OTLP) endpoint. + */ + @Generated + public static final TelemetryEndpointKind OTLP = fromString("OTLP"); + + /** + * Creates a new instance of TelemetryEndpointKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TelemetryEndpointKind() { + } + + /** + * Creates or finds a TelemetryEndpointKind from its string representation. + * + * @param name a name to look for. + * @return the corresponding TelemetryEndpointKind. + */ + @Generated + public static TelemetryEndpointKind fromString(String name) { + return fromString(name, TelemetryEndpointKind.class); + } + + /** + * Gets known TelemetryEndpointKind values. + * + * @return known TelemetryEndpointKind values. + */ + @Generated + public static Collection values() { + return values(TelemetryEndpointKind.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryTransportProtocol.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryTransportProtocol.java new file mode 100644 index 000000000000..2e0365a22fa3 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TelemetryTransportProtocol.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 transport protocol for telemetry export. + */ +public final class TelemetryTransportProtocol extends ExpandableStringEnum { + + /** + * HTTP transport protocol. + */ + @Generated + public static final TelemetryTransportProtocol HTTP = fromString("Http"); + + /** + * gRPC transport protocol. + */ + @Generated + public static final TelemetryTransportProtocol GRPC = fromString("Grpc"); + + /** + * Creates a new instance of TelemetryTransportProtocol value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TelemetryTransportProtocol() { + } + + /** + * Creates or finds a TelemetryTransportProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding TelemetryTransportProtocol. + */ + @Generated + public static TelemetryTransportProtocol fromString(String name) { + return fromString(name, TelemetryTransportProtocol.class); + } + + /** + * Gets known TelemetryTransportProtocol values. + * + * @return known TelemetryTransportProtocol values. + */ + @Generated + public static Collection values() { + return values(TelemetryTransportProtocol.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Tool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Tool.java index 38481372f097..945afbf6b46e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Tool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Tool.java @@ -99,8 +99,12 @@ public static Tool fromJson(JsonReader jsonReader) throws IOException { return A2APreviewTool.fromJson(readerToUse.reset()); } else if ("work_iq_preview".equals(discriminatorValue)) { return WorkIqPreviewTool.fromJson(readerToUse.reset()); + } else if ("fabric_iq_preview".equals(discriminatorValue)) { + return FabricIqPreviewTool.fromJson(readerToUse.reset()); } else if ("memory_search_preview".equals(discriminatorValue)) { return MemorySearchPreviewTool.fromJson(readerToUse.reset()); + } else if ("toolbox_search_preview".equals(discriminatorValue)) { + return ToolboxSearchPreviewTool.fromJson(readerToUse.reset()); } else if ("code_interpreter".equals(discriminatorValue)) { return CodeInterpreterTool.fromJson(readerToUse.reset()); } else if ("function".equals(discriminatorValue)) { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolCallStatus.java similarity index 60% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpToolCallStatus.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolCallStatus.java index 4d476db72ff2..b8611ca3afd5 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/McpToolCallStatus.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolCallStatus.java @@ -2,12 +2,12 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.agents.implementation.models; +package com.azure.ai.agents.models; /** - * Defines values for McpToolCallStatus. + * The status of a tool call. */ -public enum McpToolCallStatus { +public enum ToolCallStatus { /** * Enum value in_progress. */ @@ -23,37 +23,32 @@ public enum McpToolCallStatus { */ INCOMPLETE("incomplete"), - /** - * Enum value calling. - */ - CALLING("calling"), - /** * Enum value failed. */ FAILED("failed"); /** - * The actual serialized value for a McpToolCallStatus instance. + * The actual serialized value for a ToolCallStatus instance. */ private final String value; - McpToolCallStatus(String value) { + ToolCallStatus(String value) { this.value = value; } /** - * Parses a serialized value to a McpToolCallStatus instance. + * Parses a serialized value to a ToolCallStatus instance. * * @param value the serialized value to parse. - * @return the parsed McpToolCallStatus object, or null if unable to parse. + * @return the parsed ToolCallStatus object, or null if unable to parse. */ - public static McpToolCallStatus fromString(String value) { + public static ToolCallStatus fromString(String value) { if (value == null) { return null; } - McpToolCallStatus[] items = McpToolCallStatus.values(); - for (McpToolCallStatus item : items) { + ToolCallStatus[] items = ToolCallStatus.values(); + for (ToolCallStatus item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolConfig.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolConfig.java new file mode 100644 index 000000000000..5070caad7af4 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolConfig.java @@ -0,0 +1,129 @@ +// 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; + +/** + * Per-tool configuration that controls tool visibility and search behavior. + */ +@Fluent +public final class ToolConfig implements JsonSerializable { + + /* + * When true, the tool is always included in agent context and visible in `tools/list`. + * When false (default), the tool is hidden from `tools/list` and only discoverable via `tool_search`. + */ + @Generated + private Boolean pin; + + /* + * Additional text indexed for tool_search. Supplements the native tool description + * to improve discoverability. Does not alter `tools/list` output. + */ + @Generated + private String additionalSearchText; + + /** + * Creates an instance of ToolConfig class. + */ + @Generated + public ToolConfig() { + } + + /** + * Get the pin property: When true, the tool is always included in agent context and visible in `tools/list`. + * When false (default), the tool is hidden from `tools/list` and only discoverable via `tool_search`. + * + * @return the pin value. + */ + @Generated + public Boolean isPin() { + return this.pin; + } + + /** + * Set the pin property: When true, the tool is always included in agent context and visible in `tools/list`. + * When false (default), the tool is hidden from `tools/list` and only discoverable via `tool_search`. + * + * @param pin the pin value to set. + * @return the ToolConfig object itself. + */ + @Generated + public ToolConfig setPin(Boolean pin) { + this.pin = pin; + return this; + } + + /** + * Get the additionalSearchText property: Additional text indexed for tool_search. Supplements the native tool + * description + * to improve discoverability. Does not alter `tools/list` output. + * + * @return the additionalSearchText value. + */ + @Generated + public String getAdditionalSearchText() { + return this.additionalSearchText; + } + + /** + * Set the additionalSearchText property: Additional text indexed for tool_search. Supplements the native tool + * description + * to improve discoverability. Does not alter `tools/list` output. + * + * @param additionalSearchText the additionalSearchText value to set. + * @return the ToolConfig object itself. + */ + @Generated + public ToolConfig setAdditionalSearchText(String additionalSearchText) { + this.additionalSearchText = additionalSearchText; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("pin", this.pin); + jsonWriter.writeStringField("additional_search_text", this.additionalSearchText); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ToolConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ToolConfig 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 ToolConfig. + */ + @Generated + public static ToolConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ToolConfig deserializedToolConfig = new ToolConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("pin".equals(fieldName)) { + deserializedToolConfig.pin = reader.getNullable(JsonReader::getBoolean); + } else if ("additional_search_text".equals(fieldName)) { + deserializedToolConfig.additionalSearchText = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedToolConfig; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolType.java index 0826c0926809..7c40d8f7f4c2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolType.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolType.java @@ -186,4 +186,16 @@ public static Collection values() { */ @Generated public static final ToolType WORK_IQ_PREVIEW = fromString("work_iq_preview"); + + /** + * Static value fabric_iq_preview for ToolType. + */ + @Generated + public static final ToolType FABRIC_IQ_PREVIEW = fromString("fabric_iq_preview"); + + /** + * Static value toolbox_search_preview for ToolType. + */ + @Generated + public static final ToolType TOOLBOX_SEARCH_PREVIEW = fromString("toolbox_search_preview"); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSearchPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSearchPreviewTool.java new file mode 100644 index 000000000000..164671968aed --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSearchPreviewTool.java @@ -0,0 +1,181 @@ +// 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.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A tool for searching over the agent's toolbox. + * When present, deferred tools are hidden from `tools/list` and only + * discoverable via `search_tools` queries at runtime. + */ +@Fluent +public final class ToolboxSearchPreviewTool extends Tool { + + /* + * The type property. + */ + @Generated + private ToolType type = ToolType.TOOLBOX_SEARCH_PREVIEW; + + /* + * Optional user-defined name for this tool or configuration. + */ + @Generated + private String name; + + /* + * Optional user-defined description for this tool or configuration. + */ + @Generated + private String description; + + /** + * Creates an instance of ToolboxSearchPreviewTool class. + */ + @Generated + public ToolboxSearchPreviewTool() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public ToolType getType() { + return this.type; + } + + /** + * Get the name property: Optional user-defined name for this tool or configuration. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Optional user-defined name for this tool or configuration. + * + * @param name the name value to set. + * @return the ToolboxSearchPreviewTool object itself. + */ + @Generated + public ToolboxSearchPreviewTool setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Optional user-defined description for this tool or configuration. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional user-defined description for this tool or configuration. + * + * @param description the description value to set. + * @return the ToolboxSearchPreviewTool object itself. + */ + @Generated + public ToolboxSearchPreviewTool setDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ToolboxSearchPreviewTool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ToolboxSearchPreviewTool 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 ToolboxSearchPreviewTool. + */ + @Generated + public static ToolboxSearchPreviewTool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ToolboxSearchPreviewTool deserializedToolboxSearchPreviewTool = new ToolboxSearchPreviewTool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedToolboxSearchPreviewTool.type = ToolType.fromString(reader.getString()); + } else if ("name".equals(fieldName)) { + deserializedToolboxSearchPreviewTool.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedToolboxSearchPreviewTool.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedToolboxSearchPreviewTool.toolConfigs = toolConfigs; + } else { + reader.skipChildren(); + } + } + return deserializedToolboxSearchPreviewTool; + }); + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the ToolboxSearchPreviewTool object itself. + */ + @Generated + public ToolboxSearchPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MessageContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSkill.java similarity index 64% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MessageContent.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSkill.java index c73b246a0728..62eb231c4c8a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/MessageContent.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSkill.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.agents.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,31 +12,31 @@ import java.io.IOException; /** - * A content part that makes up an input or output item. + * A skill source included in a toolbox. */ @Immutable -public class MessageContent implements JsonSerializable { +public class ToolboxSkill implements JsonSerializable { /* - * The type property. + * The type of skill source. */ @Generated - private MessageContentType type = MessageContentType.fromString("MessageContent"); + private String type = "ToolboxSkill"; /** - * Creates an instance of MessageContent class. + * Creates an instance of ToolboxSkill class. */ @Generated - public MessageContent() { + public ToolboxSkill() { } /** - * Get the type property: The type property. + * Get the type property: The type of skill source. * * @return the type value. */ @Generated - public MessageContentType getType() { + public String getType() { return this.type; } @@ -47,20 +47,20 @@ public MessageContentType getType() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("type", this.type); return jsonWriter.writeEndObject(); } /** - * Reads an instance of MessageContent from the JsonReader. + * Reads an instance of ToolboxSkill from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MessageContent if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of ToolboxSkill 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 MessageContent. + * @throws IOException If an error occurs while reading the ToolboxSkill. */ @Generated - public static MessageContent fromJson(JsonReader jsonReader) throws IOException { + public static ToolboxSkill fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,8 +77,8 @@ public static MessageContent fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("summary_text".equals(discriminatorValue)) { - return SummaryTextContent.fromJson(readerToUse.reset()); + if ("skill_reference".equals(discriminatorValue)) { + return ToolboxSkillReference.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -87,19 +87,19 @@ public static MessageContent fromJson(JsonReader jsonReader) throws IOException } @Generated - static MessageContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static ToolboxSkill fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - MessageContent deserializedMessageContent = new MessageContent(); + ToolboxSkill deserializedToolboxSkill = new ToolboxSkill(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedMessageContent.type = MessageContentType.fromString(reader.getString()); + deserializedToolboxSkill.type = reader.getString(); } else { reader.skipChildren(); } } - return deserializedMessageContent; + return deserializedToolboxSkill; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSkillReference.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSkillReference.java new file mode 100644 index 000000000000..5fe213b5ca52 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxSkillReference.java @@ -0,0 +1,140 @@ +// 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.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A reference to an existing skill to include in a toolbox. + */ +@Fluent +public final class ToolboxSkillReference extends ToolboxSkill { + + /* + * The type of skill source. + */ + @Generated + private String type = "skill_reference"; + + /* + * The name of the skill. + */ + @Generated + private final String name; + + /* + * The version of the skill. If not specified, the skill's default version is used. When a version is specified, the + * reference is pinned to that immutable version. + */ + @Generated + private String version; + + /** + * Creates an instance of ToolboxSkillReference class. + * + * @param name the name value to set. + */ + @Generated + public ToolboxSkillReference(String name) { + this.name = name; + } + + /** + * Get the type property: The type of skill source. + * + * @return the type value. + */ + @Generated + @Override + public String getType() { + return this.type; + } + + /** + * Get the name property: The name of the skill. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: The version of the skill. If not specified, the skill's default version is used. When a + * version is specified, the reference is pinned to that immutable version. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Set the version property: The version of the skill. If not specified, the skill's default version is used. When a + * version is specified, the reference is pinned to that immutable version. + * + * @param version the version value to set. + * @return the ToolboxSkillReference object itself. + */ + @Generated + public ToolboxSkillReference setVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ToolboxSkillReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ToolboxSkillReference if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ToolboxSkillReference. + */ + @Generated + public static ToolboxSkillReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String type = "skill_reference"; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + ToolboxSkillReference deserializedToolboxSkillReference = new ToolboxSkillReference(name); + deserializedToolboxSkillReference.type = type; + deserializedToolboxSkillReference.version = version; + return deserializedToolboxSkillReference; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxVersionDetails.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxVersionDetails.java index e8a7fce99425..a37a4a059d19 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxVersionDetails.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ToolboxVersionDetails.java @@ -200,6 +200,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeLongField("created_at", this.createdAt); jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeArrayField("skills", this.skills, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("policies", this.policies); return jsonWriter.writeEndObject(); } @@ -223,6 +224,7 @@ public static ToolboxVersionDetails fromJson(JsonReader jsonReader) throws IOExc OffsetDateTime createdAt = null; List tools = null; String description = null; + List skills = null; ToolboxPolicies policies = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -241,6 +243,8 @@ public static ToolboxVersionDetails fromJson(JsonReader jsonReader) throws IOExc tools = reader.readArray(reader1 -> Tool.fromJson(reader1)); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("skills".equals(fieldName)) { + skills = reader.readArray(reader1 -> ToolboxSkill.fromJson(reader1)); } else if ("policies".equals(fieldName)) { policies = ToolboxPolicies.fromJson(reader); } else { @@ -250,8 +254,25 @@ public static ToolboxVersionDetails fromJson(JsonReader jsonReader) throws IOExc ToolboxVersionDetails deserializedToolboxVersionDetails = new ToolboxVersionDetails(metadata, id, name, version, createdAt, tools); deserializedToolboxVersionDetails.description = description; + deserializedToolboxVersionDetails.skills = skills; deserializedToolboxVersionDetails.policies = policies; return deserializedToolboxVersionDetails; }); } + + /* + * The list of skill sources included in this toolbox version. + */ + @Generated + private List skills; + + /** + * Get the skills property: The list of skill sources included in this toolbox version. + * + * @return the skills value. + */ + @Generated + public List getSkills() { + return this.skills; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UpdateAgentDetailsOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UpdateAgentDetailsOptions.java index ddb11a72baa4..69d7190e135a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UpdateAgentDetailsOptions.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UpdateAgentDetailsOptions.java @@ -24,7 +24,7 @@ public final class UpdateAgentDetailsOptions implements JsonSerializable writer.writeJson(element)); jsonWriter.writeJsonField("custom_search_configuration", this.customSearchConfiguration); return jsonWriter.writeEndObject(); } @@ -209,6 +211,9 @@ public static WebSearchTool fromJson(JsonReader jsonReader) throws IOException { deserializedWebSearchTool.name = reader.getString(); } else if ("description".equals(fieldName)) { deserializedWebSearchTool.description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + Map toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); + deserializedWebSearchTool.toolConfigs = toolConfigs; } else if ("custom_search_configuration".equals(fieldName)) { deserializedWebSearchTool.customSearchConfiguration = WebSearchConfiguration.fromJson(reader); } else { @@ -274,4 +279,38 @@ public WebSearchTool setDescription(String description) { this.description = description; return this; } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the WebSearchTool object itself. + */ + @Generated + public WebSearchTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIQPreviewToolParameters.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIQPreviewToolParameters.java deleted file mode 100644 index e003d7a5dd90..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIQPreviewToolParameters.java +++ /dev/null @@ -1,82 +0,0 @@ -// 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.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The WorkIQ tool parameters. - */ -@Immutable -public final class WorkIQPreviewToolParameters implements JsonSerializable { - - /* - * The ID of the WorkIQ project connection. - */ - @Generated - private final String projectConnectionId; - - /** - * Creates an instance of WorkIQPreviewToolParameters class. - * - * @param projectConnectionId the projectConnectionId value to set. - */ - @Generated - public WorkIQPreviewToolParameters(String projectConnectionId) { - this.projectConnectionId = projectConnectionId; - } - - /** - * Get the projectConnectionId property: The ID of the WorkIQ project connection. - * - * @return the projectConnectionId value. - */ - @Generated - public String getProjectConnectionId() { - return this.projectConnectionId; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("project_connection_id", this.projectConnectionId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WorkIQPreviewToolParameters from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WorkIQPreviewToolParameters if the JsonReader was pointing to an instance of it, or null - * if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the WorkIQPreviewToolParameters. - */ - @Generated - public static WorkIQPreviewToolParameters fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String projectConnectionId = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("project_connection_id".equals(fieldName)) { - projectConnectionId = reader.getString(); - } else { - reader.skipChildren(); - } - } - return new WorkIQPreviewToolParameters(projectConnectionId); - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIqPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIqPreviewTool.java index 527e7a4d8bb0..98bec0c07a81 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIqPreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WorkIqPreviewTool.java @@ -9,6 +9,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** * A WorkIQ server-side tool. @@ -34,22 +35,6 @@ public final class WorkIqPreviewTool extends Tool { @Generated private String description; - /* - * The WorkIQ tool parameters. - */ - @Generated - private final WorkIQPreviewToolParameters workIqPreview; - - /** - * Creates an instance of WorkIqPreviewTool class. - * - * @param workIqPreview the workIqPreview value to set. - */ - @Generated - public WorkIqPreviewTool(WorkIQPreviewToolParameters workIqPreview) { - this.workIqPreview = workIqPreview; - } - /** * Get the type property: The type property. * @@ -105,16 +90,6 @@ public WorkIqPreviewTool setDescription(String description) { return this; } - /** - * Get the workIqPreview property: The WorkIQ tool parameters. - * - * @return the workIqPreview value. - */ - @Generated - public WorkIQPreviewToolParameters getWorkIqPreview() { - return this.workIqPreview; - } - /** * {@inheritDoc} */ @@ -122,10 +97,11 @@ public WorkIQPreviewToolParameters getWorkIqPreview() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("work_iq_preview", this.workIqPreview); + jsonWriter.writeStringField("project_connection_id", this.projectConnectionId); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("name", this.name); jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tool_configs", this.toolConfigs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -141,30 +117,94 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static WorkIqPreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - WorkIQPreviewToolParameters workIqPreview = null; + String projectConnectionId = null; ToolType type = ToolType.WORK_IQ_PREVIEW; String name = null; String description = null; + Map toolConfigs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("work_iq_preview".equals(fieldName)) { - workIqPreview = WorkIQPreviewToolParameters.fromJson(reader); + if ("project_connection_id".equals(fieldName)) { + projectConnectionId = reader.getString(); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); } else if ("name".equals(fieldName)) { name = reader.getString(); } else if ("description".equals(fieldName)) { description = reader.getString(); + } else if ("tool_configs".equals(fieldName)) { + toolConfigs = reader.readMap(reader1 -> ToolConfig.fromJson(reader1)); } else { reader.skipChildren(); } } - WorkIqPreviewTool deserializedWorkIqPreviewTool = new WorkIqPreviewTool(workIqPreview); + WorkIqPreviewTool deserializedWorkIqPreviewTool = new WorkIqPreviewTool(projectConnectionId); deserializedWorkIqPreviewTool.type = type; deserializedWorkIqPreviewTool.name = name; deserializedWorkIqPreviewTool.description = description; + deserializedWorkIqPreviewTool.toolConfigs = toolConfigs; return deserializedWorkIqPreviewTool; }); } + + /* + * The ID of the WorkIQ project connection. + */ + @Generated + private final String projectConnectionId; + + /** + * Creates an instance of WorkIqPreviewTool class. + * + * @param projectConnectionId the projectConnectionId value to set. + */ + @Generated + public WorkIqPreviewTool(String projectConnectionId) { + this.projectConnectionId = projectConnectionId; + } + + /** + * Get the projectConnectionId property: The ID of the WorkIQ project connection. + * + * @return the projectConnectionId value. + */ + @Generated + public String getProjectConnectionId() { + return this.projectConnectionId; + } + + /* + * Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + */ + @Generated + private Map toolConfigs; + + /** + * Get the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @return the toolConfigs value. + */ + @Generated + public Map getToolConfigs() { + return this.toolConfigs; + } + + /** + * Set the toolConfigs property: Per-tool configuration map. Keys are tool names or `*` (catch-all default). + * Resolution order: exact tool name match takes priority over `*`. + * Unknown tool names are silently ignored at runtime. + * + * @param toolConfigs the toolConfigs value to set. + * @return the WorkIqPreviewTool object itself. + */ + @Generated + public WorkIqPreviewTool setToolConfigs(Map toolConfigs) { + this.toolConfigs = toolConfigs; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json b/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json index b31ecdaede2e..9ed295d721a6 100644 --- a/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json +++ b/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Azure.AI.Projects":"v1"},"crossLanguageDefinitions":{"com.azure.ai.agents.AgentSessionFilesAsyncClient":"Azure.AI.Projects.AgentSessionFiles","com.azure.ai.agents.AgentSessionFilesAsyncClient.deleteSessionFile":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.deleteSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.downloadSessionFile":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.downloadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.getSessionFiles":"Azure.AI.Projects.AgentSessionFiles.listSessionFiles","com.azure.ai.agents.AgentSessionFilesAsyncClient.getSessionFilesWithResponse":"Azure.AI.Projects.AgentSessionFiles.listSessionFiles","com.azure.ai.agents.AgentSessionFilesAsyncClient.uploadSessionFile":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.uploadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentSessionFilesClient":"Azure.AI.Projects.AgentSessionFiles","com.azure.ai.agents.AgentSessionFilesClient.deleteSessionFile":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesClient.deleteSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesClient.downloadSessionFile":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesClient.downloadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesClient.getSessionFiles":"Azure.AI.Projects.AgentSessionFiles.listSessionFiles","com.azure.ai.agents.AgentSessionFilesClient.getSessionFilesWithResponse":"Azure.AI.Projects.AgentSessionFiles.listSessionFiles","com.azure.ai.agents.AgentSessionFilesClient.uploadSessionFile":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentSessionFilesClient.uploadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentsAsyncClient":"Azure.AI.Projects.Agents","com.azure.ai.agents.AgentsAsyncClient.createAgent":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsAsyncClient.createAgentFromManifest":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentVersion":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionFromManifest":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionWithResponse":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsAsyncClient.createAgentWithResponse":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsAsyncClient.createSession":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsAsyncClient.createSessionWithResponse":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsAsyncClient.deleteSession":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsAsyncClient.deleteSessionWithResponse":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsAsyncClient.getAgent":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsAsyncClient.getAgentVersionDetails":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsAsyncClient.getAgentVersionDetailsWithResponse":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsAsyncClient.getAgentWithResponse":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsAsyncClient.getSession":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsAsyncClient.getSessionWithResponse":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsAsyncClient.listAgentConversations":"Azure.AI.Projects.Conversations.listConversations","com.azure.ai.agents.AgentsAsyncClient.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsAsyncClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsAsyncClient.listSessions":"Azure.AI.Projects.Agents.listSessions","com.azure.ai.agents.AgentsAsyncClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsAsyncClient.updateAgentDetails":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsAsyncClient.updateAgentDetailsWithResponse":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsAsyncClient.updateAgentFromManifest":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.updateAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.updateAgentWithResponse":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsClient":"Azure.AI.Projects.Agents","com.azure.ai.agents.AgentsClient.createAgent":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsClient.createAgentFromManifest":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsClient.createAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsClient.createAgentVersion":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsClient.createAgentVersionFromManifest":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsClient.createAgentVersionFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsClient.createAgentVersionWithResponse":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsClient.createAgentWithResponse":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsClient.createSession":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsClient.createSessionWithResponse":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsClient.deleteSession":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsClient.deleteSessionWithResponse":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsClient.getAgent":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsClient.getAgentVersionDetails":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsClient.getAgentVersionDetailsWithResponse":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsClient.getAgentWithResponse":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsClient.getSession":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsClient.getSessionWithResponse":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsClient.listAgentConversations":"Azure.AI.Projects.Conversations.listConversations","com.azure.ai.agents.AgentsClient.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsClient.listSessions":"Azure.AI.Projects.Agents.listSessions","com.azure.ai.agents.AgentsClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsClient.updateAgentDetails":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsClient.updateAgentDetailsWithResponse":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsClient.updateAgentFromManifest":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsClient.updateAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsClient.updateAgentWithResponse":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsClientBuilder":"Azure.AI.Projects","com.azure.ai.agents.MemoryStoresAsyncClient":"Azure.AI.Projects.MemoryStores","com.azure.ai.agents.MemoryStoresAsyncClient.beginInternalUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresAsyncClient.beginInternalUpdateMemoriesWithModel":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresAsyncClient.createMemoryStore":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.createMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.getMemoryStore":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.getMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.getUpdateResult":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresAsyncClient.getUpdateResultWithResponse":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresAsyncClient.internalSearchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresAsyncClient.internalSearchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresAsyncClient.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresAsyncClient.updateMemoryStore":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.updateMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresClient":"Azure.AI.Projects.MemoryStores","com.azure.ai.agents.MemoryStoresClient.beginInternalUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresClient.beginInternalUpdateMemoriesWithModel":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresClient.createMemoryStore":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresClient.createMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresClient.getMemoryStore":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresClient.getMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresClient.getUpdateResult":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresClient.getUpdateResultWithResponse":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresClient.internalSearchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresClient.internalSearchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresClient.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresClient.updateMemoryStore":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresClient.updateMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.ToolboxesAsyncClient":"Azure.AI.Projects.Toolboxes","com.azure.ai.agents.ToolboxesAsyncClient.createToolboxVersion":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.createToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolbox":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolboxVersion":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolboxWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesAsyncClient.getToolbox":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesAsyncClient.getToolboxVersion":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.getToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.getToolboxWithResponse":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesAsyncClient.listToolboxVersions":"Azure.AI.Projects.Toolboxes.listToolboxVersions","com.azure.ai.agents.ToolboxesAsyncClient.listToolboxes":"Azure.AI.Projects.Toolboxes.listToolboxes","com.azure.ai.agents.ToolboxesAsyncClient.updateToolbox":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.ToolboxesAsyncClient.updateToolboxWithResponse":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.ToolboxesClient":"Azure.AI.Projects.Toolboxes","com.azure.ai.agents.ToolboxesClient.createToolboxVersion":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesClient.createToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesClient.deleteToolbox":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesClient.deleteToolboxVersion":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesClient.deleteToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesClient.deleteToolboxWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesClient.getToolbox":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesClient.getToolboxVersion":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesClient.getToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesClient.getToolboxWithResponse":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesClient.listToolboxVersions":"Azure.AI.Projects.Toolboxes.listToolboxVersions","com.azure.ai.agents.ToolboxesClient.listToolboxes":"Azure.AI.Projects.Toolboxes.listToolboxes","com.azure.ai.agents.ToolboxesClient.updateToolbox":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.ToolboxesClient.updateToolboxWithResponse":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.implementation.models.Annotation":"OpenAI.Annotation","com.azure.ai.agents.implementation.models.AnnotationType":"OpenAI.AnnotationType","com.azure.ai.agents.implementation.models.ApplyPatchCallOutputStatusParam":"OpenAI.ApplyPatchCallOutputStatusParam","com.azure.ai.agents.implementation.models.ApplyPatchCallStatusParam":"OpenAI.ApplyPatchCallStatusParam","com.azure.ai.agents.implementation.models.ApplyPatchCreateFileOperationParam":"OpenAI.ApplyPatchCreateFileOperationParam","com.azure.ai.agents.implementation.models.ApplyPatchDeleteFileOperationParam":"OpenAI.ApplyPatchDeleteFileOperationParam","com.azure.ai.agents.implementation.models.ApplyPatchOperationParam":"OpenAI.ApplyPatchOperationParam","com.azure.ai.agents.implementation.models.ApplyPatchOperationParamType":"OpenAI.ApplyPatchOperationParamType","com.azure.ai.agents.implementation.models.ApplyPatchUpdateFileOperationParam":"OpenAI.ApplyPatchUpdateFileOperationParam","com.azure.ai.agents.implementation.models.ClickButtonType":"OpenAI.ClickButtonType","com.azure.ai.agents.implementation.models.ClickParam":"OpenAI.ClickParam","com.azure.ai.agents.implementation.models.CodeInterpreterOutputImage":"OpenAI.CodeInterpreterOutputImage","com.azure.ai.agents.implementation.models.CodeInterpreterOutputLogs":"OpenAI.CodeInterpreterOutputLogs","com.azure.ai.agents.implementation.models.ComputerAction":"OpenAI.ComputerAction","com.azure.ai.agents.implementation.models.ComputerActionType":"OpenAI.ComputerActionType","com.azure.ai.agents.implementation.models.ComputerCallSafetyCheckParam":"OpenAI.ComputerCallSafetyCheckParam","com.azure.ai.agents.implementation.models.ComputerScreenshotImage":"OpenAI.ComputerScreenshotImage","com.azure.ai.agents.implementation.models.ContainerFileCitationBody":"OpenAI.ContainerFileCitationBody","com.azure.ai.agents.implementation.models.CoordParam":"OpenAI.CoordParam","com.azure.ai.agents.implementation.models.CreateAgentFromManifestRequest":"Azure.AI.Projects.createAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentOptions":null,"com.azure.ai.agents.implementation.models.CreateAgentRequest":"Azure.AI.Projects.createAgent.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionFromManifestRequest":"Azure.AI.Projects.createAgentVersionFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionRequest":"Azure.AI.Projects.createAgentVersion.Request.anonymous","com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest":"Azure.AI.Projects.createMemoryStore.Request.anonymous","com.azure.ai.agents.implementation.models.CreateSessionRequest":"Azure.AI.Projects.createSession.Request.anonymous","com.azure.ai.agents.implementation.models.CreateToolboxVersionRequest":"Azure.AI.Projects.createToolboxVersion.Request.anonymous","com.azure.ai.agents.implementation.models.DoubleClickAction":"OpenAI.DoubleClickAction","com.azure.ai.agents.implementation.models.DragParam":"OpenAI.DragParam","com.azure.ai.agents.implementation.models.EasyInputMessage":"OpenAI.EasyInputMessage","com.azure.ai.agents.implementation.models.EasyInputMessageRole":"OpenAI.EasyInputMessage.role.anonymous","com.azure.ai.agents.implementation.models.EasyInputMessageStatus":"OpenAI.EasyInputMessage.status.anonymous","com.azure.ai.agents.implementation.models.FileCitationBody":"OpenAI.FileCitationBody","com.azure.ai.agents.implementation.models.FilePath":"OpenAI.FilePath","com.azure.ai.agents.implementation.models.FileSearchToolCallResults":"OpenAI.FileSearchToolCallResults","com.azure.ai.agents.implementation.models.FunctionAndCustomToolCallOutput":"OpenAI.FunctionAndCustomToolCallOutput","com.azure.ai.agents.implementation.models.FunctionAndCustomToolCallOutputInputFileContent":"OpenAI.FunctionAndCustomToolCallOutputInputFileContent","com.azure.ai.agents.implementation.models.FunctionAndCustomToolCallOutputInputImageContent":"OpenAI.FunctionAndCustomToolCallOutputInputImageContent","com.azure.ai.agents.implementation.models.FunctionAndCustomToolCallOutputInputTextContent":"OpenAI.FunctionAndCustomToolCallOutputInputTextContent","com.azure.ai.agents.implementation.models.FunctionAndCustomToolCallOutputType":"OpenAI.FunctionAndCustomToolCallOutputType","com.azure.ai.agents.implementation.models.FunctionCallItemStatus":"OpenAI.FunctionCallItemStatus","com.azure.ai.agents.implementation.models.FunctionShellActionParam":"OpenAI.FunctionShellActionParam","com.azure.ai.agents.implementation.models.FunctionShellCallItemParamEnvironment":"OpenAI.FunctionShellCallItemParamEnvironment","com.azure.ai.agents.implementation.models.FunctionShellCallItemParamEnvironmentContainerReferenceParam":"OpenAI.FunctionShellCallItemParamEnvironmentContainerReferenceParam","com.azure.ai.agents.implementation.models.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam":"OpenAI.FunctionShellCallItemParamEnvironmentLocalEnvironmentParam","com.azure.ai.agents.implementation.models.FunctionShellCallItemParamEnvironmentType":"OpenAI.FunctionShellCallItemParamEnvironmentType","com.azure.ai.agents.implementation.models.FunctionShellCallItemStatus":"OpenAI.FunctionShellCallItemStatus","com.azure.ai.agents.implementation.models.FunctionShellCallOutputContentParam":"OpenAI.FunctionShellCallOutputContentParam","com.azure.ai.agents.implementation.models.FunctionShellCallOutputExitOutcomeParam":"OpenAI.FunctionShellCallOutputExitOutcomeParam","com.azure.ai.agents.implementation.models.FunctionShellCallOutputOutcomeParam":"OpenAI.FunctionShellCallOutputOutcomeParam","com.azure.ai.agents.implementation.models.FunctionShellCallOutputOutcomeParamType":"OpenAI.FunctionShellCallOutputOutcomeParamType","com.azure.ai.agents.implementation.models.FunctionShellCallOutputTimeoutOutcomeParam":"OpenAI.FunctionShellCallOutputTimeoutOutcomeParam","com.azure.ai.agents.implementation.models.ImageDetail":"OpenAI.ImageDetail","com.azure.ai.agents.implementation.models.ImageDetailLevel":"OpenAI.DetailEnum","com.azure.ai.agents.implementation.models.InputContent":"OpenAI.InputContent","com.azure.ai.agents.implementation.models.InputContentInputFileContent":"OpenAI.InputContentInputFileContent","com.azure.ai.agents.implementation.models.InputContentInputImageContent":"OpenAI.InputContentInputImageContent","com.azure.ai.agents.implementation.models.InputContentInputTextContent":"OpenAI.InputContentInputTextContent","com.azure.ai.agents.implementation.models.InputContentType":"OpenAI.InputContentType","com.azure.ai.agents.implementation.models.InputFileContentParam":"OpenAI.InputFileContentParam","com.azure.ai.agents.implementation.models.InputImageContentParamAutoParam":"OpenAI.InputImageContentParamAutoParam","com.azure.ai.agents.implementation.models.InputItem":"OpenAI.InputItem","com.azure.ai.agents.implementation.models.InputItemApplyPatchToolCallItemParam":"OpenAI.InputItemApplyPatchToolCallItemParam","com.azure.ai.agents.implementation.models.InputItemApplyPatchToolCallOutputItemParam":"OpenAI.InputItemApplyPatchToolCallOutputItemParam","com.azure.ai.agents.implementation.models.InputItemCodeInterpreterToolCall":"OpenAI.InputItemCodeInterpreterToolCall","com.azure.ai.agents.implementation.models.InputItemCodeInterpreterToolCallStatus":"OpenAI.InputItemCodeInterpreterToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputItemCompactionSummaryItemParam":"OpenAI.InputItemCompactionSummaryItemParam","com.azure.ai.agents.implementation.models.InputItemComputerCallOutputItemParam":"OpenAI.InputItemComputerCallOutputItemParam","com.azure.ai.agents.implementation.models.InputItemComputerToolCall":"OpenAI.InputItemComputerToolCall","com.azure.ai.agents.implementation.models.InputItemComputerToolCallStatus":"OpenAI.InputItemComputerToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputItemCustomToolCall":"OpenAI.InputItemCustomToolCall","com.azure.ai.agents.implementation.models.InputItemCustomToolCallOutput":"OpenAI.InputItemCustomToolCallOutput","com.azure.ai.agents.implementation.models.InputItemFileSearchToolCall":"OpenAI.InputItemFileSearchToolCall","com.azure.ai.agents.implementation.models.InputItemFileSearchToolCallStatus":"OpenAI.InputItemFileSearchToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputItemFunctionCallOutputItemParam":"OpenAI.InputItemFunctionCallOutputItemParam","com.azure.ai.agents.implementation.models.InputItemFunctionShellCallItemParam":"OpenAI.InputItemFunctionShellCallItemParam","com.azure.ai.agents.implementation.models.InputItemFunctionShellCallOutputItemParam":"OpenAI.InputItemFunctionShellCallOutputItemParam","com.azure.ai.agents.implementation.models.InputItemFunctionToolCall":"OpenAI.InputItemFunctionToolCall","com.azure.ai.agents.implementation.models.InputItemFunctionToolCallStatus":"OpenAI.InputItemFunctionToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputItemImageGenToolCall":"OpenAI.InputItemImageGenToolCall","com.azure.ai.agents.implementation.models.InputItemImageGenToolCallStatus":"OpenAI.InputItemImageGenToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputItemLocalShellToolCall":"OpenAI.InputItemLocalShellToolCall","com.azure.ai.agents.implementation.models.InputItemLocalShellToolCallOutput":"OpenAI.InputItemLocalShellToolCallOutput","com.azure.ai.agents.implementation.models.InputItemLocalShellToolCallOutputStatus":"OpenAI.InputItemLocalShellToolCallOutput.status.anonymous","com.azure.ai.agents.implementation.models.InputItemLocalShellToolCallStatus":"OpenAI.InputItemLocalShellToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputItemMcpApprovalRequest":"OpenAI.InputItemMcpApprovalRequest","com.azure.ai.agents.implementation.models.InputItemMcpApprovalResponse":"OpenAI.InputItemMcpApprovalResponse","com.azure.ai.agents.implementation.models.InputItemMcpListTools":"OpenAI.InputItemMcpListTools","com.azure.ai.agents.implementation.models.InputItemMcpToolCall":"OpenAI.InputItemMcpToolCall","com.azure.ai.agents.implementation.models.InputItemOutputMessage":"OpenAI.InputItemOutputMessage","com.azure.ai.agents.implementation.models.InputItemOutputMessageStatus":"OpenAI.InputItemOutputMessage.status.anonymous","com.azure.ai.agents.implementation.models.InputItemReasoningItem":"OpenAI.InputItemReasoningItem","com.azure.ai.agents.implementation.models.InputItemReasoningItemStatus":"OpenAI.InputItemReasoningItem.status.anonymous","com.azure.ai.agents.implementation.models.InputItemType":"OpenAI.InputItemType","com.azure.ai.agents.implementation.models.InputItemWebSearchToolCall":"OpenAI.InputItemWebSearchToolCall","com.azure.ai.agents.implementation.models.InputItemWebSearchToolCallStatus":"OpenAI.InputItemWebSearchToolCall.status.anonymous","com.azure.ai.agents.implementation.models.InputTextContentParam":"OpenAI.InputTextContentParam","com.azure.ai.agents.implementation.models.ItemReferenceParam":"OpenAI.ItemReferenceParam","com.azure.ai.agents.implementation.models.KeyPressAction":"OpenAI.KeyPressAction","com.azure.ai.agents.implementation.models.LocalShellExecAction":"OpenAI.LocalShellExecAction","com.azure.ai.agents.implementation.models.LogProb":"OpenAI.LogProb","com.azure.ai.agents.implementation.models.McpListToolsTool":"OpenAI.MCPListToolsTool","com.azure.ai.agents.implementation.models.McpListToolsToolAnnotations":"OpenAI.MCPListToolsToolAnnotations","com.azure.ai.agents.implementation.models.McpListToolsToolInputSchema":"OpenAI.MCPListToolsToolInputSchema","com.azure.ai.agents.implementation.models.McpToolCallStatus":"OpenAI.MCPToolCallStatus","com.azure.ai.agents.implementation.models.MessageContent":"OpenAI.MessageContent","com.azure.ai.agents.implementation.models.MessageContentType":"OpenAI.MessageContentType","com.azure.ai.agents.implementation.models.MoveParam":"OpenAI.MoveParam","com.azure.ai.agents.implementation.models.OutputMessageContent":"OpenAI.OutputMessageContent","com.azure.ai.agents.implementation.models.OutputMessageContentOutputTextContent":"OpenAI.OutputMessageContentOutputTextContent","com.azure.ai.agents.implementation.models.OutputMessageContentRefusalContent":"OpenAI.OutputMessageContentRefusalContent","com.azure.ai.agents.implementation.models.OutputMessageContentType":"OpenAI.OutputMessageContentType","com.azure.ai.agents.implementation.models.ReasoningTextContent":"OpenAI.ReasoningTextContent","com.azure.ai.agents.implementation.models.ScreenshotParam":"OpenAI.ScreenshotParam","com.azure.ai.agents.implementation.models.ScrollParam":"OpenAI.ScrollParam","com.azure.ai.agents.implementation.models.SearchMemoriesRequest":"Azure.AI.Projects.searchMemories.Request.anonymous","com.azure.ai.agents.implementation.models.SummaryTextContent":"OpenAI.SummaryTextContent","com.azure.ai.agents.implementation.models.TopLogProb":"OpenAI.TopLogProb","com.azure.ai.agents.implementation.models.TypeParam":"OpenAI.TypeParam","com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest":"Azure.AI.Projects.updateAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentRequest":"Azure.AI.Projects.updateAgent.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateMemoriesRequest":"Azure.AI.Projects.updateMemories.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest":"Azure.AI.Projects.updateMemoryStore.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateToolboxInput":"Azure.AI.Projects.UpdateToolboxRequest","com.azure.ai.agents.implementation.models.UpdateToolboxRequest":"Azure.AI.Projects.updateToolbox.Request.anonymous","com.azure.ai.agents.implementation.models.UrlCitationBody":"OpenAI.UrlCitationBody","com.azure.ai.agents.implementation.models.VectorStoreFileAttributes":"OpenAI.VectorStoreFileAttributes","com.azure.ai.agents.implementation.models.WaitParam":"OpenAI.WaitParam","com.azure.ai.agents.implementation.models.WebSearchActionFind":"OpenAI.WebSearchActionFind","com.azure.ai.agents.implementation.models.WebSearchActionOpenPage":"OpenAI.WebSearchActionOpenPage","com.azure.ai.agents.implementation.models.WebSearchActionSearch":"OpenAI.WebSearchActionSearch","com.azure.ai.agents.implementation.models.WebSearchActionSearchSources":"OpenAI.WebSearchActionSearchSources","com.azure.ai.agents.models.A2APreviewTool":"Azure.AI.Projects.A2APreviewTool","com.azure.ai.agents.models.AISearchIndexResource":"Azure.AI.Projects.AISearchIndexResource","com.azure.ai.agents.models.AgentBlueprintReference":"Azure.AI.Projects.AgentBlueprintReference","com.azure.ai.agents.models.AgentBlueprintReferenceType":"Azure.AI.Projects.AgentBlueprintReferenceType","com.azure.ai.agents.models.AgentCard":"Azure.AI.Projects.AgentCard","com.azure.ai.agents.models.AgentCardSkill":"Azure.AI.Projects.AgentCardSkill","com.azure.ai.agents.models.AgentDefinition":"Azure.AI.Projects.AgentDefinition","com.azure.ai.agents.models.AgentDefinitionOptInKeys":"Azure.AI.Projects.AgentDefinitionOptInKeys","com.azure.ai.agents.models.AgentDetails":"Azure.AI.Projects.AgentObject","com.azure.ai.agents.models.AgentDetailsVersions":"Azure.AI.Projects.AgentObject.versions.anonymous","com.azure.ai.agents.models.AgentEndpoint":"Azure.AI.Projects.AgentEndpoint","com.azure.ai.agents.models.AgentEndpointAuthorizationScheme":"Azure.AI.Projects.AgentEndpointAuthorizationScheme","com.azure.ai.agents.models.AgentEndpointAuthorizationSchemeType":"Azure.AI.Projects.AgentEndpointAuthorizationSchemeType","com.azure.ai.agents.models.AgentEndpointProtocol":"Azure.AI.Projects.AgentEndpointProtocol","com.azure.ai.agents.models.AgentIdentity":"Azure.AI.Projects.AgentIdentity","com.azure.ai.agents.models.AgentKind":"Azure.AI.Projects.AgentKind","com.azure.ai.agents.models.AgentObjectType":"Azure.AI.Projects.AgentObjectType","com.azure.ai.agents.models.AgentProtocol":"Azure.AI.Projects.AgentProtocol","com.azure.ai.agents.models.AgentReference":"Azure.AI.Projects.AgentReference","com.azure.ai.agents.models.AgentSessionResource":"Azure.AI.Projects.AgentSessionResource","com.azure.ai.agents.models.AgentSessionStatus":"Azure.AI.Projects.AgentSessionStatus","com.azure.ai.agents.models.AgentVersionDetails":"Azure.AI.Projects.AgentVersionObject","com.azure.ai.agents.models.ApiError":"OpenAI.Error","com.azure.ai.agents.models.ApplyPatchToolParameter":"OpenAI.ApplyPatchToolParam","com.azure.ai.agents.models.ApproximateLocation":"OpenAI.ApproximateLocation","com.azure.ai.agents.models.AutoCodeInterpreterToolParameter":"OpenAI.AutoCodeInterpreterToolParam","com.azure.ai.agents.models.AzureAISearchQueryType":"Azure.AI.Projects.AzureAISearchQueryType","com.azure.ai.agents.models.AzureAISearchTool":"Azure.AI.Projects.AzureAISearchTool","com.azure.ai.agents.models.AzureAISearchToolResource":"Azure.AI.Projects.AzureAISearchToolResource","com.azure.ai.agents.models.AzureCreateResponseDetails":"Azure.AI.Projects.AzureCreateResponseDetails","com.azure.ai.agents.models.AzureCreateResponseOptions":"Azure.AI.Projects.AzureCreateResponseOptions","com.azure.ai.agents.models.AzureFunctionBinding":"Azure.AI.Projects.AzureFunctionBinding","com.azure.ai.agents.models.AzureFunctionDefinition":"Azure.AI.Projects.AzureFunctionDefinition","com.azure.ai.agents.models.AzureFunctionDefinitionDetails":"Azure.AI.Projects.AzureFunctionDefinition.function.anonymous","com.azure.ai.agents.models.AzureFunctionStorageQueue":"Azure.AI.Projects.AzureFunctionStorageQueue","com.azure.ai.agents.models.AzureFunctionTool":"Azure.AI.Projects.AzureFunctionTool","com.azure.ai.agents.models.BingCustomSearchConfiguration":"Azure.AI.Projects.BingCustomSearchConfiguration","com.azure.ai.agents.models.BingCustomSearchPreviewTool":"Azure.AI.Projects.BingCustomSearchPreviewTool","com.azure.ai.agents.models.BingCustomSearchToolParameters":"Azure.AI.Projects.BingCustomSearchToolParameters","com.azure.ai.agents.models.BingGroundingSearchConfiguration":"Azure.AI.Projects.BingGroundingSearchConfiguration","com.azure.ai.agents.models.BingGroundingSearchToolParameters":"Azure.AI.Projects.BingGroundingSearchToolParameters","com.azure.ai.agents.models.BingGroundingTool":"Azure.AI.Projects.BingGroundingTool","com.azure.ai.agents.models.BotServiceAuthorizationScheme":"Azure.AI.Projects.BotServiceAuthorizationScheme","com.azure.ai.agents.models.BotServiceRbacAuthorizationScheme":"Azure.AI.Projects.BotServiceRbacAuthorizationScheme","com.azure.ai.agents.models.BrowserAutomationPreviewTool":"Azure.AI.Projects.BrowserAutomationPreviewTool","com.azure.ai.agents.models.BrowserAutomationToolConnectionParameters":"Azure.AI.Projects.BrowserAutomationToolConnectionParameters","com.azure.ai.agents.models.BrowserAutomationToolParameters":"Azure.AI.Projects.BrowserAutomationToolParameters","com.azure.ai.agents.models.CaptureStructuredOutputsTool":"Azure.AI.Projects.CaptureStructuredOutputsTool","com.azure.ai.agents.models.ChatSummaryMemoryItem":"Azure.AI.Projects.ChatSummaryMemoryItem","com.azure.ai.agents.models.CodeConfiguration":"Azure.AI.Projects.CodeConfiguration","com.azure.ai.agents.models.CodeInterpreterTool":"OpenAI.CodeInterpreterTool","com.azure.ai.agents.models.ComputerEnvironment":"ComputerEnvironmentExpandable","com.azure.ai.agents.models.ComputerUsePreviewTool":"OpenAI.ComputerUsePreviewTool","com.azure.ai.agents.models.ContainerAutoParameter":"OpenAI.ContainerAutoParam","com.azure.ai.agents.models.ContainerConfiguration":"Azure.AI.Projects.ContainerConfiguration","com.azure.ai.agents.models.ContainerMemoryLimit":"ContainerMemoryLimitExpandable","com.azure.ai.agents.models.ContainerNetworkPolicyAllowlistParameter":"OpenAI.ContainerNetworkPolicyAllowlistParam","com.azure.ai.agents.models.ContainerNetworkPolicyDisabledParameter":"OpenAI.ContainerNetworkPolicyDisabledParam","com.azure.ai.agents.models.ContainerNetworkPolicyDomainSecretParameter":"OpenAI.ContainerNetworkPolicyDomainSecretParam","com.azure.ai.agents.models.ContainerNetworkPolicyParamType":"OpenAI.ContainerNetworkPolicyParamType","com.azure.ai.agents.models.ContainerNetworkPolicyParameter":"OpenAI.ContainerNetworkPolicyParam","com.azure.ai.agents.models.ContainerSkill":"OpenAI.ContainerSkill","com.azure.ai.agents.models.ContainerSkillType":"OpenAI.ContainerSkillType","com.azure.ai.agents.models.CreateAgentVersionInput":"Azure.AI.Projects.CreateAgentVersionRequest","com.azure.ai.agents.models.CustomGrammarFormatParameter":"OpenAI.CustomGrammarFormatParam","com.azure.ai.agents.models.CustomTextFormatParameter":"OpenAI.CustomTextFormatParam","com.azure.ai.agents.models.CustomToolParamFormat":"OpenAI.CustomToolParamFormat","com.azure.ai.agents.models.CustomToolParamFormatType":"OpenAI.CustomToolParamFormatType","com.azure.ai.agents.models.CustomToolParameter":"OpenAI.CustomToolParam","com.azure.ai.agents.models.EntraAuthorizationScheme":"Azure.AI.Projects.EntraAuthorizationScheme","com.azure.ai.agents.models.EntraIsolationKeySource":"Azure.AI.Projects.EntraIsolationKeySource","com.azure.ai.agents.models.FabricDataAgentToolParameters":"Azure.AI.Projects.FabricDataAgentToolParameters","com.azure.ai.agents.models.FileSearchTool":"OpenAI.FileSearchTool","com.azure.ai.agents.models.FixedRatioVersionSelectionRule":"Azure.AI.Projects.FixedRatioVersionSelectionRule","com.azure.ai.agents.models.FoundryFeaturesOptInKeys":"Azure.AI.Projects.FoundryFeaturesOptInKeys","com.azure.ai.agents.models.FunctionShellToolParamEnvironment":"OpenAI.FunctionShellToolParamEnvironment","com.azure.ai.agents.models.FunctionShellToolParamEnvironmentType":"OpenAI.FunctionShellToolParamEnvironmentType","com.azure.ai.agents.models.FunctionShellToolParameter":"OpenAI.FunctionShellToolParam","com.azure.ai.agents.models.FunctionShellToolParameterEnvironmentContainerReferenceParameter":"OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam","com.azure.ai.agents.models.FunctionShellToolParameterEnvironmentLocalEnvironmentParameter":"OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam","com.azure.ai.agents.models.FunctionTool":"OpenAI.FunctionTool","com.azure.ai.agents.models.GrammarSyntax":"GrammarSyntaxExpandable","com.azure.ai.agents.models.HeaderIsolationKeySource":"Azure.AI.Projects.HeaderIsolationKeySource","com.azure.ai.agents.models.HostedAgentDefinition":"Azure.AI.Projects.HostedAgentDefinition","com.azure.ai.agents.models.HybridSearchOptions":"OpenAI.HybridSearchOptions","com.azure.ai.agents.models.ImageGenActionEnum":"ImageGenActionEnumExpandable","com.azure.ai.agents.models.ImageGenTool":"OpenAI.ImageGenTool","com.azure.ai.agents.models.ImageGenToolBackground":"ImageGenToolBackgroundExpandable","com.azure.ai.agents.models.ImageGenToolInputImageMask":"OpenAI.ImageGenToolInputImageMask","com.azure.ai.agents.models.ImageGenToolModel":"OpenAI.ImageGenTool.model.anonymous","com.azure.ai.agents.models.ImageGenToolModeration":"ImageGenToolModerationExpandable","com.azure.ai.agents.models.ImageGenToolOutputFormat":"ImageGenToolOutputFormatExpandable","com.azure.ai.agents.models.ImageGenToolQuality":"ImageGenToolQualityExpandable","com.azure.ai.agents.models.ImageGenToolSize":"ImageGenToolSizeExpandable","com.azure.ai.agents.models.IncludeEnum":"OpenAI.IncludeEnum","com.azure.ai.agents.models.InlineSkillParameter":"OpenAI.InlineSkillParam","com.azure.ai.agents.models.InlineSkillSourceParameter":"OpenAI.InlineSkillSourceParam","com.azure.ai.agents.models.InputFidelity":"InputFidelityExpandable","com.azure.ai.agents.models.IsolationKeySource":"Azure.AI.Projects.IsolationKeySource","com.azure.ai.agents.models.IsolationKeySourceKind":"Azure.AI.Projects.IsolationKeySourceKind","com.azure.ai.agents.models.LocalShellToolParameter":"OpenAI.LocalShellToolParam","com.azure.ai.agents.models.LocalSkillParameter":"OpenAI.LocalSkillParam","com.azure.ai.agents.models.ManagedAgentIdentityBlueprintReference":"Azure.AI.Projects.ManagedAgentIdentityBlueprintReference","com.azure.ai.agents.models.McpTool":"OpenAI.MCPTool","com.azure.ai.agents.models.McpToolConnectorId":"McpToolConnectorIdExpandable","com.azure.ai.agents.models.McpToolFilter":"OpenAI.MCPToolFilter","com.azure.ai.agents.models.McpToolRequireApproval":"OpenAI.MCPToolRequireApproval","com.azure.ai.agents.models.MemoryItem":"Azure.AI.Projects.MemoryItem","com.azure.ai.agents.models.MemoryItemKind":"Azure.AI.Projects.MemoryItemKind","com.azure.ai.agents.models.MemoryOperation":"Azure.AI.Projects.MemoryOperation","com.azure.ai.agents.models.MemoryOperationKind":"Azure.AI.Projects.MemoryOperationKind","com.azure.ai.agents.models.MemorySearchItem":"Azure.AI.Projects.MemorySearchItem","com.azure.ai.agents.models.MemorySearchOptions":"Azure.AI.Projects.MemorySearchOptions","com.azure.ai.agents.models.MemorySearchPreviewTool":"Azure.AI.Projects.MemorySearchPreviewTool","com.azure.ai.agents.models.MemoryStoreDefaultDefinition":"Azure.AI.Projects.MemoryStoreDefaultDefinition","com.azure.ai.agents.models.MemoryStoreDefaultOptions":"Azure.AI.Projects.MemoryStoreDefaultOptions","com.azure.ai.agents.models.MemoryStoreDefinition":"Azure.AI.Projects.MemoryStoreDefinition","com.azure.ai.agents.models.MemoryStoreDetails":"Azure.AI.Projects.MemoryStoreObject","com.azure.ai.agents.models.MemoryStoreKind":"Azure.AI.Projects.MemoryStoreKind","com.azure.ai.agents.models.MemoryStoreObjectType":"Azure.AI.Projects.MemoryStoreObjectType","com.azure.ai.agents.models.MemoryStoreOperationUsage":"Azure.AI.Projects.MemoryStoreOperationUsage","com.azure.ai.agents.models.MemoryStoreSearchResponse":"Azure.AI.Projects.MemoryStoreSearchResponse","com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult":"Azure.AI.Projects.MemoryStoreUpdateCompletedResult","com.azure.ai.agents.models.MemoryStoreUpdateResponse":"Azure.AI.Projects.MemoryStoreUpdateResponse","com.azure.ai.agents.models.MemoryStoreUpdateStatus":"Azure.AI.Projects.MemoryStoreUpdateStatus","com.azure.ai.agents.models.MicrosoftFabricPreviewTool":"Azure.AI.Projects.MicrosoftFabricPreviewTool","com.azure.ai.agents.models.OpenApiAnonymousAuthDetails":"Azure.AI.Projects.OpenApiAnonymousAuthDetails","com.azure.ai.agents.models.OpenApiAuthDetails":"Azure.AI.Projects.OpenApiAuthDetails","com.azure.ai.agents.models.OpenApiAuthType":"Azure.AI.Projects.OpenApiAuthType","com.azure.ai.agents.models.OpenApiFunctionDefinition":"Azure.AI.Projects.OpenApiFunctionDefinition","com.azure.ai.agents.models.OpenApiFunctionDefinitionFunction":"Azure.AI.Projects.OpenApiFunctionDefinition.function.anonymous","com.azure.ai.agents.models.OpenApiManagedAuthDetails":"Azure.AI.Projects.OpenApiManagedAuthDetails","com.azure.ai.agents.models.OpenApiManagedSecurityScheme":"Azure.AI.Projects.OpenApiManagedSecurityScheme","com.azure.ai.agents.models.OpenApiProjectConnectionAuthDetails":"Azure.AI.Projects.OpenApiProjectConnectionAuthDetails","com.azure.ai.agents.models.OpenApiProjectConnectionSecurityScheme":"Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme","com.azure.ai.agents.models.OpenApiTool":"Azure.AI.Projects.OpenApiTool","com.azure.ai.agents.models.PageOrder":"Azure.AI.Projects.PageOrder","com.azure.ai.agents.models.PromptAgentDefinition":"Azure.AI.Projects.PromptAgentDefinition","com.azure.ai.agents.models.PromptAgentDefinitionTextOptions":"Azure.AI.Projects.PromptAgentDefinitionTextOptions","com.azure.ai.agents.models.ProtocolVersionRecord":"Azure.AI.Projects.ProtocolVersionRecord","com.azure.ai.agents.models.RaiConfig":"Azure.AI.Projects.RaiConfig","com.azure.ai.agents.models.RankerVersionType":"RankerVersionTypeExpandable","com.azure.ai.agents.models.RankingOptions":"OpenAI.RankingOptions","com.azure.ai.agents.models.ResponseFormatJsonSchemaInner":"OpenAI.ResponseFormatJsonSchemaSchema","com.azure.ai.agents.models.ResponseUsageInputTokensDetails":"OpenAI.ResponseUsageInputTokensDetails","com.azure.ai.agents.models.ResponseUsageOutputTokensDetails":"OpenAI.ResponseUsageOutputTokensDetails","com.azure.ai.agents.models.SearchContextSize":"SearchContextSizeExpandable","com.azure.ai.agents.models.SessionDirectoryEntry":"Azure.AI.Projects.SessionDirectoryEntry","com.azure.ai.agents.models.SessionDirectoryListResponse":"Azure.AI.Projects.SessionDirectoryListResponse","com.azure.ai.agents.models.SessionFileWriteResponse":"Azure.AI.Projects.SessionFileWriteResponse","com.azure.ai.agents.models.SessionLogEvent":"Azure.AI.Projects.SessionLogEvent","com.azure.ai.agents.models.SessionLogEventType":"Azure.AI.Projects.SessionLogEventType","com.azure.ai.agents.models.SharepointGroundingToolParameters":"Azure.AI.Projects.SharepointGroundingToolParameters","com.azure.ai.agents.models.SharepointPreviewTool":"Azure.AI.Projects.SharepointPreviewTool","com.azure.ai.agents.models.SkillReferenceParameter":"OpenAI.SkillReferenceParam","com.azure.ai.agents.models.StructuredInputDefinition":"Azure.AI.Projects.StructuredInputDefinition","com.azure.ai.agents.models.StructuredOutputDefinition":"Azure.AI.Projects.StructuredOutputDefinition","com.azure.ai.agents.models.TextResponseFormatConfiguration":"OpenAI.TextResponseFormatConfiguration","com.azure.ai.agents.models.TextResponseFormatConfigurationResponseFormatJsonObject":"OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject","com.azure.ai.agents.models.TextResponseFormatConfigurationResponseFormatText":"OpenAI.TextResponseFormatConfigurationResponseFormatText","com.azure.ai.agents.models.TextResponseFormatConfigurationType":"OpenAI.TextResponseFormatConfigurationType","com.azure.ai.agents.models.TextResponseFormatJsonSchema":"OpenAI.TextResponseFormatJsonSchema","com.azure.ai.agents.models.Tool":"OpenAI.Tool","com.azure.ai.agents.models.ToolProjectConnection":"Azure.AI.Projects.ToolProjectConnection","com.azure.ai.agents.models.ToolType":"OpenAI.ToolType","com.azure.ai.agents.models.ToolboxDetails":"Azure.AI.Projects.ToolboxObject","com.azure.ai.agents.models.ToolboxPolicies":"Azure.AI.Projects.ToolboxPolicies","com.azure.ai.agents.models.ToolboxVersionDetails":"Azure.AI.Projects.ToolboxVersionObject","com.azure.ai.agents.models.UpdateAgentDetailsOptions":"Azure.AI.Projects.patchAgentObject.Request.anonymous","com.azure.ai.agents.models.UserProfileMemoryItem":"Azure.AI.Projects.UserProfileMemoryItem","com.azure.ai.agents.models.VersionIndicator":"Azure.AI.Projects.VersionIndicator","com.azure.ai.agents.models.VersionIndicatorType":"Azure.AI.Projects.VersionIndicatorType","com.azure.ai.agents.models.VersionRefIndicator":"Azure.AI.Projects.VersionRefIndicator","com.azure.ai.agents.models.VersionSelectionRule":"Azure.AI.Projects.VersionSelectionRule","com.azure.ai.agents.models.VersionSelector":"Azure.AI.Projects.VersionSelector","com.azure.ai.agents.models.VersionSelectorType":"Azure.AI.Projects.VersionSelectorType","com.azure.ai.agents.models.WebSearchApproximateLocation":"OpenAI.WebSearchApproximateLocation","com.azure.ai.agents.models.WebSearchConfiguration":"Azure.AI.Projects.WebSearchConfiguration","com.azure.ai.agents.models.WebSearchPreviewTool":"OpenAI.WebSearchPreviewTool","com.azure.ai.agents.models.WebSearchTool":"OpenAI.WebSearchTool","com.azure.ai.agents.models.WebSearchToolFilters":"OpenAI.WebSearchToolFilters","com.azure.ai.agents.models.WebSearchToolSearchContextSize":"WebSearchToolSearchContextSizeExpandable","com.azure.ai.agents.models.WorkIQPreviewToolParameters":"Azure.AI.Projects.WorkIQPreviewToolParameters","com.azure.ai.agents.models.WorkIqPreviewTool":"Azure.AI.Projects.WorkIQPreviewTool","com.azure.ai.agents.models.WorkflowAgentDefinition":"Azure.AI.Projects.WorkflowAgentDefinition"},"generatedFiles":["src/main/java/com/azure/ai/agents/AgentSessionFilesAsyncClient.java","src/main/java/com/azure/ai/agents/AgentSessionFilesClient.java","src/main/java/com/azure/ai/agents/AgentsAsyncClient.java","src/main/java/com/azure/ai/agents/AgentsClient.java","src/main/java/com/azure/ai/agents/AgentsClientBuilder.java","src/main/java/com/azure/ai/agents/AgentsServiceVersion.java","src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java","src/main/java/com/azure/ai/agents/MemoryStoresClient.java","src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java","src/main/java/com/azure/ai/agents/ToolboxesClient.java","src/main/java/com/azure/ai/agents/implementation/AgentSessionFilesImpl.java","src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java","src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java","src/main/java/com/azure/ai/agents/implementation/JsonMergePatchHelper.java","src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java","src/main/java/com/azure/ai/agents/implementation/OperationLocationPollingStrategy.java","src/main/java/com/azure/ai/agents/implementation/PollingUtils.java","src/main/java/com/azure/ai/agents/implementation/SyncOperationLocationPollingStrategy.java","src/main/java/com/azure/ai/agents/implementation/ToolboxesImpl.java","src/main/java/com/azure/ai/agents/implementation/models/Annotation.java","src/main/java/com/azure/ai/agents/implementation/models/AnnotationType.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallOutputStatusParam.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCallStatusParam.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchCreateFileOperationParam.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchDeleteFileOperationParam.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParam.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParamType.java","src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchUpdateFileOperationParam.java","src/main/java/com/azure/ai/agents/implementation/models/ClickButtonType.java","src/main/java/com/azure/ai/agents/implementation/models/ClickParam.java","src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputImage.java","src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputLogs.java","src/main/java/com/azure/ai/agents/implementation/models/ComputerAction.java","src/main/java/com/azure/ai/agents/implementation/models/ComputerActionType.java","src/main/java/com/azure/ai/agents/implementation/models/ComputerCallSafetyCheckParam.java","src/main/java/com/azure/ai/agents/implementation/models/ComputerScreenshotImage.java","src/main/java/com/azure/ai/agents/implementation/models/ContainerFileCitationBody.java","src/main/java/com/azure/ai/agents/implementation/models/CoordParam.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentFromManifestRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentOptions.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionFromManifestRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryStoreRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateSessionRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateToolboxVersionRequest.java","src/main/java/com/azure/ai/agents/implementation/models/DoubleClickAction.java","src/main/java/com/azure/ai/agents/implementation/models/DragParam.java","src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessage.java","src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java","src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageStatus.java","src/main/java/com/azure/ai/agents/implementation/models/FileCitationBody.java","src/main/java/com/azure/ai/agents/implementation/models/FilePath.java","src/main/java/com/azure/ai/agents/implementation/models/FileSearchToolCallResults.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutput.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputFileContent.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputImageContent.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputInputTextContent.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionAndCustomToolCallOutputType.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionCallItemStatus.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellActionParam.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironment.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentContainerReferenceParam.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentLocalEnvironmentParam.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemParamEnvironmentType.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallItemStatus.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputContentParam.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputExitOutcomeParam.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParam.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputOutcomeParamType.java","src/main/java/com/azure/ai/agents/implementation/models/FunctionShellCallOutputTimeoutOutcomeParam.java","src/main/java/com/azure/ai/agents/implementation/models/ImageDetail.java","src/main/java/com/azure/ai/agents/implementation/models/ImageDetailLevel.java","src/main/java/com/azure/ai/agents/implementation/models/InputContent.java","src/main/java/com/azure/ai/agents/implementation/models/InputContentInputFileContent.java","src/main/java/com/azure/ai/agents/implementation/models/InputContentInputImageContent.java","src/main/java/com/azure/ai/agents/implementation/models/InputContentInputTextContent.java","src/main/java/com/azure/ai/agents/implementation/models/InputContentType.java","src/main/java/com/azure/ai/agents/implementation/models/InputFileContentParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputImageContentParamAutoParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItem.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemApplyPatchToolCallOutputItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemCodeInterpreterToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemCompactionSummaryItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerCallOutputItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemComputerToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemCustomToolCallOutput.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFileSearchToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionCallOutputItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionShellCallOutputItemParam.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemFunctionToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemImageGenToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutput.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallOutputStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemLocalShellToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalRequest.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpApprovalResponse.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpListTools.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemMcpToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessage.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemOutputMessageStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItem.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemReasoningItemStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemType.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCall.java","src/main/java/com/azure/ai/agents/implementation/models/InputItemWebSearchToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/InputTextContentParam.java","src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java","src/main/java/com/azure/ai/agents/implementation/models/KeyPressAction.java","src/main/java/com/azure/ai/agents/implementation/models/LocalShellExecAction.java","src/main/java/com/azure/ai/agents/implementation/models/LogProb.java","src/main/java/com/azure/ai/agents/implementation/models/McpListToolsTool.java","src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolAnnotations.java","src/main/java/com/azure/ai/agents/implementation/models/McpListToolsToolInputSchema.java","src/main/java/com/azure/ai/agents/implementation/models/McpToolCallStatus.java","src/main/java/com/azure/ai/agents/implementation/models/MessageContent.java","src/main/java/com/azure/ai/agents/implementation/models/MessageContentType.java","src/main/java/com/azure/ai/agents/implementation/models/MoveParam.java","src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContent.java","src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentOutputTextContent.java","src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentRefusalContent.java","src/main/java/com/azure/ai/agents/implementation/models/OutputMessageContentType.java","src/main/java/com/azure/ai/agents/implementation/models/ReasoningTextContent.java","src/main/java/com/azure/ai/agents/implementation/models/ScreenshotParam.java","src/main/java/com/azure/ai/agents/implementation/models/ScrollParam.java","src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/SummaryTextContent.java","src/main/java/com/azure/ai/agents/implementation/models/TopLogProb.java","src/main/java/com/azure/ai/agents/implementation/models/TypeParam.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentFromManifestRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoryStoreRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateToolboxInput.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateToolboxRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UrlCitationBody.java","src/main/java/com/azure/ai/agents/implementation/models/VectorStoreFileAttributes.java","src/main/java/com/azure/ai/agents/implementation/models/WaitParam.java","src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionFind.java","src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionOpenPage.java","src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearch.java","src/main/java/com/azure/ai/agents/implementation/models/WebSearchActionSearchSources.java","src/main/java/com/azure/ai/agents/implementation/models/package-info.java","src/main/java/com/azure/ai/agents/implementation/package-info.java","src/main/java/com/azure/ai/agents/models/A2APreviewTool.java","src/main/java/com/azure/ai/agents/models/AISearchIndexResource.java","src/main/java/com/azure/ai/agents/models/AgentBlueprintReference.java","src/main/java/com/azure/ai/agents/models/AgentBlueprintReferenceType.java","src/main/java/com/azure/ai/agents/models/AgentCard.java","src/main/java/com/azure/ai/agents/models/AgentCardSkill.java","src/main/java/com/azure/ai/agents/models/AgentDefinition.java","src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java","src/main/java/com/azure/ai/agents/models/AgentDetails.java","src/main/java/com/azure/ai/agents/models/AgentDetailsVersions.java","src/main/java/com/azure/ai/agents/models/AgentEndpoint.java","src/main/java/com/azure/ai/agents/models/AgentEndpointAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/AgentEndpointAuthorizationSchemeType.java","src/main/java/com/azure/ai/agents/models/AgentEndpointProtocol.java","src/main/java/com/azure/ai/agents/models/AgentIdentity.java","src/main/java/com/azure/ai/agents/models/AgentKind.java","src/main/java/com/azure/ai/agents/models/AgentObjectType.java","src/main/java/com/azure/ai/agents/models/AgentProtocol.java","src/main/java/com/azure/ai/agents/models/AgentReference.java","src/main/java/com/azure/ai/agents/models/AgentSessionResource.java","src/main/java/com/azure/ai/agents/models/AgentSessionStatus.java","src/main/java/com/azure/ai/agents/models/AgentVersionDetails.java","src/main/java/com/azure/ai/agents/models/ApiError.java","src/main/java/com/azure/ai/agents/models/ApplyPatchToolParameter.java","src/main/java/com/azure/ai/agents/models/ApproximateLocation.java","src/main/java/com/azure/ai/agents/models/AutoCodeInterpreterToolParameter.java","src/main/java/com/azure/ai/agents/models/AzureAISearchQueryType.java","src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java","src/main/java/com/azure/ai/agents/models/AzureAISearchToolResource.java","src/main/java/com/azure/ai/agents/models/AzureCreateResponseDetails.java","src/main/java/com/azure/ai/agents/models/AzureCreateResponseOptions.java","src/main/java/com/azure/ai/agents/models/AzureFunctionBinding.java","src/main/java/com/azure/ai/agents/models/AzureFunctionDefinition.java","src/main/java/com/azure/ai/agents/models/AzureFunctionDefinitionDetails.java","src/main/java/com/azure/ai/agents/models/AzureFunctionStorageQueue.java","src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java","src/main/java/com/azure/ai/agents/models/BingGroundingSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/BingGroundingSearchToolParameters.java","src/main/java/com/azure/ai/agents/models/BingGroundingTool.java","src/main/java/com/azure/ai/agents/models/BotServiceAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/BotServiceRbacAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationToolConnectionParameters.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationToolParameters.java","src/main/java/com/azure/ai/agents/models/CaptureStructuredOutputsTool.java","src/main/java/com/azure/ai/agents/models/ChatSummaryMemoryItem.java","src/main/java/com/azure/ai/agents/models/CodeConfiguration.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java","src/main/java/com/azure/ai/agents/models/ComputerEnvironment.java","src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java","src/main/java/com/azure/ai/agents/models/ContainerAutoParameter.java","src/main/java/com/azure/ai/agents/models/ContainerConfiguration.java","src/main/java/com/azure/ai/agents/models/ContainerMemoryLimit.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyAllowlistParameter.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyDisabledParameter.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyDomainSecretParameter.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyParamType.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyParameter.java","src/main/java/com/azure/ai/agents/models/ContainerSkill.java","src/main/java/com/azure/ai/agents/models/ContainerSkillType.java","src/main/java/com/azure/ai/agents/models/CreateAgentVersionInput.java","src/main/java/com/azure/ai/agents/models/CustomGrammarFormatParameter.java","src/main/java/com/azure/ai/agents/models/CustomTextFormatParameter.java","src/main/java/com/azure/ai/agents/models/CustomToolParamFormat.java","src/main/java/com/azure/ai/agents/models/CustomToolParamFormatType.java","src/main/java/com/azure/ai/agents/models/CustomToolParameter.java","src/main/java/com/azure/ai/agents/models/EntraAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/EntraIsolationKeySource.java","src/main/java/com/azure/ai/agents/models/FabricDataAgentToolParameters.java","src/main/java/com/azure/ai/agents/models/FileSearchTool.java","src/main/java/com/azure/ai/agents/models/FixedRatioVersionSelectionRule.java","src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParamEnvironment.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParamEnvironmentType.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParameter.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParameterEnvironmentContainerReferenceParameter.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParameterEnvironmentLocalEnvironmentParameter.java","src/main/java/com/azure/ai/agents/models/FunctionTool.java","src/main/java/com/azure/ai/agents/models/GrammarSyntax.java","src/main/java/com/azure/ai/agents/models/HeaderIsolationKeySource.java","src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java","src/main/java/com/azure/ai/agents/models/HybridSearchOptions.java","src/main/java/com/azure/ai/agents/models/ImageGenActionEnum.java","src/main/java/com/azure/ai/agents/models/ImageGenTool.java","src/main/java/com/azure/ai/agents/models/ImageGenToolBackground.java","src/main/java/com/azure/ai/agents/models/ImageGenToolInputImageMask.java","src/main/java/com/azure/ai/agents/models/ImageGenToolModel.java","src/main/java/com/azure/ai/agents/models/ImageGenToolModeration.java","src/main/java/com/azure/ai/agents/models/ImageGenToolOutputFormat.java","src/main/java/com/azure/ai/agents/models/ImageGenToolQuality.java","src/main/java/com/azure/ai/agents/models/ImageGenToolSize.java","src/main/java/com/azure/ai/agents/models/IncludeEnum.java","src/main/java/com/azure/ai/agents/models/InlineSkillParameter.java","src/main/java/com/azure/ai/agents/models/InlineSkillSourceParameter.java","src/main/java/com/azure/ai/agents/models/InputFidelity.java","src/main/java/com/azure/ai/agents/models/IsolationKeySource.java","src/main/java/com/azure/ai/agents/models/IsolationKeySourceKind.java","src/main/java/com/azure/ai/agents/models/LocalShellToolParameter.java","src/main/java/com/azure/ai/agents/models/LocalSkillParameter.java","src/main/java/com/azure/ai/agents/models/ManagedAgentIdentityBlueprintReference.java","src/main/java/com/azure/ai/agents/models/McpTool.java","src/main/java/com/azure/ai/agents/models/McpToolConnectorId.java","src/main/java/com/azure/ai/agents/models/McpToolFilter.java","src/main/java/com/azure/ai/agents/models/McpToolRequireApproval.java","src/main/java/com/azure/ai/agents/models/MemoryItem.java","src/main/java/com/azure/ai/agents/models/MemoryItemKind.java","src/main/java/com/azure/ai/agents/models/MemoryOperation.java","src/main/java/com/azure/ai/agents/models/MemoryOperationKind.java","src/main/java/com/azure/ai/agents/models/MemorySearchItem.java","src/main/java/com/azure/ai/agents/models/MemorySearchOptions.java","src/main/java/com/azure/ai/agents/models/MemorySearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultDefinition.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultOptions.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDefinition.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDetails.java","src/main/java/com/azure/ai/agents/models/MemoryStoreKind.java","src/main/java/com/azure/ai/agents/models/MemoryStoreObjectType.java","src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsage.java","src/main/java/com/azure/ai/agents/models/MemoryStoreSearchResponse.java","src/main/java/com/azure/ai/agents/models/MemoryStoreUpdateCompletedResult.java","src/main/java/com/azure/ai/agents/models/MemoryStoreUpdateResponse.java","src/main/java/com/azure/ai/agents/models/MemoryStoreUpdateStatus.java","src/main/java/com/azure/ai/agents/models/MicrosoftFabricPreviewTool.java","src/main/java/com/azure/ai/agents/models/OpenApiAnonymousAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiAuthType.java","src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinition.java","src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinitionFunction.java","src/main/java/com/azure/ai/agents/models/OpenApiManagedAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiManagedSecurityScheme.java","src/main/java/com/azure/ai/agents/models/OpenApiProjectConnectionAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiProjectConnectionSecurityScheme.java","src/main/java/com/azure/ai/agents/models/OpenApiTool.java","src/main/java/com/azure/ai/agents/models/PageOrder.java","src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java","src/main/java/com/azure/ai/agents/models/PromptAgentDefinitionTextOptions.java","src/main/java/com/azure/ai/agents/models/ProtocolVersionRecord.java","src/main/java/com/azure/ai/agents/models/RaiConfig.java","src/main/java/com/azure/ai/agents/models/RankerVersionType.java","src/main/java/com/azure/ai/agents/models/RankingOptions.java","src/main/java/com/azure/ai/agents/models/ResponseFormatJsonSchemaInner.java","src/main/java/com/azure/ai/agents/models/ResponseUsageInputTokensDetails.java","src/main/java/com/azure/ai/agents/models/ResponseUsageOutputTokensDetails.java","src/main/java/com/azure/ai/agents/models/SearchContextSize.java","src/main/java/com/azure/ai/agents/models/SessionDirectoryEntry.java","src/main/java/com/azure/ai/agents/models/SessionDirectoryListResponse.java","src/main/java/com/azure/ai/agents/models/SessionFileWriteResponse.java","src/main/java/com/azure/ai/agents/models/SessionLogEvent.java","src/main/java/com/azure/ai/agents/models/SessionLogEventType.java","src/main/java/com/azure/ai/agents/models/SharepointGroundingToolParameters.java","src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java","src/main/java/com/azure/ai/agents/models/SkillReferenceParameter.java","src/main/java/com/azure/ai/agents/models/StructuredInputDefinition.java","src/main/java/com/azure/ai/agents/models/StructuredOutputDefinition.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfiguration.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatJsonObject.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatText.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationType.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatJsonSchema.java","src/main/java/com/azure/ai/agents/models/Tool.java","src/main/java/com/azure/ai/agents/models/ToolProjectConnection.java","src/main/java/com/azure/ai/agents/models/ToolType.java","src/main/java/com/azure/ai/agents/models/ToolboxDetails.java","src/main/java/com/azure/ai/agents/models/ToolboxPolicies.java","src/main/java/com/azure/ai/agents/models/ToolboxVersionDetails.java","src/main/java/com/azure/ai/agents/models/UpdateAgentDetailsOptions.java","src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java","src/main/java/com/azure/ai/agents/models/VersionIndicator.java","src/main/java/com/azure/ai/agents/models/VersionIndicatorType.java","src/main/java/com/azure/ai/agents/models/VersionRefIndicator.java","src/main/java/com/azure/ai/agents/models/VersionSelectionRule.java","src/main/java/com/azure/ai/agents/models/VersionSelector.java","src/main/java/com/azure/ai/agents/models/VersionSelectorType.java","src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java","src/main/java/com/azure/ai/agents/models/WebSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/WebSearchTool.java","src/main/java/com/azure/ai/agents/models/WebSearchToolFilters.java","src/main/java/com/azure/ai/agents/models/WebSearchToolSearchContextSize.java","src/main/java/com/azure/ai/agents/models/WorkIQPreviewToolParameters.java","src/main/java/com/azure/ai/agents/models/WorkIqPreviewTool.java","src/main/java/com/azure/ai/agents/models/WorkflowAgentDefinition.java","src/main/java/com/azure/ai/agents/models/package-info.java","src/main/java/com/azure/ai/agents/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Azure.AI.Projects":"v1"},"crossLanguagePackageId":"Azure.AI.Projects","crossLanguageVersion":"045bf1bf68c9","crossLanguageDefinitions":{"com.azure.ai.agents.AgentSessionFilesAsyncClient":"Azure.AI.Projects.AgentSessionFiles","com.azure.ai.agents.AgentSessionFilesAsyncClient.deleteSessionFile":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.deleteSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.downloadSessionFile":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.downloadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.listSessionFiles":"Azure.AI.Projects.AgentSessionFiles.listSessionFiles","com.azure.ai.agents.AgentSessionFilesAsyncClient.uploadSessionFile":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentSessionFilesAsyncClient.uploadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentSessionFilesClient":"Azure.AI.Projects.AgentSessionFiles","com.azure.ai.agents.AgentSessionFilesClient.deleteSessionFile":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesClient.deleteSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.deleteSessionFile","com.azure.ai.agents.AgentSessionFilesClient.downloadSessionFile":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesClient.downloadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.downloadSessionFile","com.azure.ai.agents.AgentSessionFilesClient.listSessionFiles":"Azure.AI.Projects.AgentSessionFiles.listSessionFiles","com.azure.ai.agents.AgentSessionFilesClient.uploadSessionFile":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentSessionFilesClient.uploadSessionFileWithResponse":"Azure.AI.Projects.AgentSessionFiles.uploadSessionFile","com.azure.ai.agents.AgentsAsyncClient":"Azure.AI.Projects.Agents","com.azure.ai.agents.AgentsAsyncClient.cancelOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.cancel","com.azure.ai.agents.AgentsAsyncClient.cancelOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.cancel","com.azure.ai.agents.AgentsAsyncClient.createAgent":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsAsyncClient.createAgentFromCode":"Azure.AI.Projects.Agents.createAgentFromCode","com.azure.ai.agents.AgentsAsyncClient.createAgentFromCodeWithResponse":"Azure.AI.Projects.Agents.createAgentFromCode","com.azure.ai.agents.AgentsAsyncClient.createAgentFromManifest":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentVersion":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionFromCode":"Azure.AI.Projects.Agents.createAgentVersionFromCode","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionFromCodeWithResponse":"Azure.AI.Projects.Agents.createAgentVersionFromCode","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionFromManifest":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsAsyncClient.createAgentVersionWithResponse":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsAsyncClient.createAgentWithResponse":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsAsyncClient.createOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.create","com.azure.ai.agents.AgentsAsyncClient.createOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.create","com.azure.ai.agents.AgentsAsyncClient.createSession":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsAsyncClient.createSessionWithResponse":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsAsyncClient.deleteOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.delete","com.azure.ai.agents.AgentsAsyncClient.deleteOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.delete","com.azure.ai.agents.AgentsAsyncClient.deleteSession":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsAsyncClient.deleteSessionWithResponse":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsAsyncClient.downloadAgentCode":"Azure.AI.Projects.Agents.downloadAgentCode","com.azure.ai.agents.AgentsAsyncClient.downloadAgentCodeWithResponse":"Azure.AI.Projects.Agents.downloadAgentCode","com.azure.ai.agents.AgentsAsyncClient.getAgent":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsAsyncClient.getAgentVersionDetails":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsAsyncClient.getAgentVersionDetailsWithResponse":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsAsyncClient.getAgentWithResponse":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidate":"Azure.AI.Projects.AgentOptimizationJobs.getCandidate","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateConfig":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateConfig","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateConfigWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateConfig","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateFile":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateFile","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateFileWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateFile","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateResults":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateResults","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateResultsWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateResults","com.azure.ai.agents.AgentsAsyncClient.getOptimizationCandidateWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidate","com.azure.ai.agents.AgentsAsyncClient.getOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.get","com.azure.ai.agents.AgentsAsyncClient.getOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.get","com.azure.ai.agents.AgentsAsyncClient.getSession":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsAsyncClient.getSessionWithResponse":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsAsyncClient.listAgentConversations":"Azure.AI.Projects.Conversations.listConversations","com.azure.ai.agents.AgentsAsyncClient.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsAsyncClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsAsyncClient.listOptimizationCandidates":"Azure.AI.Projects.AgentOptimizationJobs.listCandidates","com.azure.ai.agents.AgentsAsyncClient.listOptimizationCandidatesWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.listCandidates","com.azure.ai.agents.AgentsAsyncClient.listOptimizationJobs":"Azure.AI.Projects.AgentOptimizationJobs.list","com.azure.ai.agents.AgentsAsyncClient.listSessions":"Azure.AI.Projects.Agents.listSessions","com.azure.ai.agents.AgentsAsyncClient.promoteOptimizationCandidate":"Azure.AI.Projects.AgentOptimizationJobs.promoteCandidate","com.azure.ai.agents.AgentsAsyncClient.promoteOptimizationCandidateWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.promoteCandidate","com.azure.ai.agents.AgentsAsyncClient.stopSession":"Azure.AI.Projects.Agents.stopSession","com.azure.ai.agents.AgentsAsyncClient.stopSessionWithResponse":"Azure.AI.Projects.Agents.stopSession","com.azure.ai.agents.AgentsAsyncClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsAsyncClient.updateAgentDetails":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsAsyncClient.updateAgentDetailsWithResponse":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsAsyncClient.updateAgentFromCode":"Azure.AI.Projects.Agents.updateAgentFromCode","com.azure.ai.agents.AgentsAsyncClient.updateAgentFromCodeWithResponse":"Azure.AI.Projects.Agents.updateAgentFromCode","com.azure.ai.agents.AgentsAsyncClient.updateAgentFromManifest":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.updateAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsAsyncClient.updateAgentWithResponse":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsClient":"Azure.AI.Projects.Agents","com.azure.ai.agents.AgentsClient.cancelOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.cancel","com.azure.ai.agents.AgentsClient.cancelOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.cancel","com.azure.ai.agents.AgentsClient.createAgent":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsClient.createAgentFromCode":"Azure.AI.Projects.Agents.createAgentFromCode","com.azure.ai.agents.AgentsClient.createAgentFromCodeWithResponse":"Azure.AI.Projects.Agents.createAgentFromCode","com.azure.ai.agents.AgentsClient.createAgentFromManifest":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsClient.createAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentFromManifest","com.azure.ai.agents.AgentsClient.createAgentVersion":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsClient.createAgentVersionFromCode":"Azure.AI.Projects.Agents.createAgentVersionFromCode","com.azure.ai.agents.AgentsClient.createAgentVersionFromCodeWithResponse":"Azure.AI.Projects.Agents.createAgentVersionFromCode","com.azure.ai.agents.AgentsClient.createAgentVersionFromManifest":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsClient.createAgentVersionFromManifestWithResponse":"Azure.AI.Projects.Agents.createAgentVersionFromManifest","com.azure.ai.agents.AgentsClient.createAgentVersionWithResponse":"Azure.AI.Projects.Agents.createAgentVersion","com.azure.ai.agents.AgentsClient.createAgentWithResponse":"Azure.AI.Projects.Agents.createAgent","com.azure.ai.agents.AgentsClient.createOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.create","com.azure.ai.agents.AgentsClient.createOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.create","com.azure.ai.agents.AgentsClient.createSession":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsClient.createSessionWithResponse":"Azure.AI.Projects.Agents.createSession","com.azure.ai.agents.AgentsClient.deleteOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.delete","com.azure.ai.agents.AgentsClient.deleteOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.delete","com.azure.ai.agents.AgentsClient.deleteSession":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsClient.deleteSessionWithResponse":"Azure.AI.Projects.Agents.deleteSession","com.azure.ai.agents.AgentsClient.downloadAgentCode":"Azure.AI.Projects.Agents.downloadAgentCode","com.azure.ai.agents.AgentsClient.downloadAgentCodeWithResponse":"Azure.AI.Projects.Agents.downloadAgentCode","com.azure.ai.agents.AgentsClient.getAgent":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsClient.getAgentVersionDetails":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsClient.getAgentVersionDetailsWithResponse":"Azure.AI.Projects.Agents.getAgentVersion","com.azure.ai.agents.AgentsClient.getAgentWithResponse":"Azure.AI.Projects.Agents.getAgent","com.azure.ai.agents.AgentsClient.getOptimizationCandidate":"Azure.AI.Projects.AgentOptimizationJobs.getCandidate","com.azure.ai.agents.AgentsClient.getOptimizationCandidateConfig":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateConfig","com.azure.ai.agents.AgentsClient.getOptimizationCandidateConfigWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateConfig","com.azure.ai.agents.AgentsClient.getOptimizationCandidateFile":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateFile","com.azure.ai.agents.AgentsClient.getOptimizationCandidateFileWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateFile","com.azure.ai.agents.AgentsClient.getOptimizationCandidateResults":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateResults","com.azure.ai.agents.AgentsClient.getOptimizationCandidateResultsWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidateResults","com.azure.ai.agents.AgentsClient.getOptimizationCandidateWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.getCandidate","com.azure.ai.agents.AgentsClient.getOptimizationJob":"Azure.AI.Projects.AgentOptimizationJobs.get","com.azure.ai.agents.AgentsClient.getOptimizationJobWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.get","com.azure.ai.agents.AgentsClient.getSession":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsClient.getSessionWithResponse":"Azure.AI.Projects.Agents.getSession","com.azure.ai.agents.AgentsClient.listAgentConversations":"Azure.AI.Projects.Conversations.listConversations","com.azure.ai.agents.AgentsClient.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsClient.listOptimizationCandidates":"Azure.AI.Projects.AgentOptimizationJobs.listCandidates","com.azure.ai.agents.AgentsClient.listOptimizationCandidatesWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.listCandidates","com.azure.ai.agents.AgentsClient.listOptimizationJobs":"Azure.AI.Projects.AgentOptimizationJobs.list","com.azure.ai.agents.AgentsClient.listSessions":"Azure.AI.Projects.Agents.listSessions","com.azure.ai.agents.AgentsClient.promoteOptimizationCandidate":"Azure.AI.Projects.AgentOptimizationJobs.promoteCandidate","com.azure.ai.agents.AgentsClient.promoteOptimizationCandidateWithResponse":"Azure.AI.Projects.AgentOptimizationJobs.promoteCandidate","com.azure.ai.agents.AgentsClient.stopSession":"Azure.AI.Projects.Agents.stopSession","com.azure.ai.agents.AgentsClient.stopSessionWithResponse":"Azure.AI.Projects.Agents.stopSession","com.azure.ai.agents.AgentsClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsClient.updateAgentDetails":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsClient.updateAgentDetailsWithResponse":"Azure.AI.Projects.Agents.patchAgentObject","com.azure.ai.agents.AgentsClient.updateAgentFromCode":"Azure.AI.Projects.Agents.updateAgentFromCode","com.azure.ai.agents.AgentsClient.updateAgentFromCodeWithResponse":"Azure.AI.Projects.Agents.updateAgentFromCode","com.azure.ai.agents.AgentsClient.updateAgentFromManifest":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsClient.updateAgentFromManifestWithResponse":"Azure.AI.Projects.Agents.updateAgentFromManifest","com.azure.ai.agents.AgentsClient.updateAgentWithResponse":"Azure.AI.Projects.Agents.updateAgent","com.azure.ai.agents.AgentsClientBuilder":"Azure.AI.Projects","com.azure.ai.agents.MemoryStoresAsyncClient":"Azure.AI.Projects.MemoryStores","com.azure.ai.agents.MemoryStoresAsyncClient.beginInternalUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresAsyncClient.beginInternalUpdateMemoriesWithModel":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresAsyncClient.createMemory":"Azure.AI.Projects.MemoryStores.createMemory","com.azure.ai.agents.MemoryStoresAsyncClient.createMemoryStore":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.createMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.createMemoryWithResponse":"Azure.AI.Projects.MemoryStores.createMemory","com.azure.ai.agents.MemoryStoresAsyncClient.getMemory":"Azure.AI.Projects.MemoryStores.getMemory","com.azure.ai.agents.MemoryStoresAsyncClient.getMemoryStore":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.getMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.getMemoryWithResponse":"Azure.AI.Projects.MemoryStores.getMemory","com.azure.ai.agents.MemoryStoresAsyncClient.getUpdateResult":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresAsyncClient.getUpdateResultWithResponse":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresAsyncClient.internalSearchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresAsyncClient.internalSearchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresAsyncClient.listMemories":"Azure.AI.Projects.MemoryStores.listMemories","com.azure.ai.agents.MemoryStoresAsyncClient.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresAsyncClient.updateMemory":"Azure.AI.Projects.MemoryStores.updateMemory","com.azure.ai.agents.MemoryStoresAsyncClient.updateMemoryStore":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.updateMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.updateMemoryWithResponse":"Azure.AI.Projects.MemoryStores.updateMemory","com.azure.ai.agents.MemoryStoresClient":"Azure.AI.Projects.MemoryStores","com.azure.ai.agents.MemoryStoresClient.beginInternalUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresClient.beginInternalUpdateMemoriesWithModel":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresClient.createMemory":"Azure.AI.Projects.MemoryStores.createMemory","com.azure.ai.agents.MemoryStoresClient.createMemoryStore":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresClient.createMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.createMemoryStore","com.azure.ai.agents.MemoryStoresClient.createMemoryWithResponse":"Azure.AI.Projects.MemoryStores.createMemory","com.azure.ai.agents.MemoryStoresClient.getMemory":"Azure.AI.Projects.MemoryStores.getMemory","com.azure.ai.agents.MemoryStoresClient.getMemoryStore":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresClient.getMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.getMemoryStore","com.azure.ai.agents.MemoryStoresClient.getMemoryWithResponse":"Azure.AI.Projects.MemoryStores.getMemory","com.azure.ai.agents.MemoryStoresClient.getUpdateResult":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresClient.getUpdateResultWithResponse":"Azure.AI.Projects.MemoryStores.getUpdateResult","com.azure.ai.agents.MemoryStoresClient.internalSearchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresClient.internalSearchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresClient.listMemories":"Azure.AI.Projects.MemoryStores.listMemories","com.azure.ai.agents.MemoryStoresClient.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresClient.updateMemory":"Azure.AI.Projects.MemoryStores.updateMemory","com.azure.ai.agents.MemoryStoresClient.updateMemoryStore":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresClient.updateMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.updateMemoryStore","com.azure.ai.agents.MemoryStoresClient.updateMemoryWithResponse":"Azure.AI.Projects.MemoryStores.updateMemory","com.azure.ai.agents.ToolboxesAsyncClient":"Azure.AI.Projects.Toolboxes","com.azure.ai.agents.ToolboxesAsyncClient.createToolboxVersion":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.createToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolbox":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolboxVersion":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.deleteToolboxWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesAsyncClient.getToolbox":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesAsyncClient.getToolboxVersion":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.getToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesAsyncClient.getToolboxWithResponse":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesAsyncClient.listToolboxVersions":"Azure.AI.Projects.Toolboxes.listToolboxVersions","com.azure.ai.agents.ToolboxesAsyncClient.listToolboxes":"Azure.AI.Projects.Toolboxes.listToolboxes","com.azure.ai.agents.ToolboxesAsyncClient.updateToolbox":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.ToolboxesAsyncClient.updateToolboxWithResponse":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.ToolboxesClient":"Azure.AI.Projects.Toolboxes","com.azure.ai.agents.ToolboxesClient.createToolboxVersion":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesClient.createToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.createToolboxVersion","com.azure.ai.agents.ToolboxesClient.deleteToolbox":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesClient.deleteToolboxVersion":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesClient.deleteToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolboxVersion","com.azure.ai.agents.ToolboxesClient.deleteToolboxWithResponse":"Azure.AI.Projects.Toolboxes.deleteToolbox","com.azure.ai.agents.ToolboxesClient.getToolbox":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesClient.getToolboxVersion":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesClient.getToolboxVersionWithResponse":"Azure.AI.Projects.Toolboxes.getToolboxVersion","com.azure.ai.agents.ToolboxesClient.getToolboxWithResponse":"Azure.AI.Projects.Toolboxes.getToolbox","com.azure.ai.agents.ToolboxesClient.listToolboxVersions":"Azure.AI.Projects.Toolboxes.listToolboxVersions","com.azure.ai.agents.ToolboxesClient.listToolboxes":"Azure.AI.Projects.Toolboxes.listToolboxes","com.azure.ai.agents.ToolboxesClient.updateToolbox":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.ToolboxesClient.updateToolboxWithResponse":"Azure.AI.Projects.Toolboxes.updateToolbox","com.azure.ai.agents.implementation.models.CreateAgentFromCodeContent":"Azure.AI.Projects.CreateAgentFromCodeContent","com.azure.ai.agents.implementation.models.CreateAgentFromManifestRequest":"Azure.AI.Projects.createAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentOptions":null,"com.azure.ai.agents.implementation.models.CreateAgentRequest":"Azure.AI.Projects.createAgent.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionFromManifestRequest":"Azure.AI.Projects.createAgentVersionFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionRequest":"Azure.AI.Projects.createAgentVersion.Request.anonymous","com.azure.ai.agents.implementation.models.CreateMemoryRequest":"Azure.AI.Projects.createMemory.Request.anonymous","com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest":"Azure.AI.Projects.createMemoryStore.Request.anonymous","com.azure.ai.agents.implementation.models.CreateSessionRequest":"Azure.AI.Projects.createSession.Request.anonymous","com.azure.ai.agents.implementation.models.CreateToolboxVersionRequest":"Azure.AI.Projects.createToolboxVersion.Request.anonymous","com.azure.ai.agents.implementation.models.ListMemoriesRequest":"Azure.AI.Projects.listMemories.Request.anonymous","com.azure.ai.agents.implementation.models.SearchMemoriesRequest":"Azure.AI.Projects.searchMemories.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest":"Azure.AI.Projects.updateAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentRequest":"Azure.AI.Projects.updateAgent.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateMemoriesRequest":"Azure.AI.Projects.updateMemories.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateMemoryRequest":"Azure.AI.Projects.updateMemory.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest":"Azure.AI.Projects.updateMemoryStore.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateToolboxInput":"Azure.AI.Projects.UpdateToolboxRequest","com.azure.ai.agents.implementation.models.UpdateToolboxRequest":"Azure.AI.Projects.updateToolbox.Request.anonymous","com.azure.ai.agents.models.A2APreviewTool":"Azure.AI.Projects.A2APreviewTool","com.azure.ai.agents.models.A2AToolCall":"Azure.AI.Projects.A2AToolCall","com.azure.ai.agents.models.A2AToolCallOutput":"Azure.AI.Projects.A2AToolCallOutput","com.azure.ai.agents.models.AISearchIndexResource":"Azure.AI.Projects.AISearchIndexResource","com.azure.ai.agents.models.AgentBlueprintReference":"Azure.AI.Projects.AgentBlueprintReference","com.azure.ai.agents.models.AgentBlueprintReferenceType":"Azure.AI.Projects.AgentBlueprintReferenceType","com.azure.ai.agents.models.AgentCard":"Azure.AI.Projects.AgentCard","com.azure.ai.agents.models.AgentCardSkill":"Azure.AI.Projects.AgentCardSkill","com.azure.ai.agents.models.AgentDefinition":"Azure.AI.Projects.AgentDefinition","com.azure.ai.agents.models.AgentDefinitionOptInKeys":"Azure.AI.Projects.AgentDefinitionOptInKeys","com.azure.ai.agents.models.AgentDetails":"Azure.AI.Projects.AgentObject","com.azure.ai.agents.models.AgentDetailsVersions":"Azure.AI.Projects.AgentObject.versions.anonymous","com.azure.ai.agents.models.AgentEndpointAuthorizationScheme":"Azure.AI.Projects.AgentEndpointAuthorizationScheme","com.azure.ai.agents.models.AgentEndpointAuthorizationSchemeType":"Azure.AI.Projects.AgentEndpointAuthorizationSchemeType","com.azure.ai.agents.models.AgentEndpointConfig":"Azure.AI.Projects.AgentEndpointConfig","com.azure.ai.agents.models.AgentEndpointProtocol":"Azure.AI.Projects.AgentEndpointProtocol","com.azure.ai.agents.models.AgentIdentifier":"Azure.AI.Projects.AgentIdentifier","com.azure.ai.agents.models.AgentIdentity":"Azure.AI.Projects.AgentIdentity","com.azure.ai.agents.models.AgentKind":"Azure.AI.Projects.AgentKind","com.azure.ai.agents.models.AgentObjectType":"Azure.AI.Projects.AgentObjectType","com.azure.ai.agents.models.AgentProtocol":"Azure.AI.Projects.AgentProtocol","com.azure.ai.agents.models.AgentReference":"Azure.AI.Projects.AgentReference","com.azure.ai.agents.models.AgentSessionResource":"Azure.AI.Projects.AgentSessionResource","com.azure.ai.agents.models.AgentSessionStatus":"Azure.AI.Projects.AgentSessionStatus","com.azure.ai.agents.models.AgentVersionDetails":"Azure.AI.Projects.AgentVersionObject","com.azure.ai.agents.models.AgentVersionStatus":"Azure.AI.Projects.AgentVersionStatus","com.azure.ai.agents.models.ApiError":"OpenAI.Error","com.azure.ai.agents.models.ApplyPatchToolParameter":"OpenAI.ApplyPatchToolParam","com.azure.ai.agents.models.ApproximateLocation":"OpenAI.ApproximateLocation","com.azure.ai.agents.models.AutoCodeInterpreterToolParameter":"OpenAI.AutoCodeInterpreterToolParam","com.azure.ai.agents.models.AzureAISearchQueryType":"Azure.AI.Projects.AzureAISearchQueryType","com.azure.ai.agents.models.AzureAISearchTool":"Azure.AI.Projects.AzureAISearchTool","com.azure.ai.agents.models.AzureAISearchToolCall":"Azure.AI.Projects.AzureAISearchToolCall","com.azure.ai.agents.models.AzureAISearchToolCallOutput":"Azure.AI.Projects.AzureAISearchToolCallOutput","com.azure.ai.agents.models.AzureAISearchToolResource":"Azure.AI.Projects.AzureAISearchToolResource","com.azure.ai.agents.models.AzureCreateResponseDetails":"Azure.AI.Projects.AzureCreateResponseDetails","com.azure.ai.agents.models.AzureCreateResponseOptions":"Azure.AI.Projects.AzureCreateResponseOptions","com.azure.ai.agents.models.AzureFunctionBinding":"Azure.AI.Projects.AzureFunctionBinding","com.azure.ai.agents.models.AzureFunctionDefinition":"Azure.AI.Projects.AzureFunctionDefinition","com.azure.ai.agents.models.AzureFunctionDefinitionDetails":"Azure.AI.Projects.AzureFunctionDefinition.function.anonymous","com.azure.ai.agents.models.AzureFunctionStorageQueue":"Azure.AI.Projects.AzureFunctionStorageQueue","com.azure.ai.agents.models.AzureFunctionTool":"Azure.AI.Projects.AzureFunctionTool","com.azure.ai.agents.models.AzureFunctionToolCall":"Azure.AI.Projects.AzureFunctionToolCall","com.azure.ai.agents.models.AzureFunctionToolCallOutput":"Azure.AI.Projects.AzureFunctionToolCallOutput","com.azure.ai.agents.models.BingCustomSearchConfiguration":"Azure.AI.Projects.BingCustomSearchConfiguration","com.azure.ai.agents.models.BingCustomSearchPreviewTool":"Azure.AI.Projects.BingCustomSearchPreviewTool","com.azure.ai.agents.models.BingCustomSearchToolCall":"Azure.AI.Projects.BingCustomSearchToolCall","com.azure.ai.agents.models.BingCustomSearchToolCallOutput":"Azure.AI.Projects.BingCustomSearchToolCallOutput","com.azure.ai.agents.models.BingCustomSearchToolParameters":"Azure.AI.Projects.BingCustomSearchToolParameters","com.azure.ai.agents.models.BingGroundingSearchConfiguration":"Azure.AI.Projects.BingGroundingSearchConfiguration","com.azure.ai.agents.models.BingGroundingSearchToolParameters":"Azure.AI.Projects.BingGroundingSearchToolParameters","com.azure.ai.agents.models.BingGroundingTool":"Azure.AI.Projects.BingGroundingTool","com.azure.ai.agents.models.BingGroundingToolCall":"Azure.AI.Projects.BingGroundingToolCall","com.azure.ai.agents.models.BingGroundingToolCallOutput":"Azure.AI.Projects.BingGroundingToolCallOutput","com.azure.ai.agents.models.BotServiceAuthorizationScheme":"Azure.AI.Projects.BotServiceAuthorizationScheme","com.azure.ai.agents.models.BotServiceRbacAuthorizationScheme":"Azure.AI.Projects.BotServiceRbacAuthorizationScheme","com.azure.ai.agents.models.BrowserAutomationPreviewTool":"Azure.AI.Projects.BrowserAutomationPreviewTool","com.azure.ai.agents.models.BrowserAutomationToolCall":"Azure.AI.Projects.BrowserAutomationToolCall","com.azure.ai.agents.models.BrowserAutomationToolCallOutput":"Azure.AI.Projects.BrowserAutomationToolCallOutput","com.azure.ai.agents.models.BrowserAutomationToolConnectionParameters":"Azure.AI.Projects.BrowserAutomationToolConnectionParameters","com.azure.ai.agents.models.BrowserAutomationToolParameters":"Azure.AI.Projects.BrowserAutomationToolParameters","com.azure.ai.agents.models.CandidateDeployConfig":"Azure.AI.Projects.CandidateDeployConfig","com.azure.ai.agents.models.CandidateFileInfo":"Azure.AI.Projects.CandidateFileInfo","com.azure.ai.agents.models.CandidateMetadata":"Azure.AI.Projects.CandidateMetadata","com.azure.ai.agents.models.CandidateResults":"Azure.AI.Projects.CandidateResults","com.azure.ai.agents.models.CaptureStructuredOutputsTool":"Azure.AI.Projects.CaptureStructuredOutputsTool","com.azure.ai.agents.models.ChatSummaryMemoryItem":"Azure.AI.Projects.ChatSummaryMemoryItem","com.azure.ai.agents.models.CodeConfiguration":"Azure.AI.Projects.CodeConfiguration","com.azure.ai.agents.models.CodeDependencyResolution":"Azure.AI.Projects.CodeDependencyResolution","com.azure.ai.agents.models.CodeFileDetails":null,"com.azure.ai.agents.models.CodeInterpreterTool":"OpenAI.CodeInterpreterTool","com.azure.ai.agents.models.ComputerEnvironment":"ComputerEnvironmentExpandable","com.azure.ai.agents.models.ComputerUsePreviewTool":"OpenAI.ComputerUsePreviewTool","com.azure.ai.agents.models.ContainerAutoParameter":"OpenAI.ContainerAutoParam","com.azure.ai.agents.models.ContainerConfiguration":"Azure.AI.Projects.ContainerConfiguration","com.azure.ai.agents.models.ContainerMemoryLimit":"ContainerMemoryLimitExpandable","com.azure.ai.agents.models.ContainerNetworkPolicyAllowlistParameter":"OpenAI.ContainerNetworkPolicyAllowlistParam","com.azure.ai.agents.models.ContainerNetworkPolicyDisabledParameter":"OpenAI.ContainerNetworkPolicyDisabledParam","com.azure.ai.agents.models.ContainerNetworkPolicyDomainSecretParameter":"OpenAI.ContainerNetworkPolicyDomainSecretParam","com.azure.ai.agents.models.ContainerNetworkPolicyParamType":"OpenAI.ContainerNetworkPolicyParamType","com.azure.ai.agents.models.ContainerNetworkPolicyParameter":"OpenAI.ContainerNetworkPolicyParam","com.azure.ai.agents.models.ContainerSkill":"OpenAI.ContainerSkill","com.azure.ai.agents.models.ContainerSkillType":"OpenAI.ContainerSkillType","com.azure.ai.agents.models.CreateAgentVersionFromCodeContent":"Azure.AI.Projects.CreateAgentVersionFromCodeContent","com.azure.ai.agents.models.CreateAgentVersionFromCodeMetadata":"Azure.AI.Projects.CreateAgentVersionFromCodeMetadata","com.azure.ai.agents.models.CreateAgentVersionInput":"Azure.AI.Projects.CreateAgentVersionRequest","com.azure.ai.agents.models.CustomGrammarFormatParameter":"OpenAI.CustomGrammarFormatParam","com.azure.ai.agents.models.CustomTextFormatParameter":"OpenAI.CustomTextFormatParam","com.azure.ai.agents.models.CustomToolParamFormat":"OpenAI.CustomToolParamFormat","com.azure.ai.agents.models.CustomToolParamFormatType":"OpenAI.CustomToolParamFormatType","com.azure.ai.agents.models.CustomToolParameter":"OpenAI.CustomToolParam","com.azure.ai.agents.models.DatasetInfo":"Azure.AI.Projects.DatasetInfo","com.azure.ai.agents.models.DatasetRef":"Azure.AI.Projects.DatasetRef","com.azure.ai.agents.models.EntraAuthorizationScheme":"Azure.AI.Projects.EntraAuthorizationScheme","com.azure.ai.agents.models.EntraIsolationKeySource":"Azure.AI.Projects.EntraIsolationKeySource","com.azure.ai.agents.models.EvaluationLevel":"Azure.AI.Projects.EvaluationLevel","com.azure.ai.agents.models.ExternalAgentDefinition":"Azure.AI.Projects.ExternalAgentDefinition","com.azure.ai.agents.models.FabricDataAgentToolCall":"Azure.AI.Projects.FabricDataAgentToolCall","com.azure.ai.agents.models.FabricDataAgentToolCallOutput":"Azure.AI.Projects.FabricDataAgentToolCallOutput","com.azure.ai.agents.models.FabricDataAgentToolParameters":"Azure.AI.Projects.FabricDataAgentToolParameters","com.azure.ai.agents.models.FabricIqPreviewTool":"Azure.AI.Projects.FabricIQPreviewTool","com.azure.ai.agents.models.FileSearchTool":"OpenAI.FileSearchTool","com.azure.ai.agents.models.FixedRatioVersionSelectionRule":"Azure.AI.Projects.FixedRatioVersionSelectionRule","com.azure.ai.agents.models.FoundryFeaturesOptInKeys":"Azure.AI.Projects.FoundryFeaturesOptInKeys","com.azure.ai.agents.models.FunctionShellToolParamEnvironment":"OpenAI.FunctionShellToolParamEnvironment","com.azure.ai.agents.models.FunctionShellToolParamEnvironmentType":"OpenAI.FunctionShellToolParamEnvironmentType","com.azure.ai.agents.models.FunctionShellToolParameter":"OpenAI.FunctionShellToolParam","com.azure.ai.agents.models.FunctionShellToolParameterEnvironmentContainerReferenceParameter":"OpenAI.FunctionShellToolParamEnvironmentContainerReferenceParam","com.azure.ai.agents.models.FunctionShellToolParameterEnvironmentLocalEnvironmentParameter":"OpenAI.FunctionShellToolParamEnvironmentLocalEnvironmentParam","com.azure.ai.agents.models.FunctionTool":"OpenAI.FunctionTool","com.azure.ai.agents.models.GrammarSyntax":"GrammarSyntaxExpandable","com.azure.ai.agents.models.HeaderIsolationKeySource":"Azure.AI.Projects.HeaderIsolationKeySource","com.azure.ai.agents.models.HeaderTelemetryEndpointAuth":"Azure.AI.Projects.HeaderTelemetryEndpointAuth","com.azure.ai.agents.models.HostedAgentDefinition":"Azure.AI.Projects.HostedAgentDefinition","com.azure.ai.agents.models.HybridSearchOptions":"OpenAI.HybridSearchOptions","com.azure.ai.agents.models.ImageGenActionEnum":"ImageGenActionEnumExpandable","com.azure.ai.agents.models.ImageGenTool":"OpenAI.ImageGenTool","com.azure.ai.agents.models.ImageGenToolBackground":"ImageGenToolBackgroundExpandable","com.azure.ai.agents.models.ImageGenToolInputImageMask":"OpenAI.ImageGenToolInputImageMask","com.azure.ai.agents.models.ImageGenToolModel":"OpenAI.ImageGenTool.model.anonymous","com.azure.ai.agents.models.ImageGenToolModeration":"ImageGenToolModerationExpandable","com.azure.ai.agents.models.ImageGenToolOutputFormat":"ImageGenToolOutputFormatExpandable","com.azure.ai.agents.models.ImageGenToolQuality":"ImageGenToolQualityExpandable","com.azure.ai.agents.models.ImageGenToolSize":"ImageGenToolSizeExpandable","com.azure.ai.agents.models.IncludeEnum":"OpenAI.IncludeEnum","com.azure.ai.agents.models.InlineSkillParameter":"OpenAI.InlineSkillParam","com.azure.ai.agents.models.InlineSkillSourceParameter":"OpenAI.InlineSkillSourceParam","com.azure.ai.agents.models.InputFidelity":"InputFidelityExpandable","com.azure.ai.agents.models.IsolationKeySource":"Azure.AI.Projects.IsolationKeySource","com.azure.ai.agents.models.IsolationKeySourceKind":"Azure.AI.Projects.IsolationKeySourceKind","com.azure.ai.agents.models.JobStatus":"Azure.AI.Projects.JobStatus","com.azure.ai.agents.models.ListMemoriesOptions":null,"com.azure.ai.agents.models.LocalShellToolParameter":"OpenAI.LocalShellToolParam","com.azure.ai.agents.models.LocalSkillParameter":"OpenAI.LocalSkillParam","com.azure.ai.agents.models.ManagedAgentIdentityBlueprintReference":"Azure.AI.Projects.ManagedAgentIdentityBlueprintReference","com.azure.ai.agents.models.McpTool":"OpenAI.MCPTool","com.azure.ai.agents.models.McpToolConnectorId":"McpToolConnectorIdExpandable","com.azure.ai.agents.models.McpToolFilter":"OpenAI.MCPToolFilter","com.azure.ai.agents.models.McpToolRequireApproval":"OpenAI.MCPToolRequireApproval","com.azure.ai.agents.models.MemoryCommandToolCall":"Azure.AI.Projects.MemoryCommandToolCall","com.azure.ai.agents.models.MemoryCommandToolCallOutput":"Azure.AI.Projects.MemoryCommandToolCallOutput","com.azure.ai.agents.models.MemoryItem":"Azure.AI.Projects.MemoryItem","com.azure.ai.agents.models.MemoryItemKind":"Azure.AI.Projects.MemoryItemKind","com.azure.ai.agents.models.MemoryOperation":"Azure.AI.Projects.MemoryOperation","com.azure.ai.agents.models.MemoryOperationKind":"Azure.AI.Projects.MemoryOperationKind","com.azure.ai.agents.models.MemorySearchItem":"Azure.AI.Projects.MemorySearchItem","com.azure.ai.agents.models.MemorySearchOptions":"Azure.AI.Projects.MemorySearchOptions","com.azure.ai.agents.models.MemorySearchPreviewTool":"Azure.AI.Projects.MemorySearchPreviewTool","com.azure.ai.agents.models.MemorySearchToolCall":"Azure.AI.Projects.MemorySearchToolCall","com.azure.ai.agents.models.MemoryStoreDefaultDefinition":"Azure.AI.Projects.MemoryStoreDefaultDefinition","com.azure.ai.agents.models.MemoryStoreDefaultOptions":"Azure.AI.Projects.MemoryStoreDefaultOptions","com.azure.ai.agents.models.MemoryStoreDefinition":"Azure.AI.Projects.MemoryStoreDefinition","com.azure.ai.agents.models.MemoryStoreDetails":"Azure.AI.Projects.MemoryStoreObject","com.azure.ai.agents.models.MemoryStoreKind":"Azure.AI.Projects.MemoryStoreKind","com.azure.ai.agents.models.MemoryStoreObjectType":"Azure.AI.Projects.MemoryStoreObjectType","com.azure.ai.agents.models.MemoryStoreOperationUsage":"Azure.AI.Projects.MemoryStoreOperationUsage","com.azure.ai.agents.models.MemoryStoreSearchResponse":"Azure.AI.Projects.MemoryStoreSearchResponse","com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult":"Azure.AI.Projects.MemoryStoreUpdateCompletedResult","com.azure.ai.agents.models.MemoryStoreUpdateResponse":"Azure.AI.Projects.MemoryStoreUpdateResponse","com.azure.ai.agents.models.MemoryStoreUpdateStatus":"Azure.AI.Projects.MemoryStoreUpdateStatus","com.azure.ai.agents.models.MicrosoftFabricPreviewTool":"Azure.AI.Projects.MicrosoftFabricPreviewTool","com.azure.ai.agents.models.OpenApiAnonymousAuthDetails":"Azure.AI.Projects.OpenApiAnonymousAuthDetails","com.azure.ai.agents.models.OpenApiAuthDetails":"Azure.AI.Projects.OpenApiAuthDetails","com.azure.ai.agents.models.OpenApiAuthType":"Azure.AI.Projects.OpenApiAuthType","com.azure.ai.agents.models.OpenApiFunctionDefinition":"Azure.AI.Projects.OpenApiFunctionDefinition","com.azure.ai.agents.models.OpenApiFunctionDefinitionFunction":"Azure.AI.Projects.OpenApiFunctionDefinition.function.anonymous","com.azure.ai.agents.models.OpenApiManagedAuthDetails":"Azure.AI.Projects.OpenApiManagedAuthDetails","com.azure.ai.agents.models.OpenApiManagedSecurityScheme":"Azure.AI.Projects.OpenApiManagedSecurityScheme","com.azure.ai.agents.models.OpenApiProjectConnectionAuthDetails":"Azure.AI.Projects.OpenApiProjectConnectionAuthDetails","com.azure.ai.agents.models.OpenApiProjectConnectionSecurityScheme":"Azure.AI.Projects.OpenApiProjectConnectionSecurityScheme","com.azure.ai.agents.models.OpenApiTool":"Azure.AI.Projects.OpenApiTool","com.azure.ai.agents.models.OpenApiToolCall":"Azure.AI.Projects.OpenApiToolCall","com.azure.ai.agents.models.OpenApiToolCallOutput":"Azure.AI.Projects.OpenApiToolCallOutput","com.azure.ai.agents.models.OptimizationAgentDefinition":"Azure.AI.Projects.OptimizationAgentDefinition","com.azure.ai.agents.models.OptimizationCandidate":"Azure.AI.Projects.OptimizationCandidate","com.azure.ai.agents.models.OptimizationCandidatePagedResult":"Azure.AI.Projects.AgentsPagedResult","com.azure.ai.agents.models.OptimizationJob":"Azure.AI.Projects.OptimizationJob","com.azure.ai.agents.models.OptimizationJobInputs":"Azure.AI.Projects.OptimizationJobInputs","com.azure.ai.agents.models.OptimizationJobProgress":"Azure.AI.Projects.OptimizationJobProgress","com.azure.ai.agents.models.OptimizationJobResult":"Azure.AI.Projects.OptimizationJobResult","com.azure.ai.agents.models.OptimizationOptions":"Azure.AI.Projects.OptimizationOptions","com.azure.ai.agents.models.OptimizationTaskResult":"Azure.AI.Projects.OptimizationTaskResult","com.azure.ai.agents.models.OtlpTelemetryEndpoint":"Azure.AI.Projects.OtlpTelemetryEndpoint","com.azure.ai.agents.models.PageOrder":"Azure.AI.Projects.PageOrder","com.azure.ai.agents.models.ProceduralMemoryItem":"Azure.AI.Projects.ProceduralMemoryItem","com.azure.ai.agents.models.PromoteCandidateInput":"Azure.AI.Projects.PromoteCandidateRequest","com.azure.ai.agents.models.PromoteCandidateResult":"Azure.AI.Projects.PromoteCandidateResponse","com.azure.ai.agents.models.PromotionInfo":"Azure.AI.Projects.PromotionInfo","com.azure.ai.agents.models.PromptAgentDefinition":"Azure.AI.Projects.PromptAgentDefinition","com.azure.ai.agents.models.PromptAgentDefinitionTextOptions":"Azure.AI.Projects.PromptAgentDefinitionTextOptions","com.azure.ai.agents.models.ProtocolVersionRecord":"Azure.AI.Projects.ProtocolVersionRecord","com.azure.ai.agents.models.RaiConfig":"Azure.AI.Projects.RaiConfig","com.azure.ai.agents.models.RankerVersionType":"RankerVersionTypeExpandable","com.azure.ai.agents.models.RankingOptions":"OpenAI.RankingOptions","com.azure.ai.agents.models.ResponseFormatJsonSchemaInner":"OpenAI.ResponseFormatJsonSchemaSchema","com.azure.ai.agents.models.ResponseUsageInputTokensDetails":"OpenAI.ResponseUsageInputTokensDetails","com.azure.ai.agents.models.ResponseUsageOutputTokensDetails":"OpenAI.ResponseUsageOutputTokensDetails","com.azure.ai.agents.models.SearchContextSize":"SearchContextSizeExpandable","com.azure.ai.agents.models.SessionDirectoryEntry":"Azure.AI.Projects.SessionDirectoryEntry","com.azure.ai.agents.models.SessionFileWriteResult":"Azure.AI.Projects.SessionFileWriteResponse","com.azure.ai.agents.models.SessionLogEvent":"Azure.AI.Projects.SessionLogEvent","com.azure.ai.agents.models.SessionLogEventType":"Azure.AI.Projects.SessionLogEventType","com.azure.ai.agents.models.SharepointGroundingToolCall":"Azure.AI.Projects.SharepointGroundingToolCall","com.azure.ai.agents.models.SharepointGroundingToolCallOutput":"Azure.AI.Projects.SharepointGroundingToolCallOutput","com.azure.ai.agents.models.SharepointGroundingToolParameters":"Azure.AI.Projects.SharepointGroundingToolParameters","com.azure.ai.agents.models.SharepointPreviewTool":"Azure.AI.Projects.SharepointPreviewTool","com.azure.ai.agents.models.SkillReferenceParameter":"OpenAI.SkillReferenceParam","com.azure.ai.agents.models.StructuredInputDefinition":"Azure.AI.Projects.StructuredInputDefinition","com.azure.ai.agents.models.StructuredOutputDefinition":"Azure.AI.Projects.StructuredOutputDefinition","com.azure.ai.agents.models.TelemetryConfig":"Azure.AI.Projects.TelemetryConfig","com.azure.ai.agents.models.TelemetryDataKind":"Azure.AI.Projects.TelemetryDataKind","com.azure.ai.agents.models.TelemetryEndpoint":"Azure.AI.Projects.TelemetryEndpoint","com.azure.ai.agents.models.TelemetryEndpointAuth":"Azure.AI.Projects.TelemetryEndpointAuth","com.azure.ai.agents.models.TelemetryEndpointAuthType":"Azure.AI.Projects.TelemetryEndpointAuthType","com.azure.ai.agents.models.TelemetryEndpointKind":"Azure.AI.Projects.TelemetryEndpointKind","com.azure.ai.agents.models.TelemetryTransportProtocol":"Azure.AI.Projects.TelemetryTransportProtocol","com.azure.ai.agents.models.TextResponseFormatConfiguration":"OpenAI.TextResponseFormatConfiguration","com.azure.ai.agents.models.TextResponseFormatConfigurationResponseFormatJsonObject":"OpenAI.TextResponseFormatConfigurationResponseFormatJsonObject","com.azure.ai.agents.models.TextResponseFormatConfigurationResponseFormatText":"OpenAI.TextResponseFormatConfigurationResponseFormatText","com.azure.ai.agents.models.TextResponseFormatConfigurationType":"OpenAI.TextResponseFormatConfigurationType","com.azure.ai.agents.models.TextResponseFormatJsonSchema":"OpenAI.TextResponseFormatJsonSchema","com.azure.ai.agents.models.Tool":"OpenAI.Tool","com.azure.ai.agents.models.ToolCallStatus":"Azure.AI.Projects.ToolCallStatus","com.azure.ai.agents.models.ToolConfig":"Azure.AI.Projects.ToolConfig","com.azure.ai.agents.models.ToolProjectConnection":"Azure.AI.Projects.ToolProjectConnection","com.azure.ai.agents.models.ToolType":"OpenAI.ToolType","com.azure.ai.agents.models.ToolboxDetails":"Azure.AI.Projects.ToolboxObject","com.azure.ai.agents.models.ToolboxPolicies":"Azure.AI.Projects.ToolboxPolicies","com.azure.ai.agents.models.ToolboxSearchPreviewTool":"Azure.AI.Projects.ToolboxSearchPreviewTool","com.azure.ai.agents.models.ToolboxSkill":"Azure.AI.Projects.ToolboxSkill","com.azure.ai.agents.models.ToolboxSkillReference":"Azure.AI.Projects.ToolboxSkillReference","com.azure.ai.agents.models.ToolboxVersionDetails":"Azure.AI.Projects.ToolboxVersionObject","com.azure.ai.agents.models.UpdateAgentDetailsOptions":"Azure.AI.Projects.patchAgentObject.Request.anonymous","com.azure.ai.agents.models.UserProfileMemoryItem":"Azure.AI.Projects.UserProfileMemoryItem","com.azure.ai.agents.models.VersionIndicator":"Azure.AI.Projects.VersionIndicator","com.azure.ai.agents.models.VersionIndicatorType":"Azure.AI.Projects.VersionIndicatorType","com.azure.ai.agents.models.VersionRefIndicator":"Azure.AI.Projects.VersionRefIndicator","com.azure.ai.agents.models.VersionSelectionRule":"Azure.AI.Projects.VersionSelectionRule","com.azure.ai.agents.models.VersionSelector":"Azure.AI.Projects.VersionSelector","com.azure.ai.agents.models.VersionSelectorType":"Azure.AI.Projects.VersionSelectorType","com.azure.ai.agents.models.WebSearchApproximateLocation":"OpenAI.WebSearchApproximateLocation","com.azure.ai.agents.models.WebSearchConfiguration":"Azure.AI.Projects.WebSearchConfiguration","com.azure.ai.agents.models.WebSearchPreviewTool":"OpenAI.WebSearchPreviewTool","com.azure.ai.agents.models.WebSearchTool":"OpenAI.WebSearchTool","com.azure.ai.agents.models.WebSearchToolFilters":"OpenAI.WebSearchToolFilters","com.azure.ai.agents.models.WebSearchToolSearchContextSize":"WebSearchToolSearchContextSizeExpandable","com.azure.ai.agents.models.WorkIqPreviewTool":"Azure.AI.Projects.WorkIQPreviewTool","com.azure.ai.agents.models.WorkflowAgentDefinition":"Azure.AI.Projects.WorkflowAgentDefinition"},"generatedFiles":["src/main/java/com/azure/ai/agents/AgentSessionFilesAsyncClient.java","src/main/java/com/azure/ai/agents/AgentSessionFilesClient.java","src/main/java/com/azure/ai/agents/AgentsAsyncClient.java","src/main/java/com/azure/ai/agents/AgentsClient.java","src/main/java/com/azure/ai/agents/AgentsClientBuilder.java","src/main/java/com/azure/ai/agents/AgentsServiceVersion.java","src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java","src/main/java/com/azure/ai/agents/MemoryStoresClient.java","src/main/java/com/azure/ai/agents/ToolboxesAsyncClient.java","src/main/java/com/azure/ai/agents/ToolboxesClient.java","src/main/java/com/azure/ai/agents/implementation/AgentSessionFilesImpl.java","src/main/java/com/azure/ai/agents/implementation/AgentsClientImpl.java","src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java","src/main/java/com/azure/ai/agents/implementation/JsonMergePatchHelper.java","src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java","src/main/java/com/azure/ai/agents/implementation/MultipartFormDataHelper.java","src/main/java/com/azure/ai/agents/implementation/OperationLocationPollingStrategy.java","src/main/java/com/azure/ai/agents/implementation/PollingUtils.java","src/main/java/com/azure/ai/agents/implementation/SyncOperationLocationPollingStrategy.java","src/main/java/com/azure/ai/agents/implementation/ToolboxesImpl.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentFromCodeContent.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentFromManifestRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentOptions.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionFromManifestRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryStoreRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateSessionRequest.java","src/main/java/com/azure/ai/agents/implementation/models/CreateToolboxVersionRequest.java","src/main/java/com/azure/ai/agents/implementation/models/ListMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentFromManifestRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoryRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoryStoreRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateToolboxInput.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateToolboxRequest.java","src/main/java/com/azure/ai/agents/implementation/models/package-info.java","src/main/java/com/azure/ai/agents/implementation/package-info.java","src/main/java/com/azure/ai/agents/models/A2APreviewTool.java","src/main/java/com/azure/ai/agents/models/A2AToolCall.java","src/main/java/com/azure/ai/agents/models/A2AToolCallOutput.java","src/main/java/com/azure/ai/agents/models/AISearchIndexResource.java","src/main/java/com/azure/ai/agents/models/AgentBlueprintReference.java","src/main/java/com/azure/ai/agents/models/AgentBlueprintReferenceType.java","src/main/java/com/azure/ai/agents/models/AgentCard.java","src/main/java/com/azure/ai/agents/models/AgentCardSkill.java","src/main/java/com/azure/ai/agents/models/AgentDefinition.java","src/main/java/com/azure/ai/agents/models/AgentDefinitionOptInKeys.java","src/main/java/com/azure/ai/agents/models/AgentDetails.java","src/main/java/com/azure/ai/agents/models/AgentDetailsVersions.java","src/main/java/com/azure/ai/agents/models/AgentEndpointAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/AgentEndpointAuthorizationSchemeType.java","src/main/java/com/azure/ai/agents/models/AgentEndpointConfig.java","src/main/java/com/azure/ai/agents/models/AgentEndpointProtocol.java","src/main/java/com/azure/ai/agents/models/AgentIdentifier.java","src/main/java/com/azure/ai/agents/models/AgentIdentity.java","src/main/java/com/azure/ai/agents/models/AgentKind.java","src/main/java/com/azure/ai/agents/models/AgentObjectType.java","src/main/java/com/azure/ai/agents/models/AgentProtocol.java","src/main/java/com/azure/ai/agents/models/AgentReference.java","src/main/java/com/azure/ai/agents/models/AgentSessionResource.java","src/main/java/com/azure/ai/agents/models/AgentSessionStatus.java","src/main/java/com/azure/ai/agents/models/AgentVersionDetails.java","src/main/java/com/azure/ai/agents/models/AgentVersionStatus.java","src/main/java/com/azure/ai/agents/models/ApiError.java","src/main/java/com/azure/ai/agents/models/ApplyPatchToolParameter.java","src/main/java/com/azure/ai/agents/models/ApproximateLocation.java","src/main/java/com/azure/ai/agents/models/AutoCodeInterpreterToolParameter.java","src/main/java/com/azure/ai/agents/models/AzureAISearchQueryType.java","src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java","src/main/java/com/azure/ai/agents/models/AzureAISearchToolCall.java","src/main/java/com/azure/ai/agents/models/AzureAISearchToolCallOutput.java","src/main/java/com/azure/ai/agents/models/AzureAISearchToolResource.java","src/main/java/com/azure/ai/agents/models/AzureCreateResponseDetails.java","src/main/java/com/azure/ai/agents/models/AzureCreateResponseOptions.java","src/main/java/com/azure/ai/agents/models/AzureFunctionBinding.java","src/main/java/com/azure/ai/agents/models/AzureFunctionDefinition.java","src/main/java/com/azure/ai/agents/models/AzureFunctionDefinitionDetails.java","src/main/java/com/azure/ai/agents/models/AzureFunctionStorageQueue.java","src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java","src/main/java/com/azure/ai/agents/models/AzureFunctionToolCall.java","src/main/java/com/azure/ai/agents/models/AzureFunctionToolCallOutput.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCall.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchToolCallOutput.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java","src/main/java/com/azure/ai/agents/models/BingGroundingSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/BingGroundingSearchToolParameters.java","src/main/java/com/azure/ai/agents/models/BingGroundingTool.java","src/main/java/com/azure/ai/agents/models/BingGroundingToolCall.java","src/main/java/com/azure/ai/agents/models/BingGroundingToolCallOutput.java","src/main/java/com/azure/ai/agents/models/BotServiceAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/BotServiceRbacAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCall.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationToolCallOutput.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationToolConnectionParameters.java","src/main/java/com/azure/ai/agents/models/BrowserAutomationToolParameters.java","src/main/java/com/azure/ai/agents/models/CandidateDeployConfig.java","src/main/java/com/azure/ai/agents/models/CandidateFileInfo.java","src/main/java/com/azure/ai/agents/models/CandidateMetadata.java","src/main/java/com/azure/ai/agents/models/CandidateResults.java","src/main/java/com/azure/ai/agents/models/CaptureStructuredOutputsTool.java","src/main/java/com/azure/ai/agents/models/ChatSummaryMemoryItem.java","src/main/java/com/azure/ai/agents/models/CodeConfiguration.java","src/main/java/com/azure/ai/agents/models/CodeDependencyResolution.java","src/main/java/com/azure/ai/agents/models/CodeFileDetails.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java","src/main/java/com/azure/ai/agents/models/ComputerEnvironment.java","src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java","src/main/java/com/azure/ai/agents/models/ContainerAutoParameter.java","src/main/java/com/azure/ai/agents/models/ContainerConfiguration.java","src/main/java/com/azure/ai/agents/models/ContainerMemoryLimit.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyAllowlistParameter.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyDisabledParameter.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyDomainSecretParameter.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyParamType.java","src/main/java/com/azure/ai/agents/models/ContainerNetworkPolicyParameter.java","src/main/java/com/azure/ai/agents/models/ContainerSkill.java","src/main/java/com/azure/ai/agents/models/ContainerSkillType.java","src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeContent.java","src/main/java/com/azure/ai/agents/models/CreateAgentVersionFromCodeMetadata.java","src/main/java/com/azure/ai/agents/models/CreateAgentVersionInput.java","src/main/java/com/azure/ai/agents/models/CustomGrammarFormatParameter.java","src/main/java/com/azure/ai/agents/models/CustomTextFormatParameter.java","src/main/java/com/azure/ai/agents/models/CustomToolParamFormat.java","src/main/java/com/azure/ai/agents/models/CustomToolParamFormatType.java","src/main/java/com/azure/ai/agents/models/CustomToolParameter.java","src/main/java/com/azure/ai/agents/models/DatasetInfo.java","src/main/java/com/azure/ai/agents/models/DatasetRef.java","src/main/java/com/azure/ai/agents/models/EntraAuthorizationScheme.java","src/main/java/com/azure/ai/agents/models/EntraIsolationKeySource.java","src/main/java/com/azure/ai/agents/models/EvaluationLevel.java","src/main/java/com/azure/ai/agents/models/ExternalAgentDefinition.java","src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCall.java","src/main/java/com/azure/ai/agents/models/FabricDataAgentToolCallOutput.java","src/main/java/com/azure/ai/agents/models/FabricDataAgentToolParameters.java","src/main/java/com/azure/ai/agents/models/FabricIqPreviewTool.java","src/main/java/com/azure/ai/agents/models/FileSearchTool.java","src/main/java/com/azure/ai/agents/models/FixedRatioVersionSelectionRule.java","src/main/java/com/azure/ai/agents/models/FoundryFeaturesOptInKeys.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParamEnvironment.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParamEnvironmentType.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParameter.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParameterEnvironmentContainerReferenceParameter.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParameterEnvironmentLocalEnvironmentParameter.java","src/main/java/com/azure/ai/agents/models/FunctionTool.java","src/main/java/com/azure/ai/agents/models/GrammarSyntax.java","src/main/java/com/azure/ai/agents/models/HeaderIsolationKeySource.java","src/main/java/com/azure/ai/agents/models/HeaderTelemetryEndpointAuth.java","src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java","src/main/java/com/azure/ai/agents/models/HybridSearchOptions.java","src/main/java/com/azure/ai/agents/models/ImageGenActionEnum.java","src/main/java/com/azure/ai/agents/models/ImageGenTool.java","src/main/java/com/azure/ai/agents/models/ImageGenToolBackground.java","src/main/java/com/azure/ai/agents/models/ImageGenToolInputImageMask.java","src/main/java/com/azure/ai/agents/models/ImageGenToolModel.java","src/main/java/com/azure/ai/agents/models/ImageGenToolModeration.java","src/main/java/com/azure/ai/agents/models/ImageGenToolOutputFormat.java","src/main/java/com/azure/ai/agents/models/ImageGenToolQuality.java","src/main/java/com/azure/ai/agents/models/ImageGenToolSize.java","src/main/java/com/azure/ai/agents/models/IncludeEnum.java","src/main/java/com/azure/ai/agents/models/InlineSkillParameter.java","src/main/java/com/azure/ai/agents/models/InlineSkillSourceParameter.java","src/main/java/com/azure/ai/agents/models/InputFidelity.java","src/main/java/com/azure/ai/agents/models/IsolationKeySource.java","src/main/java/com/azure/ai/agents/models/IsolationKeySourceKind.java","src/main/java/com/azure/ai/agents/models/JobStatus.java","src/main/java/com/azure/ai/agents/models/ListMemoriesOptions.java","src/main/java/com/azure/ai/agents/models/LocalShellToolParameter.java","src/main/java/com/azure/ai/agents/models/LocalSkillParameter.java","src/main/java/com/azure/ai/agents/models/ManagedAgentIdentityBlueprintReference.java","src/main/java/com/azure/ai/agents/models/McpTool.java","src/main/java/com/azure/ai/agents/models/McpToolConnectorId.java","src/main/java/com/azure/ai/agents/models/McpToolFilter.java","src/main/java/com/azure/ai/agents/models/McpToolRequireApproval.java","src/main/java/com/azure/ai/agents/models/MemoryCommandToolCall.java","src/main/java/com/azure/ai/agents/models/MemoryCommandToolCallOutput.java","src/main/java/com/azure/ai/agents/models/MemoryItem.java","src/main/java/com/azure/ai/agents/models/MemoryItemKind.java","src/main/java/com/azure/ai/agents/models/MemoryOperation.java","src/main/java/com/azure/ai/agents/models/MemoryOperationKind.java","src/main/java/com/azure/ai/agents/models/MemorySearchItem.java","src/main/java/com/azure/ai/agents/models/MemorySearchOptions.java","src/main/java/com/azure/ai/agents/models/MemorySearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/MemorySearchToolCall.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultDefinition.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDefaultOptions.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDefinition.java","src/main/java/com/azure/ai/agents/models/MemoryStoreDetails.java","src/main/java/com/azure/ai/agents/models/MemoryStoreKind.java","src/main/java/com/azure/ai/agents/models/MemoryStoreObjectType.java","src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsage.java","src/main/java/com/azure/ai/agents/models/MemoryStoreSearchResponse.java","src/main/java/com/azure/ai/agents/models/MemoryStoreUpdateCompletedResult.java","src/main/java/com/azure/ai/agents/models/MemoryStoreUpdateResponse.java","src/main/java/com/azure/ai/agents/models/MemoryStoreUpdateStatus.java","src/main/java/com/azure/ai/agents/models/MicrosoftFabricPreviewTool.java","src/main/java/com/azure/ai/agents/models/OpenApiAnonymousAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiAuthType.java","src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinition.java","src/main/java/com/azure/ai/agents/models/OpenApiFunctionDefinitionFunction.java","src/main/java/com/azure/ai/agents/models/OpenApiManagedAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiManagedSecurityScheme.java","src/main/java/com/azure/ai/agents/models/OpenApiProjectConnectionAuthDetails.java","src/main/java/com/azure/ai/agents/models/OpenApiProjectConnectionSecurityScheme.java","src/main/java/com/azure/ai/agents/models/OpenApiTool.java","src/main/java/com/azure/ai/agents/models/OpenApiToolCall.java","src/main/java/com/azure/ai/agents/models/OpenApiToolCallOutput.java","src/main/java/com/azure/ai/agents/models/OptimizationAgentDefinition.java","src/main/java/com/azure/ai/agents/models/OptimizationCandidate.java","src/main/java/com/azure/ai/agents/models/OptimizationCandidatePagedResult.java","src/main/java/com/azure/ai/agents/models/OptimizationJob.java","src/main/java/com/azure/ai/agents/models/OptimizationJobInputs.java","src/main/java/com/azure/ai/agents/models/OptimizationJobProgress.java","src/main/java/com/azure/ai/agents/models/OptimizationJobResult.java","src/main/java/com/azure/ai/agents/models/OptimizationOptions.java","src/main/java/com/azure/ai/agents/models/OptimizationTaskResult.java","src/main/java/com/azure/ai/agents/models/OtlpTelemetryEndpoint.java","src/main/java/com/azure/ai/agents/models/PageOrder.java","src/main/java/com/azure/ai/agents/models/ProceduralMemoryItem.java","src/main/java/com/azure/ai/agents/models/PromoteCandidateInput.java","src/main/java/com/azure/ai/agents/models/PromoteCandidateResult.java","src/main/java/com/azure/ai/agents/models/PromotionInfo.java","src/main/java/com/azure/ai/agents/models/PromptAgentDefinition.java","src/main/java/com/azure/ai/agents/models/PromptAgentDefinitionTextOptions.java","src/main/java/com/azure/ai/agents/models/ProtocolVersionRecord.java","src/main/java/com/azure/ai/agents/models/RaiConfig.java","src/main/java/com/azure/ai/agents/models/RankerVersionType.java","src/main/java/com/azure/ai/agents/models/RankingOptions.java","src/main/java/com/azure/ai/agents/models/ResponseFormatJsonSchemaInner.java","src/main/java/com/azure/ai/agents/models/ResponseUsageInputTokensDetails.java","src/main/java/com/azure/ai/agents/models/ResponseUsageOutputTokensDetails.java","src/main/java/com/azure/ai/agents/models/SearchContextSize.java","src/main/java/com/azure/ai/agents/models/SessionDirectoryEntry.java","src/main/java/com/azure/ai/agents/models/SessionFileWriteResult.java","src/main/java/com/azure/ai/agents/models/SessionLogEvent.java","src/main/java/com/azure/ai/agents/models/SessionLogEventType.java","src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCall.java","src/main/java/com/azure/ai/agents/models/SharepointGroundingToolCallOutput.java","src/main/java/com/azure/ai/agents/models/SharepointGroundingToolParameters.java","src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java","src/main/java/com/azure/ai/agents/models/SkillReferenceParameter.java","src/main/java/com/azure/ai/agents/models/StructuredInputDefinition.java","src/main/java/com/azure/ai/agents/models/StructuredOutputDefinition.java","src/main/java/com/azure/ai/agents/models/TelemetryConfig.java","src/main/java/com/azure/ai/agents/models/TelemetryDataKind.java","src/main/java/com/azure/ai/agents/models/TelemetryEndpoint.java","src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuth.java","src/main/java/com/azure/ai/agents/models/TelemetryEndpointAuthType.java","src/main/java/com/azure/ai/agents/models/TelemetryEndpointKind.java","src/main/java/com/azure/ai/agents/models/TelemetryTransportProtocol.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfiguration.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatJsonObject.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatText.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationType.java","src/main/java/com/azure/ai/agents/models/TextResponseFormatJsonSchema.java","src/main/java/com/azure/ai/agents/models/Tool.java","src/main/java/com/azure/ai/agents/models/ToolCallStatus.java","src/main/java/com/azure/ai/agents/models/ToolConfig.java","src/main/java/com/azure/ai/agents/models/ToolProjectConnection.java","src/main/java/com/azure/ai/agents/models/ToolType.java","src/main/java/com/azure/ai/agents/models/ToolboxDetails.java","src/main/java/com/azure/ai/agents/models/ToolboxPolicies.java","src/main/java/com/azure/ai/agents/models/ToolboxSearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/ToolboxSkill.java","src/main/java/com/azure/ai/agents/models/ToolboxSkillReference.java","src/main/java/com/azure/ai/agents/models/ToolboxVersionDetails.java","src/main/java/com/azure/ai/agents/models/UpdateAgentDetailsOptions.java","src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java","src/main/java/com/azure/ai/agents/models/VersionIndicator.java","src/main/java/com/azure/ai/agents/models/VersionIndicatorType.java","src/main/java/com/azure/ai/agents/models/VersionRefIndicator.java","src/main/java/com/azure/ai/agents/models/VersionSelectionRule.java","src/main/java/com/azure/ai/agents/models/VersionSelector.java","src/main/java/com/azure/ai/agents/models/VersionSelectorType.java","src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java","src/main/java/com/azure/ai/agents/models/WebSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/WebSearchTool.java","src/main/java/com/azure/ai/agents/models/WebSearchToolFilters.java","src/main/java/com/azure/ai/agents/models/WebSearchToolSearchContextSize.java","src/main/java/com/azure/ai/agents/models/WorkIqPreviewTool.java","src/main/java/com/azure/ai/agents/models/WorkflowAgentDefinition.java","src/main/java/com/azure/ai/agents/models/package-info.java","src/main/java/com/azure/ai/agents/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/AgentEndpointAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/AgentEndpointAsyncSample.java new file mode 100644 index 000000000000..fb7512b7bfc9 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/AgentEndpointAsyncSample.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentEndpointConfig; +import com.azure.ai.agents.models.AgentEndpointProtocol; +import com.azure.ai.agents.models.FixedRatioVersionSelectionRule; +import com.azure.ai.agents.models.UpdateAgentDetailsOptions; +import com.azure.ai.agents.models.VersionSelector; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.client.OpenAIClientAsync; +import com.openai.core.JsonValue; +import com.openai.models.responses.ResponseCreateParams; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.Collections; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This sample demonstrates configuring a hosted agent endpoint and invoking it using the async OpenAI client. + * + *

Agent endpoints and sessions are currently preview features and only work with hosted agents.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class AgentEndpointAsyncSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + AtomicReference resourcesRef = new AtomicReference<>(); + + Mono workflow = HostedAgentsSampleUtils.createAgentAndSessionAsync(agentsAsyncClient, agentName, image) + .flatMap(resources -> { + resourcesRef.set(resources); + + AgentEndpointConfig endpointConfig = new AgentEndpointConfig() + .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList( + new FixedRatioVersionSelectionRule(100) + .setAgentVersion(resources.getAgent().getVersion())))) + .setProtocols(Collections.singletonList(AgentEndpointProtocol.RESPONSES)); + + OpenAIClientAsync openAIAsyncClient = builder.buildAgentScopedOpenAIAsyncClient(agentName); + + return agentsAsyncClient.updateAgentDetails(agentName, + new UpdateAgentDetailsOptions().setAgentEndpoint(endpointConfig), + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW) + .doOnNext(updated -> System.out.printf("Agent endpoint configured for agent: %s%n", + updated.getName())) + .then(Mono.fromFuture(openAIAsyncClient.responses().create(ResponseCreateParams.builder() + .input("What is the size of France in square miles?") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()))) + .doOnNext(HostedAgentsSampleUtils::printResponseOutput) + .then(); + }); + + workflow + .onErrorResume(error -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()).then(Mono.error(error))) + .then(Mono.defer(() -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()))) + .timeout(Duration.ofMinutes(15)) + .block(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/AgentEndpointSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/AgentEndpointSample.java new file mode 100644 index 000000000000..69c2030e6f05 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/AgentEndpointSample.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentEndpointConfig; +import com.azure.ai.agents.models.AgentEndpointProtocol; +import com.azure.ai.agents.models.FixedRatioVersionSelectionRule; +import com.azure.ai.agents.models.UpdateAgentDetailsOptions; +import com.azure.ai.agents.models.VersionSelector; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.client.OpenAIClient; +import com.openai.core.JsonValue; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; + +import java.util.Collections; + +/** + * This sample demonstrates configuring a hosted agent endpoint and invoking the OpenAI Responses API through it. + * + *

Agent endpoints and sessions are currently preview features and only work with hosted agents.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class AgentEndpointSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsClient agentsClient = builder.buildAgentsClient(); + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + + AgentEndpointConfig endpointConfig = new AgentEndpointConfig() + .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList( + new FixedRatioVersionSelectionRule(100) + .setAgentVersion(resources.getAgent().getVersion())))) + .setProtocols(Collections.singletonList(AgentEndpointProtocol.RESPONSES)); + + agentsClient.updateAgentDetails(agentName, + new UpdateAgentDetailsOptions().setAgentEndpoint(endpointConfig), + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW); + System.out.printf("Agent endpoint configured for agent: %s%n", agentName); + + OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agentName); + Response response = openAIClient.responses().create(ResponseCreateParams.builder() + .input("What is the size of France in square miles?") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()); + + HostedAgentsSampleUtils.printResponseOutput(response); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentAsyncSample.java new file mode 100644 index 000000000000..facac1250f23 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentAsyncSample.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; +import reactor.core.scheduler.Schedulers; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Duration; + +/** + * This sample demonstrates creating and downloading a code-based hosted agent using the asynchronous AgentsAsyncClient. + * + *

Code-based hosted agents are a preview feature. Before running, set {@code FOUNDRY_PROJECT_ENDPOINT} to your + * Azure AI Foundry project endpoint.

+ */ +public class CodeAgentAsyncSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String agentName = CodeAgentSampleUtils.SAMPLE_AGENT_NAME; + + AgentsAsyncClient agentsAsyncClient = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint) + .buildAgentsAsyncClient(); + + Mono workflow = agentsAsyncClient.deleteAgent(agentName) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(Mono.fromCallable(CodeAgentSampleUtils::createCodeZip).subscribeOn(Schedulers.boundedElastic())) + .flatMap(codeZip -> { + String codeZipSha256 = CodeAgentSampleUtils.sha256(codeZip); + + // BEGIN: com.azure.ai.agents.hostedagents.CodeAgentAsyncSample.createAgentVersionFromCode_initial + + return agentsAsyncClient.createAgentVersionFromCode( + agentName, + codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW) + .doOnNext(version -> { + System.out.printf("Created code-based agent: %s%n", version.getName()); + CodeAgentSampleUtils.printLatestVersion(version); + }) + + // END: com.azure.ai.agents.hostedagents.CodeAgentAsyncSample.createAgentVersionFromCode_initial + + // BEGIN: com.azure.ai.agents.hostedagents.CodeAgentAsyncSample.downloadAgentCode + + .then(agentsAsyncClient.downloadAgentCode(agentName, + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW, null)) + .flatMap(downloadedCode -> writeDownloadedCode(agentName, downloadedCode)) + + // END: com.azure.ai.agents.hostedagents.CodeAgentAsyncSample.downloadAgentCode + + // BEGIN: com.azure.ai.agents.hostedagents.CodeAgentAsyncSample.createAgentVersionFromCode + + .then(agentsAsyncClient.createAgentVersionFromCode( + agentName, + codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW)) + .doOnNext(newVersion -> { + System.out.printf("Created code-based agent version: %s%n", newVersion.getVersion()); + CodeAgentSampleUtils.printLatestVersion(newVersion); + }) + .then(); + + // END: com.azure.ai.agents.hostedagents.CodeAgentAsyncSample.createAgentVersionFromCode + }); + + workflow + .onErrorResume(error -> agentsAsyncClient.deleteAgent(agentName) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(Mono.error(error))) + .then(agentsAsyncClient.deleteAgent(agentName) + .doOnSuccess(unused -> System.out.printf("Deleted code-based agent: %s%n", agentName)) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty())) + .timeout(Duration.ofMinutes(15)) + .block(); + } + + private static Mono writeDownloadedCode(String agentName, BinaryData downloadedCode) { + return Mono.fromCallable(() -> { + Path downloadPath = Files.createTempFile(agentName + "-", ".zip"); + Files.write(downloadPath, downloadedCode.toBytes()); + System.out.println("Downloaded code package path: " + downloadPath); + return downloadPath; + }).subscribeOn(Schedulers.boundedElastic()); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentSample.java new file mode 100644 index 000000000000..3ec16591718d --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentSample.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +/** + * This sample demonstrates creating and downloading a code-based hosted agent using the synchronous AgentsClient. + * + *

Code-based hosted agents are a preview feature. Before running, set {@code FOUNDRY_PROJECT_ENDPOINT} to your + * Azure AI Foundry project endpoint.

+ */ +public class CodeAgentSample { + public static void main(String[] args) throws IOException { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String agentName = CodeAgentSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClient agentsClient = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint) + .buildAgentsClient(); + + try { + agentsClient.deleteAgent(agentName); + } catch (ResourceNotFoundException ignored) { + // The sample agent does not already exist. + } + + try { + // BEGIN: com.azure.ai.agents.hostedagents.CodeAgentSample.createAgentVersionFromCode_initial + + BinaryData codeZip = CodeAgentSampleUtils.createCodeZip(); + String codeZipSha256 = CodeAgentSampleUtils.sha256(codeZip); + + AgentVersionDetails version = agentsClient.createAgentVersionFromCode( + agentName, + codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW); + + System.out.printf("Created code-based agent: %s%n", version.getName()); + CodeAgentSampleUtils.printLatestVersion(version); + + // END: com.azure.ai.agents.hostedagents.CodeAgentSample.createAgentVersionFromCode_initial + + // BEGIN: com.azure.ai.agents.hostedagents.CodeAgentSample.downloadAgentCode + + BinaryData downloadedCode = agentsClient.downloadAgentCode(agentName, + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW, null); + Path downloadPath = Files.createTempFile(agentName + "-", ".zip"); + Files.write(downloadPath, downloadedCode.toBytes()); + System.out.println("Downloaded code package path: " + downloadPath); + + // END: com.azure.ai.agents.hostedagents.CodeAgentSample.downloadAgentCode + + // BEGIN: com.azure.ai.agents.hostedagents.CodeAgentSample.createAgentVersionFromCode + + AgentVersionDetails newVersion = agentsClient.createAgentVersionFromCode( + agentName, + codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW); + + System.out.printf("Created code-based agent version: %s%n", newVersion.getVersion()); + CodeAgentSampleUtils.printLatestVersion(newVersion); + + // END: com.azure.ai.agents.hostedagents.CodeAgentSample.createAgentVersionFromCode + } finally { + try { + agentsClient.deleteAgent(agentName); + System.out.printf("Deleted code-based agent: %s%n", agentName); + } catch (ResourceNotFoundException ignored) { + // The sample agent may not have been created. + } + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentSampleUtils.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentSampleUtils.java new file mode 100644 index 000000000000..a0a685d947eb --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/CodeAgentSampleUtils.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.models.AgentProtocol; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.CodeConfiguration; +import com.azure.ai.agents.models.CodeDependencyResolution; +import com.azure.ai.agents.models.CodeFileDetails; +import com.azure.ai.agents.models.CreateAgentVersionFromCodeContent; +import com.azure.ai.agents.models.CreateAgentVersionFromCodeMetadata; +import com.azure.ai.agents.models.HostedAgentDefinition; +import com.azure.ai.agents.models.ProtocolVersionRecord; +import com.azure.core.util.BinaryData; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +final class CodeAgentSampleUtils { + static final String SAMPLE_AGENT_NAME = "java-code-agent-sample"; + + private CodeAgentSampleUtils() { + } + + static CreateAgentVersionFromCodeContent createAgentVersionFromCodeContent(BinaryData codeZip) { + return new CreateAgentVersionFromCodeContent(createMetadata(), createCodeFileDetails(codeZip)); + } + + static BinaryData createCodeZip() throws IOException { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { + addZipEntry(zipOutputStream, "main.py", createMainPy()); + addZipEntry(zipOutputStream, "requirements.txt", createRequirementsTxt()); + } + return BinaryData.fromBytes(outputStream.toByteArray()); + } + + static String sha256(BinaryData data) { + try { + MessageDigest digest = MessageDigest.getInstance("SHA-256"); + byte[] hash = digest.digest(data.toBytes()); + StringBuilder builder = new StringBuilder(hash.length * 2); + for (byte value : hash) { + builder.append(String.format("%02x", value)); + } + return builder.toString(); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException("SHA-256 is not available.", e); + } + } + + static void printLatestVersion(AgentVersionDetails version) { + System.out.printf("Agent version: %s%n", version.getVersion()); + System.out.printf("Status: %s%n", version.getStatus()); + if (version.getDefinition() instanceof HostedAgentDefinition) { + HostedAgentDefinition definition = (HostedAgentDefinition) version.getDefinition(); + if (definition.getCodeConfiguration() != null) { + System.out.printf("Code content hash: %s%n", definition.getCodeConfiguration().getContentSha256()); + } + } + } + + private static CreateAgentVersionFromCodeMetadata createMetadata() { + Map metadata = new HashMap<>(); + metadata.put("sample", "code-agent"); + + return new CreateAgentVersionFromCodeMetadata(createHostedAgentDefinition()) + .setDescription("Code-based hosted agent sample created by the Azure AI Agents Java SDK.") + .setMetadata(metadata); + } + + private static HostedAgentDefinition createHostedAgentDefinition() { + return new HostedAgentDefinition("0.5", "1Gi") + .setCodeConfiguration(new CodeConfiguration( + "python_3_11", + Arrays.asList("python", "main.py"), + CodeDependencyResolution.REMOTE_BUILD)) + .setProtocolVersions(Collections.singletonList( + new ProtocolVersionRecord(AgentProtocol.RESPONSES, "1.0.0"))); + } + + private static CodeFileDetails createCodeFileDetails(BinaryData codeZip) { + return new CodeFileDetails(codeZip) + .setFilename("responses-echo-agent.zip") + .setContentType("application/zip"); + } + + private static void addZipEntry(ZipOutputStream zipOutputStream, String name, String content) throws IOException { + zipOutputStream.putNextEntry(new ZipEntry(name)); + zipOutputStream.write(content.getBytes(StandardCharsets.UTF_8)); + zipOutputStream.closeEntry(); + } + + private static String createMainPy() { + return "import asyncio\n" + + "import logging\n\n" + + "from azure.ai.agentserver.responses import (\n" + + " CreateResponse,\n" + + " ResponseContext,\n" + + " ResponsesAgentServerHost,\n" + + " TextResponse,\n" + + ")\n\n" + + "logging.basicConfig(level=logging.INFO)\n" + + "logger = logging.getLogger(__name__)\n" + + "app = ResponsesAgentServerHost()\n\n" + + "@app.create_handler\n" + + "async def handler(request: CreateResponse, context: ResponseContext, " + + "cancellation_signal: asyncio.Event):\n" + + " input_text = await context.get_input_text()\n" + + " logger.info('Received input: %s', input_text)\n" + + " return TextResponse(context, request, text=f'Echo: {input_text}')\n\n" + + "def main() -> None:\n" + + " app.run()\n\n" + + "if __name__ == '__main__':\n" + + " main()\n"; + } + + private static String createRequirementsTxt() { + return "--index-url https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/\n" + + "azure-ai-agentserver-core==2.0.0a20260410006\n" + + "azure-ai-agentserver-invocations==1.0.0a20260410006\n" + + "azure-ai-agentserver-responses==1.0.0a20260410006\n"; + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java new file mode 100644 index 000000000000..f1d98cfc75da --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/HostedAgentsSampleUtils.java @@ -0,0 +1,285 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentProtocol; +import com.azure.ai.agents.models.AgentSessionResource; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AgentVersionStatus; +import com.azure.ai.agents.models.ContainerConfiguration; +import com.azure.ai.agents.models.CreateAgentVersionInput; +import com.azure.ai.agents.models.HostedAgentDefinition; +import com.azure.ai.agents.models.ProtocolVersionRecord; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseOutputItem; +import com.openai.models.responses.ResponseOutputMessage; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +final class HostedAgentsSampleUtils { + static final String SAMPLE_AGENT_NAME = "java-hosted-agent-sample"; + + private static final int MAX_POLL_ATTEMPTS = 60; + private static final Duration POLL_INTERVAL = Duration.ofSeconds(10); + private static final String FOUNDRY_FEATURES_HEADER_VALUE = AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW + + "," + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW; + + private HostedAgentsSampleUtils() { + } + + static HostedAgentSessionResources createAgentAndSession(AgentsClient agentsClient, String agentName, + String image) { + AgentVersionDetails agent = createHostedAgentVersion(agentsClient, agentName, image); + waitForAgentVersionActive(agentsClient, agentName, agent.getVersion()); + + AgentSessionResource session = agentsClient.createSessionWithResponse(agentName, + BinaryData.fromObject(createSessionRequest(agent.getVersion())), foundryFeaturesRequestOptions()).getValue() + .toObject(AgentSessionResource.class); + System.out.printf("Session created (id: %s, status: %s)%n", session.getAgentSessionId(), session.getStatus()); + + return new HostedAgentSessionResources(agent, session); + } + + static Mono createAgentAndSessionAsync(AgentsAsyncClient agentsAsyncClient, + String agentName, String image) { + return createHostedAgentVersionAsync(agentsAsyncClient, agentName, image) + .flatMap(agent -> waitForAgentVersionActiveAsync(agentsAsyncClient, agentName, agent.getVersion()) + .then(agentsAsyncClient.createSessionWithResponse(agentName, + BinaryData.fromObject(createSessionRequest(agent.getVersion())), foundryFeaturesRequestOptions()) + .map(response -> response.getValue().toObject(AgentSessionResource.class))) + .map(session -> { + System.out.printf("Session created (id: %s, status: %s)%n", session.getAgentSessionId(), + session.getStatus()); + return new HostedAgentSessionResources(agent, session); + })); + } + + static void cleanup(AgentsClient agentsClient, String agentName, HostedAgentSessionResources resources) { + if (resources == null) { + return; + } + + if (resources.getSession() != null) { + try { + agentsClient.deleteSession(agentName, resources.getSession().getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + System.out.printf("Session with id: %s deleted.%n", resources.getSession().getAgentSessionId()); + } catch (ResourceNotFoundException ignored) { + // The sample may have already deleted the session. + } + } + + if (resources.getAgent() != null) { + try { + agentsClient.deleteAgentVersion(agentName, resources.getAgent().getVersion()); + System.out.printf("Agent version %s deleted.%n", resources.getAgent().getVersion()); + } catch (ResourceNotFoundException ignored) { + // The sample may have already deleted the agent version. + } + } + } + + static Mono cleanupAsync(AgentsAsyncClient agentsAsyncClient, String agentName, + HostedAgentSessionResources resources) { + if (resources == null) { + return Mono.empty(); + } + + Mono deleteSession = Mono.empty(); + if (resources.getSession() != null) { + String sessionId = resources.getSession().getAgentSessionId(); + deleteSession = agentsAsyncClient.deleteSession(agentName, sessionId, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null) + .doOnSuccess(unused -> System.out.printf("Session with id: %s deleted.%n", sessionId)) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()); + } + + Mono deleteAgentVersion = Mono.empty(); + if (resources.getAgent() != null) { + String version = resources.getAgent().getVersion(); + deleteAgentVersion = agentsAsyncClient.deleteAgentVersion(agentName, version) + .doOnSuccess(unused -> System.out.printf("Agent version %s deleted.%n", version)) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()); + } + + return deleteSession.then(deleteAgentVersion); + } + + static void printResponseOutput(Response response) { + for (ResponseOutputItem outputItem : response.output()) { + if (outputItem.message().isPresent()) { + ResponseOutputMessage message = outputItem.message().get(); + message.content().forEach(content -> content.outputText() + .ifPresent(text -> System.out.println("Response output: " + text.text()))); + } + } + } + + static void printSseFrames(BinaryData streamData, int maxLogEvents) throws IOException { + int eventCount = 0; + String eventName = null; + StringBuilder data = new StringBuilder(); + + try (InputStream stream = streamData.toStream(); + BufferedReader reader = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8))) { + String line; + while (eventCount < maxLogEvents && (line = reader.readLine()) != null) { + if (line.isEmpty()) { + if (eventName != null || data.length() > 0) { + eventCount++; + System.out.println("SSE event: " + eventName); + System.out.println("SSE data: " + data.toString()); + System.out.println(); + } + eventName = null; + data.setLength(0); + } else if (line.startsWith("event: ")) { + eventName = line.substring("event: ".length()); + } else if (line.startsWith("data: ")) { + if (data.length() > 0) { + data.append(System.lineSeparator()); + } + data.append(line.substring("data: ".length())); + } + } + } + } + + private static AgentVersionDetails createHostedAgentVersion(AgentsClient agentsClient, String agentName, + String image) { + CreateAgentVersionInput input = new CreateAgentVersionInput(createHostedAgentDefinition(image)) + .setMetadata(sampleMetadata()) + .setDescription("Hosted agent sample created by the Azure AI Agents Java SDK."); + + AgentVersionDetails agent = agentsClient.createAgentVersionWithResponse(agentName, BinaryData.fromObject(input), + foundryFeaturesRequestOptions()).getValue().toObject(AgentVersionDetails.class); + System.out.printf("Agent created (name: %s, version: %s)%n", agent.getName(), agent.getVersion()); + return agent; + } + + private static Mono createHostedAgentVersionAsync(AgentsAsyncClient agentsAsyncClient, + String agentName, String image) { + CreateAgentVersionInput input = new CreateAgentVersionInput(createHostedAgentDefinition(image)) + .setMetadata(sampleMetadata()) + .setDescription("Hosted agent sample created by the Azure AI Agents Java SDK."); + + return agentsAsyncClient.createAgentVersionWithResponse(agentName, BinaryData.fromObject(input), + foundryFeaturesRequestOptions()) + .map(response -> response.getValue().toObject(AgentVersionDetails.class)) + .doOnNext(agent -> System.out.printf("Agent created (name: %s, version: %s)%n", agent.getName(), + agent.getVersion())); + } + + private static HostedAgentDefinition createHostedAgentDefinition(String image) { + return new HostedAgentDefinition("0.5", "1Gi") + .setContainerConfiguration(new ContainerConfiguration(image)) + .setProtocolVersions(Collections.singletonList( + new ProtocolVersionRecord(AgentProtocol.RESPONSES, "1.0.0"))); + } + + private static void waitForAgentVersionActive(AgentsClient agentsClient, String agentName, String agentVersion) { + for (int attempt = 1; attempt <= MAX_POLL_ATTEMPTS; attempt++) { + sleep(POLL_INTERVAL); + AgentVersionDetails versionDetails = agentsClient.getAgentVersionDetails(agentName, agentVersion); + AgentVersionStatus status = versionDetails.getStatus(); + System.out.printf("Agent version status: %s (attempt %d)%n", status, attempt); + + if (AgentVersionStatus.ACTIVE == status) { + return; + } + if (AgentVersionStatus.FAILED == status) { + throw new RuntimeException("Agent version provisioning failed: " + agentVersion); + } + } + + throw new RuntimeException("Timed out waiting for agent version to become active: " + agentVersion); + } + + private static Mono waitForAgentVersionActiveAsync(AgentsAsyncClient agentsAsyncClient, + String agentName, String agentVersion) { + return Flux.range(1, MAX_POLL_ATTEMPTS) + .delayElements(POLL_INTERVAL) + .concatMap(attempt -> agentsAsyncClient.getAgentVersionDetails(agentName, agentVersion) + .flatMap(versionDetails -> { + AgentVersionStatus status = versionDetails.getStatus(); + System.out.printf("Agent version status: %s (attempt %d)%n", status, attempt); + + if (AgentVersionStatus.ACTIVE == status) { + return Mono.just(versionDetails); + } + if (AgentVersionStatus.FAILED == status) { + return Mono.error(new RuntimeException("Agent version provisioning failed: " + agentVersion)); + } + return Mono.empty(); + })) + .next() + .switchIfEmpty(Mono.error(new RuntimeException( + "Timed out waiting for agent version to become active: " + agentVersion))); + } + + private static RequestOptions foundryFeaturesRequestOptions() { + return new RequestOptions() + .setHeader(HttpHeaderName.fromString("Foundry-Features"), FOUNDRY_FEATURES_HEADER_VALUE); + } + + private static Map createSessionRequest(String agentVersion) { + Map versionIndicator = new HashMap<>(); + versionIndicator.put("agent_version", agentVersion); + versionIndicator.put("type", "version_ref"); + + Map request = new HashMap<>(); + request.put("version_indicator", versionIndicator); + return request; + } + + private static Map sampleMetadata() { + Map metadata = new HashMap<>(); + metadata.put("enableVnextExperience", "true"); + return metadata; + } + + private static void sleep(Duration duration) { + try { + Thread.sleep(duration.toMillis()); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("Interrupted while waiting for hosted agent provisioning.", e); + } + } + + static final class HostedAgentSessionResources { + private final AgentVersionDetails agent; + private final AgentSessionResource session; + + HostedAgentSessionResources(AgentVersionDetails agent, AgentSessionResource session) { + this.agent = agent; + this.session = session; + } + + AgentVersionDetails getAgent() { + return agent; + } + + AgentSessionResource getSession() { + return session; + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionFilesAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionFilesAsyncSample.java new file mode 100644 index 000000000000..cb429333fd01 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionFilesAsyncSample.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentSessionFilesAsyncClient; +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; + +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This sample demonstrates hosted-agent session file operations using the async client. + * + *

Session files are currently a preview feature and only work with hosted-agent sessions.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class SessionFilesAsyncSample { + private static final String REMOTE_FILE_PATH_1 = "/remote/data_file1.txt"; + private static final String REMOTE_FILE_PATH_2 = "/remote/data_file2.txt"; + + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + AgentSessionFilesAsyncClient sessionFilesAsyncClient = builder.buildAgentSessionFilesAsyncClient(); + + AtomicReference resourcesRef = new AtomicReference<>(); + + Mono workflow = HostedAgentsSampleUtils.createAgentAndSessionAsync(agentsAsyncClient, agentName, image) + .flatMap(resources -> { + resourcesRef.set(resources); + String sessionId = resources.getSession().getAgentSessionId(); + + return sessionFilesAsyncClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + BinaryData.fromString("Sample session file 1."), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null) + .doOnNext(response -> System.out.printf("Uploaded session file: %s%n", response.getPath())) + .then(sessionFilesAsyncClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + BinaryData.fromString("Sample session file 2."), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null)) + .doOnNext(response -> System.out.printf("Uploaded session file: %s%n", response.getPath())) + .then(Mono.defer(() -> { + System.out.println("Listing session files for the session at path '/remote'..."); + return sessionFilesAsyncClient.listSessionFiles(agentName, sessionId, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, "/remote", null, null, null, null, null) + .doOnNext(entry -> System.out.printf(" - name=%s, size=%d, isDirectory=%s%n", + entry.getName(), entry.getSize(), entry.isDirectory())) + .then(); + })) + .then(sessionFilesAsyncClient.downloadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null)) + .doOnNext(downloaded -> { + System.out.printf("Downloading and printing content from '%s'%n", REMOTE_FILE_PATH_1); + String fileContent = new String(downloaded.toBytes(), StandardCharsets.UTF_8); + System.out.printf("Session file content (%s):%n%s%n", REMOTE_FILE_PATH_1, fileContent); + }) + .then(Mono.defer(() -> { + System.out.printf("Deleting session file at path: %s...%n", REMOTE_FILE_PATH_1); + return sessionFilesAsyncClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + })) + .then(Mono.defer(() -> { + System.out.printf("Deleting session file at path: %s...%n", REMOTE_FILE_PATH_2); + return sessionFilesAsyncClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + })); + }); + + workflow + .onErrorResume(error -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()).then(Mono.error(error))) + .then(Mono.defer(() -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()))) + .timeout(Duration.ofMinutes(15)) + .block(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionFilesSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionFilesSample.java new file mode 100644 index 000000000000..20fc6876f2d4 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionFilesSample.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentSessionFilesClient; +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.SessionDirectoryEntry; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.nio.charset.StandardCharsets; + +/** + * This sample demonstrates hosted-agent session file upload, list, download, and delete operations. + * + *

Session files are currently a preview feature and only work with hosted-agent sessions.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class SessionFilesSample { + private static final String REMOTE_FILE_PATH_1 = "/remote/data_file1.txt"; + private static final String REMOTE_FILE_PATH_2 = "/remote/data_file2.txt"; + + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsClient agentsClient = builder.buildAgentsClient(); + AgentSessionFilesClient sessionFilesClient = builder.buildAgentSessionFilesClient(); + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + String sessionId = resources.getSession().getAgentSessionId(); + + sessionFilesClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + BinaryData.fromString("Sample session file 1."), AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, + null); + System.out.printf("Uploaded session file: %s%n", REMOTE_FILE_PATH_1); + + sessionFilesClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + BinaryData.fromString("Sample session file 2."), AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, + null); + System.out.printf("Uploaded session file: %s%n", REMOTE_FILE_PATH_2); + + System.out.println("Listing session files for the session at path '/remote'..."); + for (SessionDirectoryEntry entry : sessionFilesClient.listSessionFiles(agentName, sessionId, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, "/remote", null, null, null, null, null)) { + System.out.printf(" - name=%s, size=%d, isDirectory=%s%n", entry.getName(), entry.getSize(), + entry.isDirectory()); + } + + System.out.printf("Downloading and printing content from '%s'%n", REMOTE_FILE_PATH_1); + BinaryData downloaded = sessionFilesClient.downloadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + String fileContent = new String(downloaded.toBytes(), StandardCharsets.UTF_8); + System.out.printf("Session file content (%s):%n%s%n", REMOTE_FILE_PATH_1, fileContent); + + System.out.printf("Deleting session file at path: %s...%n", REMOTE_FILE_PATH_1); + sessionFilesClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + + System.out.printf("Deleting session file at path: %s...%n", REMOTE_FILE_PATH_2); + sessionFilesClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionLogStreamAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionLogStreamAsyncSample.java new file mode 100644 index 000000000000..a99bc2a63739 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionLogStreamAsyncSample.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentEndpointConfig; +import com.azure.ai.agents.models.AgentEndpointProtocol; +import com.azure.ai.agents.models.FixedRatioVersionSelectionRule; +import com.azure.ai.agents.models.UpdateAgentDetailsOptions; +import com.azure.ai.agents.models.VersionSelector; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.client.OpenAIClientAsync; +import com.openai.core.JsonValue; +import com.openai.models.responses.ResponseCreateParams; +import reactor.core.publisher.Mono; +import reactor.core.scheduler.Schedulers; + +import java.time.Duration; +import java.util.Collections; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This sample demonstrates streaming hosted-agent session logs using async clients. + * + *

Session log streaming is currently a preview feature and only works with hosted-agent sessions.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class SessionLogStreamAsyncSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + AtomicReference resourcesRef = new AtomicReference<>(); + + Mono workflow = HostedAgentsSampleUtils.createAgentAndSessionAsync(agentsAsyncClient, agentName, image) + .flatMap(resources -> { + resourcesRef.set(resources); + + AgentEndpointConfig endpointConfig = new AgentEndpointConfig() + .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList( + new FixedRatioVersionSelectionRule(100) + .setAgentVersion(resources.getAgent().getVersion())))) + .setProtocols(Collections.singletonList(AgentEndpointProtocol.RESPONSES)); + + OpenAIClientAsync openAIAsyncClient = builder.buildAgentScopedOpenAIAsyncClient(agentName); + + return agentsAsyncClient.updateAgentDetails(agentName, + new UpdateAgentDetailsOptions().setAgentEndpoint(endpointConfig), + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW) + .doOnNext(updated -> System.out.printf("Agent endpoint configured for agent: %s%n", + updated.getName())) + .then(Mono.fromFuture(openAIAsyncClient.responses().create(ResponseCreateParams.builder() + .input("Say hello in one short sentence.") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()))) + .doOnNext(HostedAgentsSampleUtils::printResponseOutput) + .then(agentsAsyncClient.getSessionLogStreamWithResponse(agentName, resources.getAgent().getVersion(), + resources.getSession().getAgentSessionId(), new RequestOptions())) + .flatMap(response -> Mono.fromRunnable(() -> { + try { + System.out.println("Streaming session logs..."); + HostedAgentsSampleUtils.printSseFrames(response.getValue(), 30); + } catch (Exception e) { + throw new RuntimeException(e); + } + }).subscribeOn(Schedulers.boundedElastic())) + .then(); + }); + + workflow + .onErrorResume(error -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()).then(Mono.error(error))) + .then(Mono.defer(() -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()))) + .timeout(Duration.ofMinutes(15)) + .block(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionLogStreamSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionLogStreamSample.java new file mode 100644 index 000000000000..0234f006ee50 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionLogStreamSample.java @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentEndpointConfig; +import com.azure.ai.agents.models.AgentEndpointProtocol; +import com.azure.ai.agents.models.FixedRatioVersionSelectionRule; +import com.azure.ai.agents.models.UpdateAgentDetailsOptions; +import com.azure.ai.agents.models.VersionSelector; +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.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.client.OpenAIClient; +import com.openai.core.JsonValue; +import com.openai.models.responses.ResponseCreateParams; + +import java.io.IOException; +import java.util.Collections; + +/** + * This sample demonstrates streaming hosted-agent session logs. + * + *

Session log streaming is currently a preview feature and only works with hosted-agent sessions.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class SessionLogStreamSample { + public static void main(String[] args) throws IOException { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsClient agentsClient = builder.buildAgentsClient(); + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + + AgentEndpointConfig endpointConfig = new AgentEndpointConfig() + .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList( + new FixedRatioVersionSelectionRule(100) + .setAgentVersion(resources.getAgent().getVersion())))) + .setProtocols(Collections.singletonList(AgentEndpointProtocol.RESPONSES)); + + agentsClient.updateAgentDetails(agentName, + new UpdateAgentDetailsOptions().setAgentEndpoint(endpointConfig), + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW); + System.out.printf("Agent endpoint configured for agent: %s%n", agentName); + + OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agentName); + com.openai.models.responses.Response openAIResponse = openAIClient.responses().create( + ResponseCreateParams.builder() + .input("Say hello in one short sentence.") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()); + HostedAgentsSampleUtils.printResponseOutput(openAIResponse); + + System.out.println("Streaming session logs..."); + Response rawStream = agentsClient.getSessionLogStreamWithResponse(agentName, + resources.getAgent().getVersion(), resources.getSession().getAgentSessionId(), new RequestOptions()); + HostedAgentsSampleUtils.printSseFrames(rawStream.getValue(), 30); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java new file mode 100644 index 000000000000..56eca468669e --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsAsyncSample.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentSessionResource; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This sample demonstrates how to create, retrieve, list, and delete hosted-agent sessions using the async client. + * + *

Sessions are currently a preview feature and only work with hosted agents.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class SessionsAsyncSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsAsyncClient agentsAsyncClient = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint) + .buildAgentsAsyncClient(); + + AtomicReference resourcesRef = new AtomicReference<>(); + + Mono workflow = HostedAgentsSampleUtils.createAgentAndSessionAsync(agentsAsyncClient, agentName, image) + .flatMap(resources -> { + resourcesRef.set(resources); + AgentSessionResource session = resources.getSession(); + + return agentsAsyncClient.getSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null) + .doOnNext(fetched -> System.out.printf("Retrieved session (id: %s, status: %s)%n", + fetched.getAgentSessionId(), fetched.getStatus())) + .thenMany(agentsAsyncClient.listSessions(agentName, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null, null, null, null, null) + .doOnSubscribe(unused -> System.out.println("Listing sessions for the agent...")) + .doOnNext(item -> System.out.printf(" - %s (status: %s)%n", item.getAgentSessionId(), + item.getStatus()))) + .then(Mono.defer(() -> { + System.out.printf("Deleting session with id: %s...%n", session.getAgentSessionId()); + return agentsAsyncClient.deleteSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null) + .doOnSuccess(unused -> System.out.printf("Session with id: %s deleted.%n", + session.getAgentSessionId())); + })); + }); + + workflow + .onErrorResume(error -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()).then(Mono.error(error))) + .then(Mono.defer(() -> HostedAgentsSampleUtils.cleanupAsync(agentsAsyncClient, agentName, + resourcesRef.get()))) + .timeout(Duration.ofMinutes(15)) + .block(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java new file mode 100644 index 000000000000..842fa73703eb --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/hostedagents/SessionsSample.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentSessionResource; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +/** + * This sample demonstrates how to create, retrieve, list, and delete hosted-agent sessions. + * + *

Sessions are currently a preview feature and only work with hosted agents.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_AGENT_CONTAINER_IMAGE - The hosted-agent container image.
  • + *
+ */ +public class SessionsSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String image = Configuration.getGlobalConfiguration().get("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME; + + AgentsClient agentsClient = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint) + .buildAgentsClient(); + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + AgentSessionResource session = resources.getSession(); + + AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + System.out.printf("Retrieved session (id: %s, status: %s)%n", fetched.getAgentSessionId(), + fetched.getStatus()); + + System.out.println("Listing sessions for the agent..."); + PagedIterable sessions = agentsClient.listSessions(agentName, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null, null, null, null, null); + for (AgentSessionResource item : sessions) { + System.out.printf(" - %s (status: %s)%n", item.getAgentSessionId(), item.getStatus()); + } + + System.out.printf("Deleting session with id: %s...%n", session.getAgentSessionId()); + agentsClient.deleteSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + System.out.printf("Session with id: %s deleted.%n", session.getAgentSessionId()); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/CreateToolboxVersion.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/CreateToolboxVersion.java index 2a21de6e4961..e516aec6e2df 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/CreateToolboxVersion.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/CreateToolboxVersion.java @@ -43,7 +43,7 @@ public static void main(String[] args) { ToolboxVersionDetails toolboxVersion = toolboxesClient.createToolboxVersion( "toolbox_created_from_java", tools, - "Toolbox with MCP tool requiring approval 'never'.", null, null); + "Toolbox with MCP tool requiring approval 'never'.", null, null, null); System.out.println("Toolbox Name: " + toolboxVersion.getName()); System.out.println("Toolbox Version: " + toolboxVersion.getVersion()); diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxSearchToolboxSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxSearchToolboxSample.java new file mode 100644 index 000000000000..778e883120cf --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxSearchToolboxSample.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.toolboxes; + +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.ToolboxesClient; +import com.azure.ai.agents.models.Tool; +import com.azure.ai.agents.models.ToolboxSearchPreviewTool; +import com.azure.ai.agents.models.ToolboxVersionDetails; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.util.Collections; + +/** + * This sample demonstrates creating a toolbox version that includes the Toolbox Search preview tool. + * + *

Toolboxes are a preview feature. Before running, set {@code FOUNDRY_PROJECT_ENDPOINT} to your Azure AI Foundry + * project endpoint.

+ */ +public class ToolboxSearchToolboxSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String toolboxName = "toolbox-search-tool-java"; + + ToolboxesClient toolboxesClient = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint) + .buildToolboxesClient(); + + try { + toolboxesClient.deleteToolbox(toolboxName); + } catch (ResourceNotFoundException ignored) { + // The sample toolbox does not already exist. + } + + try { + // BEGIN: com.azure.ai.agents.toolboxes.ToolboxSearchToolboxSample.createToolboxSearchToolbox + + ToolboxSearchPreviewTool toolboxSearchTool = new ToolboxSearchPreviewTool() + .setName("search_tools") + .setDescription("Search over available toolbox tools at runtime."); + + ToolboxVersionDetails version = toolboxesClient.createToolboxVersion( + toolboxName, + Collections.singletonList(toolboxSearchTool), + "Toolbox version with a Toolbox Search preview tool.", + null, + null, + null); + + System.out.printf("Created toolbox: %s%n", version.getName()); + System.out.printf("Toolbox version: %s%n", version.getVersion()); + for (Tool tool : version.getTools()) { + System.out.printf("Tool type: %s%n", tool.getType()); + } + + // END: com.azure.ai.agents.toolboxes.ToolboxSearchToolboxSample.createToolboxSearchToolbox + } finally { + try { + toolboxesClient.deleteToolbox(toolboxName); + System.out.printf("Deleted toolbox: %s%n", toolboxName); + } catch (ResourceNotFoundException ignored) { + // The sample toolbox may not have been created. + } + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxesAsyncSample.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxesAsyncSample.java new file mode 100644 index 000000000000..5e48d20f91cd --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/toolboxes/ToolboxesAsyncSample.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.toolboxes; + +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.ToolboxesAsyncClient; +import com.azure.ai.agents.models.McpTool; +import com.azure.ai.agents.models.Tool; +import com.azure.ai.agents.models.ToolboxDetails; +import com.azure.ai.agents.models.ToolboxVersionDetails; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.Collections; +import java.util.List; + +/** + * This sample demonstrates end-to-end asynchronous CRUD operations on toolboxes. + * + *

A toolbox stores reusable tool definitions that can be shared across agents. + * Each call to {@code createToolboxVersion} creates a new immutable version. The + * toolbox's default version can be changed with {@code updateToolbox}.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
+ */ +public class ToolboxesAsyncSample { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String toolboxName = "toolbox-with-mcp-tool-java"; + + ToolboxesAsyncClient toolboxesAsyncClient = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint) + .buildToolboxesAsyncClient(); + + List toolsWithMcpApprovalNever = Collections.singletonList( + new McpTool("api_specs") + .setServerUrl("https://gitmcp.io/Azure/azure-rest-api-specs") + .setRequireApproval("never")); + + List toolsWithMcpApprovalAlways = Collections.singletonList( + new McpTool("api_specs") + .setServerUrl("https://gitmcp.io/Azure/azure-rest-api-specs") + .setRequireApproval("always")); + + Mono workflow = toolboxesAsyncClient.deleteToolbox(toolboxName) + .doOnSuccess(unused -> System.out.printf("Toolbox `%s` deleted%n", toolboxName)) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(toolboxesAsyncClient.createToolboxVersion(toolboxName, toolsWithMcpApprovalNever, + "Toolbox version with MCP require_approval set to 'never'.", null, null, null)) + .doOnNext(created -> System.out.printf( + "Created toolbox: %s with MCP tools requiring approval 'never' in version %s%n", + created.getName(), created.getVersion())) + .then(toolboxesAsyncClient.createToolboxVersion(toolboxName, toolsWithMcpApprovalAlways, + "Toolbox version with MCP require_approval set to 'always'.", null, null, null)) + .doOnNext(created -> System.out.printf( + "Created toolbox: %s with MCP tools requiring approval 'always' in version %s%n", + created.getName(), created.getVersion())) + .then(toolboxesAsyncClient.updateToolbox(toolboxName, "2")) + .flatMap(updated -> printFetchedDefaultToolboxVersion(toolboxesAsyncClient, updated)) + .then(toolboxesAsyncClient.updateToolbox(toolboxName, "1")) + .flatMap(updated -> printFetchedDefaultToolboxVersion(toolboxesAsyncClient, updated)) + .then(Mono.fromRunnable(() -> System.out.println("Listing toolboxes..."))) + .thenMany(toolboxesAsyncClient.listToolboxes()) + .doOnNext(item -> System.out.printf(" - %s (%s)%n", item.getName(), item.getId())) + .then(toolboxesAsyncClient.deleteToolbox(toolboxName)) + .doOnSuccess(unused -> System.out.println("Toolbox deleted")); + + workflow + .onErrorResume(error -> toolboxesAsyncClient.deleteToolbox(toolboxName) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(Mono.error(error))) + .timeout(Duration.ofMinutes(5)) + .block(); + } + + private static Mono printFetchedDefaultToolboxVersion( + ToolboxesAsyncClient toolboxesAsyncClient, ToolboxDetails updated) { + System.out.printf("Updated toolbox: %s default version is now %s%n", updated.getName(), + updated.getDefaultVersion()); + + return toolboxesAsyncClient.getToolbox(updated.getName()) + .doOnNext(fetched -> System.out.printf("Retrieved toolbox with default version: %s%n", + fetched.getDefaultVersion())) + .flatMap(fetched -> toolboxesAsyncClient.getToolboxVersion(fetched.getName(), + fetched.getDefaultVersion())) + .doOnNext(version -> printMcpRequireApproval(version.getTools())); + } + + private static void printMcpRequireApproval(List tools) { + for (Tool tool : tools) { + if (tool instanceof McpTool) { + McpTool mcpTool = (McpTool) tool; + System.out.printf(" - MCP `%s` require_approval: %s%n", mcpTool.getServerLabel(), + mcpTool.getRequireApprovalAsString()); + } + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQAsync.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQAsync.java new file mode 100644 index 000000000000..cce6023009ff --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQAsync.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.ResponsesAsyncClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.FabricIqPreviewTool; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.models.responses.ResponseCreateParams; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.Collections; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This sample demonstrates how to create an agent with the FabricIQ preview tool using async clients. + * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_MODEL_NAME - The model deployment name.
  • + *
  • FABRIC_IQ_PROJECT_CONNECTION_ID - The FabricIQ connection ID.
  • + *
  • FABRIC_IQ_USER_INPUT - Optional. The natural-language question to send to the agent.
  • + *
+ */ +public class FabricIQAsync { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String model = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + String fabricIqConnectionId = Configuration.getGlobalConfiguration().get("FABRIC_IQ_PROJECT_CONNECTION_ID"); + String userInput = Configuration.getGlobalConfiguration().get("FABRIC_IQ_USER_INPUT", + "Use FabricIQ to summarize the available enterprise context."); + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + ResponsesAsyncClient responsesAsyncClient = builder.buildResponsesAsyncClient(); + AtomicReference agentRef = new AtomicReference<>(); + + FabricIqPreviewTool fabricIqTool = new FabricIqPreviewTool(fabricIqConnectionId) + .setServerLabel("fabric_iq") + .setRequireApproval("never") + .setName("fabric_iq_lookup") + .setDescription("Use FabricIQ to answer questions grounded in enterprise data."); + + PromptAgentDefinition agentDefinition = new PromptAgentDefinition(model) + .setInstructions("Use the available Fabric IQ tools to answer questions and perform tasks.") + .setTools(Collections.singletonList(fabricIqTool)); + + agentsAsyncClient.createAgentVersion("fabric-iq-agent", agentDefinition) + .flatMap(agent -> { + agentRef.set(agent); + System.out.printf("Agent created: %s (version %s)%n", agent.getName(), agent.getVersion()); + + AgentReference agentReference = new AgentReference(agent.getName()) + .setVersion(agent.getVersion()); + + return responsesAsyncClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), + ResponseCreateParams.builder() + .input(userInput)); + }) + .doOnNext(response -> System.out.println("Response: " + response.output())) + .then(Mono.defer(() -> { + AgentVersionDetails agent = agentRef.get(); + if (agent != null) { + return agentsAsyncClient.deleteAgentVersion(agent.getName(), agent.getVersion()) + .doOnSuccess(v -> System.out.println("Agent deleted")); + } + return Mono.empty(); + })) + .timeout(Duration.ofSeconds(300)) + .block(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQSync.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQSync.java new file mode 100644 index 000000000000..62b97406e9bc --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/FabricIQSync.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.ResponsesClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.FabricIqPreviewTool; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; + +import java.util.Collections; + +/** + * This sample demonstrates how to create an agent with the FabricIQ preview tool. + * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_MODEL_NAME - The model deployment name.
  • + *
  • FABRIC_IQ_PROJECT_CONNECTION_ID - The FabricIQ connection ID.
  • + *
  • FABRIC_IQ_USER_INPUT - Optional. The natural-language question to send to the agent.
  • + *
+ */ +public class FabricIQSync { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String model = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + String fabricIqConnectionId = Configuration.getGlobalConfiguration().get("FABRIC_IQ_PROJECT_CONNECTION_ID"); + String userInput = Configuration.getGlobalConfiguration().get("FABRIC_IQ_USER_INPUT", + "Use FabricIQ to summarize the available enterprise context."); + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsClient agentsClient = builder.buildAgentsClient(); + ResponsesClient responsesClient = builder.buildResponsesClient(); + + // BEGIN: com.azure.ai.agents.define_fabric_iq + + FabricIqPreviewTool fabricIqTool = new FabricIqPreviewTool(fabricIqConnectionId) + .setServerLabel("fabric_iq") + .setRequireApproval("never") + .setName("fabric_iq_lookup") + .setDescription("Use FabricIQ to answer questions grounded in enterprise data."); + + // END: com.azure.ai.agents.define_fabric_iq + + PromptAgentDefinition agentDefinition = new PromptAgentDefinition(model) + .setInstructions("Use the available Fabric IQ tools to answer questions and perform tasks.") + .setTools(Collections.singletonList(fabricIqTool)); + + AgentVersionDetails agent = agentsClient.createAgentVersion("fabric-iq-agent", agentDefinition); + System.out.printf("Agent created: %s (version %s)%n", agent.getName(), agent.getVersion()); + + try { + AgentReference agentReference = new AgentReference(agent.getName()) + .setVersion(agent.getVersion()); + + Response response = responsesClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), + ResponseCreateParams.builder() + .input(userInput)); + + System.out.println("Response: " + response.output()); + } finally { + agentsClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + System.out.println("Agent deleted"); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/WorkIQAsync.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/WorkIQAsync.java new file mode 100644 index 000000000000..e97e272cc95c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/WorkIQAsync.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.ResponsesAsyncClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.ai.agents.models.WorkIqPreviewTool; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.models.responses.ResponseCreateParams; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.Collections; +import java.util.concurrent.atomic.AtomicReference; + +/** + * This sample demonstrates how to create an agent with the Work IQ preview tool using async clients. + * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_MODEL_NAME - The model deployment name.
  • + *
  • WORK_IQ_PROJECT_CONNECTION_ID - The Work IQ connection ID.
  • + *
  • WORK_IQ_USER_INPUT - Optional. The natural-language question to send to the agent.
  • + *
+ */ +public class WorkIQAsync { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String model = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + String workIqConnectionId = Configuration.getGlobalConfiguration().get("WORK_IQ_PROJECT_CONNECTION_ID"); + String userInput = Configuration.getGlobalConfiguration().get("WORK_IQ_USER_INPUT", + "Use Work IQ to summarize the available enterprise context."); + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + ResponsesAsyncClient responsesAsyncClient = builder.buildResponsesAsyncClient(); + AtomicReference agentRef = new AtomicReference<>(); + + WorkIqPreviewTool workIqTool = new WorkIqPreviewTool(workIqConnectionId) + .setName("work_iq_lookup") + .setDescription("Use Work IQ to answer questions grounded in enterprise data."); + + PromptAgentDefinition agentDefinition = new PromptAgentDefinition(model) + .setInstructions("Use the available Work IQ tools to answer questions and perform tasks.") + .setTools(Collections.singletonList(workIqTool)); + + agentsAsyncClient.createAgentVersion("work-iq-agent", agentDefinition) + .flatMap(agent -> { + agentRef.set(agent); + System.out.printf("Agent created: %s (version %s)%n", agent.getName(), agent.getVersion()); + + AgentReference agentReference = new AgentReference(agent.getName()) + .setVersion(agent.getVersion()); + + return responsesAsyncClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), + ResponseCreateParams.builder() + .input(userInput)); + }) + .doOnNext(response -> System.out.println("Response: " + response.output())) + .then(Mono.defer(() -> { + AgentVersionDetails agent = agentRef.get(); + if (agent != null) { + return agentsAsyncClient.deleteAgentVersion(agent.getName(), agent.getVersion()) + .doOnSuccess(v -> System.out.println("Agent deleted")); + } + return Mono.empty(); + })) + .timeout(Duration.ofSeconds(300)) + .block(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/WorkIQSync.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/WorkIQSync.java new file mode 100644 index 000000000000..469f414c0234 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/tools/WorkIQSync.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.ResponsesClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.ai.agents.models.WorkIqPreviewTool; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; + +import java.util.Collections; + +/** + * This sample demonstrates how to create an agent with the Work IQ preview tool. + * + *

Before running the sample, set these environment variables:

+ *
    + *
  • FOUNDRY_PROJECT_ENDPOINT - The Azure AI Project endpoint.
  • + *
  • FOUNDRY_MODEL_NAME - The model deployment name.
  • + *
  • WORK_IQ_PROJECT_CONNECTION_ID - The Work IQ connection ID.
  • + *
  • WORK_IQ_USER_INPUT - Optional. The natural-language question to send to the agent.
  • + *
+ */ +public class WorkIQSync { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String model = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + String workIqConnectionId = Configuration.getGlobalConfiguration().get("WORK_IQ_PROJECT_CONNECTION_ID"); + String userInput = Configuration.getGlobalConfiguration().get("WORK_IQ_USER_INPUT", + "Use Work IQ to summarize the available enterprise context."); + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(new DefaultAzureCredentialBuilder().build()) + .endpoint(endpoint); + + AgentsClient agentsClient = builder.buildAgentsClient(); + ResponsesClient responsesClient = builder.buildResponsesClient(); + + WorkIqPreviewTool workIqTool = new WorkIqPreviewTool(workIqConnectionId) + .setName("work_iq_lookup") + .setDescription("Use Work IQ to answer questions grounded in enterprise data."); + + PromptAgentDefinition agentDefinition = new PromptAgentDefinition(model) + .setInstructions("Use the available Work IQ tools to answer questions and perform tasks.") + .setTools(Collections.singletonList(workIqTool)); + + AgentVersionDetails agent = agentsClient.createAgentVersion("work-iq-agent", agentDefinition); + System.out.printf("Agent created: %s (version %s)%n", agent.getName(), agent.getVersion()); + + try { + AgentReference agentReference = new AgentReference(agent.getName()) + .setVersion(agent.getVersion()); + + Response response = responsesClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), + ResponseCreateParams.builder() + .input(userInput)); + + System.out.println("Response: " + response.output()); + } finally { + agentsClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + System.out.println("Agent deleted"); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java index 2a7665179e1e..17b2826eec43 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/ClientTestBase.java @@ -44,10 +44,10 @@ protected AgentsClientBuilder getClientBuilder(HttpClient httpClient, AgentsServ builder.endpoint("https://localhost:8080").credential(new MockTokenCredential()); } else if (testMode == TestMode.RECORD) { builder.addPolicy(interceptorManager.getRecordPolicy()) - .endpoint(Configuration.getGlobalConfiguration().get("AZURE_AGENTS_ENDPOINT")) + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT")) .credential(new DefaultAzureCredentialBuilder().build()); } else { - builder.endpoint(Configuration.getGlobalConfiguration().get("AZURE_AGENTS_ENDPOINT")) + builder.endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT")) .credential(new DefaultAzureCredentialBuilder().build()); } @@ -110,6 +110,7 @@ private void addTestRecordCustomSanitizers() { ArrayList sanitizers = new ArrayList<>(); sanitizers.add(new TestProxySanitizer("$..key", null, "REDACTED", TestProxySanitizerType.BODY_KEY)); + sanitizers.add(new TestProxySanitizer("$..image", null, "REDACTED", TestProxySanitizerType.BODY_KEY)); sanitizers.add(new TestProxySanitizer("(?<=./)([^?]+)", "/REDACTED/", TestProxySanitizerType.URL)); sanitizers.add(new TestProxySanitizer("Content-Type", "(^multipart\\/form-data; boundary=[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{2})", diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogAsyncTest.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogAsyncTest.java index 4dee38097879..4a2d3a886233 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogAsyncTest.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogAsyncTest.java @@ -13,6 +13,8 @@ import com.azure.core.http.rest.RequestOptions; import com.azure.core.test.annotation.RecordWithoutRequestBody; import com.azure.core.util.BinaryData; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import reactor.core.Disposable; @@ -29,12 +31,12 @@ public class SessionLogAsyncTest extends ClientTestBase { private static final String AGENT_NAME = "MySessionHostedAgent3"; private static final String AGENT_VERSION = "16"; - private static final String ISOLATION_KEY = "sse-validation"; private static final String SESSION_ID = "sse-validation-record-async"; @RecordWithoutRequestBody @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.agents.TestUtils#getTestParameters") + @Disabled public void validatesSessionLogStream(HttpClient httpClient, AgentsServiceVersion serviceVersion) { AgentsAsyncClient client = getAgentsAsyncClient(httpClient, serviceVersion); RequestOptions featureOptions = new RequestOptions().setHeader(HttpHeaderName.fromString("Foundry-Features"), @@ -42,7 +44,7 @@ public void validatesSessionLogStream(HttpClient httpClient, AgentsServiceVersio deleteSession(client); AgentSessionResource session = client - .createSessionWithResponse(AGENT_NAME, ISOLATION_KEY, + .createSessionWithResponse(AGENT_NAME, BinaryData.fromObject(new com.azure.ai.agents.implementation.models.CreateSessionRequest( new VersionRefIndicator(AGENT_VERSION)).setAgentSessionId(SESSION_ID)), featureOptions) @@ -78,8 +80,7 @@ private static void deleteSession(AgentsAsyncClient client) { } private static Mono deleteSessionAsync(AgentsAsyncClient client) { - return client - .deleteSession(AGENT_NAME, SESSION_ID, ISOLATION_KEY, AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW) + return client.deleteSession(AGENT_NAME, SESSION_ID, AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null) .onErrorResume(error -> Mono.empty()); } diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogSyncTest.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogSyncTest.java index 634421d5ec39..70ac79de4a82 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogSyncTest.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/SessionLogSyncTest.java @@ -14,6 +14,8 @@ import com.azure.core.test.TestMode; import com.azure.core.test.annotation.RecordWithoutRequestBody; import com.azure.core.util.BinaryData; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -34,12 +36,12 @@ public class SessionLogSyncTest extends ClientTestBase { private static final String AGENT_NAME = "MySessionHostedAgent3"; private static final String AGENT_VERSION = "16"; - private static final String ISOLATION_KEY = "sse-validation"; private static final String SESSION_ID = "sse-validation-record-sync"; @RecordWithoutRequestBody @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.agents.TestUtils#getTestParameters") + @Disabled public void validatesSessionLogStream(HttpClient httpClient, AgentsServiceVersion serviceVersion) { AgentsClient client = getAgentsSyncClient(httpClient, serviceVersion); RequestOptions featureOptions = new RequestOptions().setHeader(HttpHeaderName.fromString("Foundry-Features"), @@ -47,7 +49,7 @@ public void validatesSessionLogStream(HttpClient httpClient, AgentsServiceVersio deleteSession(client); AgentSessionResource session = client - .createSessionWithResponse(AGENT_NAME, ISOLATION_KEY, + .createSessionWithResponse(AGENT_NAME, BinaryData.fromObject(new com.azure.ai.agents.implementation.models.CreateSessionRequest( new VersionRefIndicator(AGENT_VERSION)).setAgentSessionId(SESSION_ID)), featureOptions) @@ -88,8 +90,7 @@ private ScheduledFuture scheduleSessionDelete(AgentsClient client, ScheduledE private static void deleteSession(AgentsClient client) { try { - client.deleteSession(AGENT_NAME, SESSION_ID, ISOLATION_KEY, - AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW); + client.deleteSession(AGENT_NAME, SESSION_ID, AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); } catch (RuntimeException ignored) { // Cleanup best effort. } diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java new file mode 100644 index 000000000000..6be8a0afb23a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/CodeAgentSamplesTests.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpClient; +import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; + +import static com.azure.core.test.TestProxyTestBase.getHttpClients; + +@Disabled("Direct code deployment is not enabled for the current test subscription.") +public class CodeAgentSamplesTests extends ClientTestBase { + private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + + static Stream getTestParameters() { + List argumentsList = new ArrayList<>(); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V1))); + return argumentsList.stream(); + } + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void codeAgentSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) throws Exception { + AgentsClient agentsClient = getClientBuilder(httpClient, serviceVersion).buildAgentsClient(); + String agentName = CodeAgentSampleUtils.SAMPLE_AGENT_NAME + "-test"; + + try { + agentsClient.deleteAgent(agentName); + } catch (ResourceNotFoundException ignored) { + // The sample agent does not already exist. + } + + try { + BinaryData codeZip = CodeAgentSampleUtils.createCodeZip(); + String codeZipSha256 = CodeAgentSampleUtils.sha256(codeZip); + + AgentVersionDetails version = agentsClient.createAgentVersionFromCode(agentName, codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW); + Assertions.assertNotNull(version); + Assertions.assertEquals(agentName, version.getName()); + Assertions.assertNotNull(version.getVersion()); + + BinaryData downloadedCode + = agentsClient.downloadAgentCode(agentName, AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW, null); + Assertions.assertNotNull(downloadedCode); + Assertions.assertTrue(downloadedCode.toBytes().length > 0); + + Path downloadPath = Files.createTempFile(agentName + "-", ".zip"); + Files.write(downloadPath, downloadedCode.toBytes()); + Assertions.assertTrue(Files.size(downloadPath) > 0); + + AgentVersionDetails newVersion = agentsClient.createAgentVersionFromCode(agentName, codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW); + Assertions.assertNotNull(newVersion); + Assertions.assertEquals(agentName, newVersion.getName()); + Assertions.assertNotNull(newVersion.getVersion()); + } finally { + try { + agentsClient.deleteAgent(agentName); + } catch (ResourceNotFoundException ignored) { + // The sample agent may not have been created. + } + } + } + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void codeAgentAsyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) throws Exception { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + String agentName = CodeAgentSampleUtils.SAMPLE_AGENT_NAME + "-async-test"; + BinaryData codeZip = CodeAgentSampleUtils.createCodeZip(); + String codeZipSha256 = CodeAgentSampleUtils.sha256(codeZip); + + Mono testFlow = agentsAsyncClient.deleteAgent(agentName) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(agentsAsyncClient.createAgentVersionFromCode(agentName, codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW)) + .flatMap(version -> { + Assertions.assertNotNull(version); + Assertions.assertEquals(agentName, version.getName()); + Assertions.assertNotNull(version.getVersion()); + + return agentsAsyncClient.downloadAgentCode(agentName, AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW, + null); + }) + .flatMap(downloadedCode -> { + Assertions.assertNotNull(downloadedCode); + Assertions.assertTrue(downloadedCode.toBytes().length > 0); + return agentsAsyncClient.createAgentVersionFromCode(agentName, codeZipSha256, + CodeAgentSampleUtils.createAgentVersionFromCodeContent(codeZip), + AgentDefinitionOptInKeys.CODE_AGENTS_V1_PREVIEW); + }) + .doOnNext(newVersion -> { + Assertions.assertNotNull(newVersion); + Assertions.assertEquals(agentName, newVersion.getName()); + Assertions.assertNotNull(newVersion.getVersion()); + }) + .then(agentsAsyncClient.deleteAgent(agentName)); + + StepVerifier.create(testFlow).verifyComplete(); + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java new file mode 100644 index 000000000000..f4ad5c8e391a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/hostedagents/HostedAgentContainerSamplesTests.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.hostedagents; + +import com.azure.ai.agents.AgentSessionFilesClient; +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.hostedagents.HostedAgentsSampleUtils.HostedAgentSessionResources; +import com.azure.ai.agents.models.AgentDefinitionOptInKeys; +import com.azure.ai.agents.models.AgentEndpointConfig; +import com.azure.ai.agents.models.AgentEndpointProtocol; +import com.azure.ai.agents.models.AgentSessionResource; +import com.azure.ai.agents.models.FixedRatioVersionSelectionRule; +import com.azure.ai.agents.models.SessionDirectoryEntry; +import com.azure.ai.agents.models.UpdateAgentDetailsOptions; +import com.azure.ai.agents.models.VersionSelector; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.test.TestMode; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.openai.client.OpenAIClient; +import com.openai.core.JsonValue; +import com.openai.models.responses.ResponseCreateParams; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import static com.azure.core.test.TestProxyTestBase.getHttpClients; + +public class HostedAgentContainerSamplesTests extends ClientTestBase { + private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + private static final String REMOTE_FILE_PATH_1 = "/remote/data_file1.txt"; + private static final String REMOTE_FILE_PATH_2 = "/remote/data_file2.txt"; + + static Stream getTestParameters() { + List argumentsList = new ArrayList<>(); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V1))); + return argumentsList.stream(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void sessionsSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClient agentsClient = getClientBuilder(httpClient, serviceVersion).buildAgentsClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-sessions-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + AgentSessionResource session = resources.getSession(); + + AgentSessionResource fetched = agentsClient.getSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + Assertions.assertNotNull(fetched); + Assertions.assertEquals(session.getAgentSessionId(), fetched.getAgentSessionId()); + + PagedIterable sessions = agentsClient.listSessions(agentName, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null, null, null, null, null); + Assertions.assertTrue( + sessions.stream().anyMatch(item -> session.getAgentSessionId().equals(item.getAgentSessionId()))); + + try { + agentsClient.deleteSession(agentName, session.getAgentSessionId(), + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + } catch (ResourceNotFoundException ignored) { + // The session may already be deleted by the service. + } + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void sessionFilesSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + AgentSessionFilesClient sessionFilesClient = builder.buildAgentSessionFilesClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-files-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + String sessionId = resources.getSession().getAgentSessionId(); + + sessionFilesClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + BinaryData.fromString("Sample session file 1."), AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, + null); + sessionFilesClient.uploadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + BinaryData.fromString("Sample session file 2."), AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, + null); + + PagedIterable files = sessionFilesClient.listSessionFiles(agentName, sessionId, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, "/remote", null, null, null, null, null); + Assertions + .assertTrue(files.stream().map(SessionDirectoryEntry::getName).anyMatch("data_file1.txt"::equals)); + + BinaryData downloaded = sessionFilesClient.downloadSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, null); + String fileContent = new String(downloaded.toBytes(), StandardCharsets.UTF_8); + Assertions.assertEquals("Sample session file 1.", fileContent); + + sessionFilesClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_1, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + sessionFilesClient.deleteSessionFile(agentName, sessionId, REMOTE_FILE_PATH_2, + AgentDefinitionOptInKeys.HOSTED_AGENTS_V1_PREVIEW, false, null); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } + + @Disabled("Agent-scoped OpenAI Responses invocation returns 400: API version not supported.") + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void agentEndpointSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-endpoint-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + configureAgentEndpoint(agentsClient, agentName, resources); + + OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agentName); + com.openai.models.responses.Response response = openAIClient.responses() + .create(ResponseCreateParams.builder() + .input("What is the size of France in square miles?") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()); + + Assertions.assertNotNull(response); + Assertions.assertFalse(response.output().isEmpty()); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } + + @Disabled("Agent-scoped OpenAI Responses invocation returns 400: API version not supported.") + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void sessionLogStreamSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) throws IOException { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + String image = getRequiredConfiguration("FOUNDRY_AGENT_CONTAINER_IMAGE"); + String agentName = HostedAgentsSampleUtils.SAMPLE_AGENT_NAME + "-logs-test"; + + HostedAgentSessionResources resources = null; + try { + resources = HostedAgentsSampleUtils.createAgentAndSession(agentsClient, agentName, image); + configureAgentEndpoint(agentsClient, agentName, resources); + + OpenAIClient openAIClient = builder.buildAgentScopedOpenAIClient(agentName); + com.openai.models.responses.Response openAIResponse = openAIClient.responses() + .create(ResponseCreateParams.builder() + .input("Say hello in one short sentence.") + .putAdditionalBodyProperty("agent_session_id", + JsonValue.from(resources.getSession().getAgentSessionId())) + .build()); + Assertions.assertNotNull(openAIResponse); + + com.azure.core.http.rest.Response rawStream + = agentsClient.getSessionLogStreamWithResponse(agentName, resources.getAgent().getVersion(), + resources.getSession().getAgentSessionId(), new RequestOptions()); + Assertions.assertNotNull(rawStream.getValue()); + HostedAgentsSampleUtils.printSseFrames(rawStream.getValue(), 5); + } finally { + HostedAgentsSampleUtils.cleanup(agentsClient, agentName, resources); + } + } + + private static void configureAgentEndpoint(AgentsClient agentsClient, String agentName, + HostedAgentSessionResources resources) { + AgentEndpointConfig endpointConfig = new AgentEndpointConfig() + .setVersionSelector(new VersionSelector().setVersionSelectionRules(Collections.singletonList( + new FixedRatioVersionSelectionRule(100).setAgentVersion(resources.getAgent().getVersion())))) + .setProtocols(Collections.singletonList(AgentEndpointProtocol.RESPONSES)); + + agentsClient.updateAgentDetails(agentName, new UpdateAgentDetailsOptions().setAgentEndpoint(endpointConfig), + AgentDefinitionOptInKeys.AGENT_ENDPOINT_V1_PREVIEW); + } + + private String getRequiredConfiguration(String name) { + if (getTestMode() == TestMode.PLAYBACK && "FOUNDRY_AGENT_CONTAINER_IMAGE".equals(name)) { + return "REDACTED"; + } + + String value = Configuration.getGlobalConfiguration().get(name); + Assertions.assertNotNull(value, name + " must be set."); + return value; + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FabricIqPreviewToolSerializationTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FabricIqPreviewToolSerializationTests.java new file mode 100644 index 000000000000..2a6eafbe0332 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FabricIqPreviewToolSerializationTests.java @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.models; + +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import com.azure.json.JsonWriter; +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Arrays; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Tests for FabricIqPreviewTool serialization, focusing on the requireApproval union type handling. + * requireApproval is a union type: String ("always"/"never") | McpToolRequireApproval. + */ +public class FabricIqPreviewToolSerializationTests { + + private static final String TEST_CONNECTION_ID = "test-connection-id"; + + // ===== requireApproval tests ===== + + /** + * Tests serialization when requireApproval is not set (null). + */ + @Test + public void testSerializationWithoutRequireApproval() throws IOException { + FabricIqPreviewTool tool = new FabricIqPreviewTool(TEST_CONNECTION_ID); + + String json = serializeToJson(tool); + + assertNotNull(json); + assertTrue(json.contains("\"project_connection_id\":\"test-connection-id\"")); + assertFalse(json.contains("\"require_approval\"")); + } + + /** + * Tests serialization with requireApproval set to "always" string. + */ + @Test + public void testSerializationWithRequireApprovalAlwaysString() throws IOException { + FabricIqPreviewTool tool = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval("always"); + + String json = serializeToJson(tool); + + assertNotNull(json); + assertTrue(json.contains("\"require_approval\":\"always\"")); + } + + /** + * Tests serialization with requireApproval set to "never" string. + */ + @Test + public void testSerializationWithRequireApprovalNeverString() throws IOException { + FabricIqPreviewTool tool = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval("never"); + + String json = serializeToJson(tool); + + assertNotNull(json); + assertTrue(json.contains("\"require_approval\":\"never\"")); + } + + /** + * Tests serialization with requireApproval set to an McpToolRequireApproval filter. + */ + @Test + public void testSerializationWithRequireApprovalAsMcpToolRequireApproval() throws IOException { + McpToolFilter alwaysFilter = new McpToolFilter().setToolNames(Arrays.asList("dangerous_tool")); + McpToolFilter neverFilter = new McpToolFilter().setToolNames(Arrays.asList("safe_tool")); + McpToolRequireApproval approval = new McpToolRequireApproval().setAlways(alwaysFilter).setNever(neverFilter); + + FabricIqPreviewTool tool = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval(approval); + + String json = serializeToJson(tool); + + assertNotNull(json); + assertTrue(json.contains("\"require_approval\"")); + assertTrue(json.contains("dangerous_tool")); + assertTrue(json.contains("safe_tool")); + assertTrue(json.contains("\"always\"")); + assertTrue(json.contains("\"never\"")); + } + + /** + * Tests deserialization with requireApproval set to "always" string. + */ + @Test + public void testDeserializationWithRequireApprovalAlwaysString() throws IOException { + String json + = "{\"project_connection_id\":\"test-connection-id\",\"type\":\"fabric_iq_preview\",\"require_approval\":\"always\"}"; + + FabricIqPreviewTool tool = deserializeFromJson(json); + + assertNotNull(tool); + assertEquals("always", tool.getRequireApprovalAsString()); + } + + /** + * Tests deserialization with requireApproval set to "never" string. + */ + @Test + public void testDeserializationWithRequireApprovalNeverString() throws IOException { + String json + = "{\"project_connection_id\":\"test-connection-id\",\"type\":\"fabric_iq_preview\",\"require_approval\":\"never\"}"; + + FabricIqPreviewTool tool = deserializeFromJson(json); + + assertNotNull(tool); + assertEquals("never", tool.getRequireApprovalAsString()); + } + + /** + * Tests deserialization with requireApproval set to an McpToolRequireApproval object. + */ + @Test + public void testDeserializationWithRequireApprovalAsMcpToolRequireApproval() throws IOException { + String json + = "{\"project_connection_id\":\"test-connection-id\",\"type\":\"fabric_iq_preview\",\"require_approval\":{\"always\":{\"tool_names\":[\"dangerous_tool\"]},\"never\":{\"tool_names\":[\"safe_tool\"]}}}"; + + FabricIqPreviewTool tool = deserializeFromJson(json); + + assertNotNull(tool); + McpToolRequireApproval approval = tool.getRequireApprovalAsMcpToolRequireApproval(); + assertNotNull(approval); + assertNotNull(approval.getAlways()); + assertNotNull(approval.getNever()); + assertEquals(1, approval.getAlways().getToolNames().size()); + assertEquals("dangerous_tool", approval.getAlways().getToolNames().get(0)); + assertEquals("safe_tool", approval.getNever().getToolNames().get(0)); + } + + /** + * Tests deserialization with requireApproval absent. + */ + @Test + public void testDeserializationWithoutRequireApproval() throws IOException { + String json = "{\"project_connection_id\":\"test-connection-id\",\"type\":\"fabric_iq_preview\"}"; + + FabricIqPreviewTool tool = deserializeFromJson(json); + + assertNotNull(tool); + assertNull(tool.getRequireApprovalAsString()); + assertNull(tool.getRequireApprovalAsMcpToolRequireApproval()); + } + + /** + * Tests round-trip with requireApproval as "always" string. + */ + @Test + public void testRoundTripWithRequireApprovalAlwaysString() throws IOException { + FabricIqPreviewTool original = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval("always"); + + String json = serializeToJson(original); + FabricIqPreviewTool deserialized = deserializeFromJson(json); + + assertNotNull(deserialized); + assertEquals("always", deserialized.getRequireApprovalAsString()); + } + + /** + * Tests round-trip with requireApproval as "never" string. + */ + @Test + public void testRoundTripWithRequireApprovalNeverString() throws IOException { + FabricIqPreviewTool original = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval("never"); + + String json = serializeToJson(original); + FabricIqPreviewTool deserialized = deserializeFromJson(json); + + assertNotNull(deserialized); + assertEquals("never", deserialized.getRequireApprovalAsString()); + } + + /** + * Tests round-trip with requireApproval as McpToolRequireApproval. + */ + @Test + public void testRoundTripWithRequireApprovalAsMcpToolRequireApproval() throws IOException { + McpToolFilter alwaysFilter = new McpToolFilter().setToolNames(Arrays.asList("tool_1")); + McpToolRequireApproval approval = new McpToolRequireApproval().setAlways(alwaysFilter); + + FabricIqPreviewTool original = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval(approval); + + String json = serializeToJson(original); + FabricIqPreviewTool deserialized = deserializeFromJson(json); + + assertNotNull(deserialized); + McpToolRequireApproval deserializedApproval = deserialized.getRequireApprovalAsMcpToolRequireApproval(); + assertNotNull(deserializedApproval); + assertNotNull(deserializedApproval.getAlways()); + assertEquals(1, deserializedApproval.getAlways().getToolNames().size()); + assertEquals("tool_1", deserializedApproval.getAlways().getToolNames().get(0)); + } + + // ===== Regression: no double-quoting ===== + + /** + * Regression: requireApproval string must not be double-quoted in serialized JSON. + */ + @Test + public void testRequireApprovalStringNoDoubleQuoting() throws IOException { + FabricIqPreviewTool tool = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval("always"); + + String json = serializeToJson(tool); + + assertTrue(json.contains("\"require_approval\":\"always\""), + "requireApproval string must not be double-quoted, got: " + json); + assertFalse(json.contains("\\\"always\\\""), + "requireApproval string must not have escaped quotes, got: " + json); + } + + /** + * Regression: requireApproval string getter must return the plain string after round-trip. + */ + @Test + public void testRequireApprovalStringRoundTripNoExtraQuotes() throws IOException { + FabricIqPreviewTool original = new FabricIqPreviewTool(TEST_CONNECTION_ID).setRequireApproval("always"); + + String json = serializeToJson(original); + FabricIqPreviewTool deserialized = deserializeFromJson(json); + + assertEquals("always", deserialized.getRequireApprovalAsString(), + "Round-tripped requireApproval string must not have extra quotes"); + } + + /** + * Tests that other properties serialize correctly alongside requireApproval. + */ + @Test + public void testSerializationWithAllProperties() throws IOException { + FabricIqPreviewTool tool = new FabricIqPreviewTool(TEST_CONNECTION_ID).setServerLabel("my-server") + .setServerUrl("https://fabriciq.example.com") + .setRequireApproval("always") + .setName("my-fabric-tool") + .setDescription("A test FabricIQ tool"); + + String json = serializeToJson(tool); + + assertNotNull(json); + assertTrue(json.contains("\"project_connection_id\":\"test-connection-id\"")); + assertTrue(json.contains("\"server_label\":\"my-server\"")); + assertTrue(json.contains("\"server_url\":\"https://fabriciq.example.com\"")); + assertTrue(json.contains("\"require_approval\":\"always\"")); + assertTrue(json.contains("\"name\":\"my-fabric-tool\"")); + assertTrue(json.contains("\"description\":\"A test FabricIQ tool\"")); + assertTrue(json.contains("\"type\":\"fabric_iq_preview\"")); + } + + // Helper method to serialize to JSON string + private String serializeToJson(FabricIqPreviewTool tool) throws IOException { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter jsonWriter = JsonProviders.createWriter(outputStream)) { + tool.toJson(jsonWriter); + } + return outputStream.toString("UTF-8"); + } + + // Helper method to deserialize from JSON string + private FabricIqPreviewTool deserializeFromJson(String json) throws IOException { + try (JsonReader jsonReader = JsonProviders.createReader(json)) { + return FabricIqPreviewTool.fromJson(jsonReader); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FileSearchToolSerializationTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FileSearchToolSerializationTests.java index 2ccd190b80f0..16b06ee81284 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FileSearchToolSerializationTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/models/FileSearchToolSerializationTests.java @@ -66,6 +66,8 @@ public void testMinimalDeserialization() throws IOException { assertNull(tool.getMaxResults()); assertNull(tool.getRankingOptions()); assertNull(tool.getFilters()); + assertNull(tool.getComparisonFilter()); + assertNull(tool.getCompoundFilter()); } @Test @@ -88,6 +90,18 @@ public void testDeserializationWithAllFields() throws IOException { assertNotNull(tool.getFilters()); } + @Test + public void testFilterGettersReturnNullForUnexpectedFilterShape() throws IOException { + String json + = "{\"type\":\"file_search\",\"vector_store_ids\":[\"vs_unknown\"]," + "\"filters\":{\"foo\":\"bar\"}}"; + + FileSearchTool tool = deserialize(json); + + assertNotNull(tool.getFilters()); + assertNull(tool.getComparisonFilter()); + assertNull(tool.getCompoundFilter()); + } + // ----------------------------------------------------------------------- // Round-trip // ----------------------------------------------------------------------- @@ -139,6 +153,12 @@ public void testSerializationWithComparisonFilter() throws IOException { FileSearchTool tool = new FileSearchTool(Collections.singletonList("vs_f1")).setComparisonFilter(filter); + ComparisonFilter retrievedFilter = tool.getComparisonFilter(); + assertNotNull(retrievedFilter); + assertEquals("category", retrievedFilter.key()); + assertEquals("science", retrievedFilter.value().asString()); + assertNull(tool.getCompoundFilter()); + String json = serialize(tool); assertTrue(json.contains("\"key\":\"category\""), "Missing key, got: " + json); @@ -163,6 +183,11 @@ public void testRoundTripWithComparisonFilter() throws IOException { assertEquals(original.getVectorStoreIds(), deserialized.getVectorStoreIds()); assertEquals(original.getMaxResults(), deserialized.getMaxResults()); assertNotNull(deserialized.getFilters()); + ComparisonFilter deserializedFilter = deserialized.getComparisonFilter(); + assertNotNull(deserializedFilter); + assertEquals("year", deserializedFilter.key()); + assertEquals(2020.0, deserializedFilter.value().asNumber()); + assertNull(deserialized.getCompoundFilter()); // Re-serialize and compare JSON String reserializedJson = serialize(deserialized); @@ -217,6 +242,12 @@ public void testSerializationWithCompoundFilter() throws IOException { FileSearchTool tool = new FileSearchTool(Collections.singletonList("vs_c1")).setCompoundFilter(filter); + CompoundFilter retrievedFilter = tool.getCompoundFilter(); + assertNotNull(retrievedFilter); + assertEquals(CompoundFilter.Type.AND, retrievedFilter.type()); + assertEquals(2, retrievedFilter.filters().size()); + assertNull(tool.getComparisonFilter()); + String json = serialize(tool); assertTrue(json.contains("\"key\":\"status\""), "Missing status key, got: " + json); @@ -241,6 +272,11 @@ public void testRoundTripWithCompoundFilter() throws IOException { FileSearchTool deserialized = deserialize(json); assertNotNull(deserialized.getFilters()); + CompoundFilter deserializedFilter = deserialized.getCompoundFilter(); + assertNotNull(deserializedFilter); + assertEquals(CompoundFilter.Type.OR, deserializedFilter.type()); + assertEquals(1, deserializedFilter.filters().size()); + assertNull(deserialized.getComparisonFilter()); String reserializedJson = serialize(deserialized); assertEquals(json, reserializedJson); diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java new file mode 100644 index 000000000000..ef5573a0423a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/toolboxes/ToolboxSamplesTests.java @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.toolboxes; + +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.ToolboxesAsyncClient; +import com.azure.ai.agents.ToolboxesClient; +import com.azure.ai.agents.models.McpTool; +import com.azure.ai.agents.models.Tool; +import com.azure.ai.agents.models.ToolType; +import com.azure.ai.agents.models.ToolboxSearchPreviewTool; +import com.azure.ai.agents.models.ToolboxVersionDetails; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpClient; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import static com.azure.core.test.TestProxyTestBase.getHttpClients; + +public class ToolboxSamplesTests extends ClientTestBase { + private static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + + static Stream getTestParameters() { + List argumentsList = new ArrayList<>(); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V1))); + return argumentsList.stream(); + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void toolboxSearchToolboxSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + ToolboxesClient toolboxesClient = getClientBuilder(httpClient, serviceVersion).buildToolboxesClient(); + String toolboxName = "toolbox-search-tool-java-test"; + + try { + toolboxesClient.deleteToolbox(toolboxName); + } catch (ResourceNotFoundException ignored) { + // The sample toolbox does not already exist. + } + + try { + ToolboxSearchPreviewTool toolboxSearchTool = new ToolboxSearchPreviewTool().setName("search_tools") + .setDescription("Search over available toolbox tools at runtime."); + + ToolboxVersionDetails version + = toolboxesClient.createToolboxVersion(toolboxName, Collections.singletonList(toolboxSearchTool), + "Toolbox version with a Toolbox Search preview tool.", null, null, null); + + Assertions.assertNotNull(version); + Assertions.assertEquals(toolboxName, version.getName()); + Assertions.assertFalse(version.getTools().isEmpty()); + Assertions.assertEquals(ToolType.TOOLBOX_SEARCH_PREVIEW, version.getTools().get(0).getType()); + } finally { + try { + toolboxesClient.deleteToolbox(toolboxName); + } catch (ResourceNotFoundException ignored) { + // The sample toolbox may not have been created. + } + } + } + + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void toolboxesAsyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + ToolboxesAsyncClient toolboxesAsyncClient = builder.buildToolboxesAsyncClient(); + String toolboxName = "toolbox-with-mcp-tool-java-async-test"; + + List toolsWithMcpApprovalNever = Collections + .singletonList(new McpTool("api_specs").setServerUrl("https://gitmcp.io/Azure/azure-rest-api-specs") + .setRequireApproval("never")); + + List toolsWithMcpApprovalAlways = Collections + .singletonList(new McpTool("api_specs").setServerUrl("https://gitmcp.io/Azure/azure-rest-api-specs") + .setRequireApproval("always")); + + Mono testFlow = toolboxesAsyncClient.deleteToolbox(toolboxName) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(toolboxesAsyncClient.createToolboxVersion(toolboxName, toolsWithMcpApprovalNever, + "Toolbox version with MCP require_approval set to 'never'.", null, null, null)) + .doOnNext(created -> { + Assertions.assertEquals(toolboxName, created.getName()); + Assertions.assertEquals("1", created.getVersion()); + }) + .then(toolboxesAsyncClient.createToolboxVersion(toolboxName, toolsWithMcpApprovalAlways, + "Toolbox version with MCP require_approval set to 'always'.", null, null, null)) + .doOnNext(created -> { + Assertions.assertEquals(toolboxName, created.getName()); + Assertions.assertEquals("2", created.getVersion()); + }) + .then(toolboxesAsyncClient.updateToolbox(toolboxName, "2")) + .flatMap(updated -> toolboxesAsyncClient.getToolboxVersion(updated.getName(), updated.getDefaultVersion())) + .doOnNext(version -> assertMcpRequireApproval(version, "always")) + .then(toolboxesAsyncClient.updateToolbox(toolboxName, "1")) + .flatMap(updated -> toolboxesAsyncClient.getToolboxVersion(updated.getName(), updated.getDefaultVersion())) + .doOnNext(version -> assertMcpRequireApproval(version, "never")) + .thenMany(toolboxesAsyncClient.listToolboxes().take(10)) + .filter(toolbox -> toolboxName.equals(toolbox.getName())) + .next() + .doOnNext(toolbox -> Assertions.assertEquals(toolboxName, toolbox.getName())) + .then(toolboxesAsyncClient.deleteToolbox(toolboxName)); + + StepVerifier.create(testFlow).verifyComplete(); + } + + private static void assertMcpRequireApproval(ToolboxVersionDetails version, String expectedApproval) { + Assertions.assertNotNull(version); + Assertions.assertFalse(version.getTools().isEmpty()); + Assertions.assertTrue(version.getTools().get(0) instanceof McpTool); + McpTool mcpTool = (McpTool) version.getTools().get(0); + Assertions.assertEquals(expectedApproval, mcpTool.getRequireApprovalAsString()); + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesAsyncTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesAsyncTests.java new file mode 100644 index 000000000000..e4e5c7cc30c5 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesAsyncTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ResponsesAsyncClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.core.http.HttpClient; +import com.openai.models.responses.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.parallel.ResourceLock; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.time.Duration; +import java.util.concurrent.TimeUnit; + +public class FabricIQSamplesAsyncTests extends FabricIQSamplesTestBase { + + @Timeout(value = 5, unit = TimeUnit.MINUTES) + @Disabled("getting 500 from service") + @ResourceLock(FABRIC_IQ_RESOURCE_LOCK) + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void fabricIqAsyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + ResponsesAsyncClient responsesAsyncClient = builder.buildResponsesAsyncClient(); + + String agentName = testResourceNamer.randomName("fabric-iq-async-", 40); + AgentVersionDetails agent + = agentsAsyncClient.createAgentVersion(agentName, createAgentDefinition()).block(Duration.ofMinutes(2)); + Assertions.assertNotNull(agent); + + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + Response response + = responsesAsyncClient + .createAzureResponse(new AzureCreateResponseOptions().setAgentReference(agentReference), + createResponseParams()) + .block(Duration.ofMinutes(3)); + + assertCompletedResponse(response); + agentsAsyncClient.deleteAgentVersion(agent.getName(), agent.getVersion()).block(Duration.ofMinutes(1)); + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTestBase.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTestBase.java new file mode 100644 index 000000000000..4d503036c901 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTestBase.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.models.FabricIqPreviewTool; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.core.test.TestMode; +import com.azure.core.util.Configuration; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.provider.Arguments; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import static com.azure.core.test.TestProxyTestBase.getHttpClients; + +abstract class FabricIQSamplesTestBase extends ClientTestBase { + static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + static final String FABRIC_IQ_RESOURCE_LOCK = "fabric-iq"; + + private static final String DEFAULT_USER_INPUT = "Tell me weather history in London, Ohio"; + + static Stream getTestParameters() { + List argumentsList = new ArrayList<>(); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V1))); + return argumentsList.stream(); + } + + PromptAgentDefinition createAgentDefinition() { + FabricIqPreviewTool fabricIqTool + = new FabricIqPreviewTool(getRecordedConfig("FABRIC_IQ_PROJECT_CONNECTION_ID")).setRequireApproval("never"); + + return new PromptAgentDefinition(getRecordedConfig("FOUNDRY_MODEL_NAME")) + .setInstructions("Use the available Fabric IQ tools to answer questions and perform tasks.") + .setTools(Collections.singletonList(fabricIqTool)); + } + + String getUserInput() { + return Configuration.getGlobalConfiguration().get("FABRIC_IQ_USER_INPUT", DEFAULT_USER_INPUT); + } + + ResponseCreateParams.Builder createResponseParams() { + return ResponseCreateParams.builder().input(getUserInput()); + } + + void assertCompletedResponse(Response response) { + Assertions.assertNotNull(response); + Assertions.assertTrue(response.status().isPresent()); + Assertions.assertEquals(ResponseStatus.COMPLETED, response.status().get()); + Assertions.assertFalse(response.output().isEmpty()); + Assertions.assertTrue(response.output().stream().anyMatch(item -> item.isMessage())); + } + + private String getRecordedConfig(String name) { + if (getTestMode() == TestMode.PLAYBACK) { + return testResourceNamer.recordValueFromConfig(name); + } + + String value = Configuration.getGlobalConfiguration().get(name); + if (getTestMode() == TestMode.RECORD) { + testResourceNamer.recordValueFromConfig(name); + } + return value; + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java new file mode 100644 index 000000000000..b4b3a331861d --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/FabricIQSamplesTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ResponsesClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.core.http.HttpClient; +import com.openai.models.responses.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.parallel.ResourceLock; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.concurrent.TimeUnit; + +public class FabricIQSamplesTests extends FabricIQSamplesTestBase { + + @Timeout(value = 5, unit = TimeUnit.MINUTES) + @Disabled("Requires FABRIC_IQ_PROJECT_CONNECTION_ID in work resources; service returned 500 when validating with the Fabric connection.") + @ResourceLock(FABRIC_IQ_RESOURCE_LOCK) + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void fabricIqSyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + ResponsesClient responsesClient = builder.buildResponsesClient(); + + String agentName = testResourceNamer.randomName("fabric-iq-sync-", 40); + AgentVersionDetails agent = agentsClient.createAgentVersion(agentName, createAgentDefinition()); + Assertions.assertNotNull(agent); + + try { + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + Response response = responsesClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), createResponseParams()); + + assertCompletedResponse(response); + } finally { + agentsClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesAsyncTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesAsyncTests.java new file mode 100644 index 000000000000..bbdd128b6cba --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesAsyncTests.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsAsyncClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ResponsesAsyncClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.core.http.HttpClient; +import com.openai.models.responses.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.parallel.ResourceLock; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.time.Duration; +import java.util.concurrent.TimeUnit; + +public class WorkIQSamplesAsyncTests extends WorkIQSamplesTestBase { + + @Timeout(value = 5, unit = TimeUnit.MINUTES) + @Disabled("Requires WORK_IQ_PROJECT_CONNECTION_ID, which is not available in the current Java work resources.") + @ResourceLock(WORK_IQ_RESOURCE_LOCK) + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void workIqAsyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsAsyncClient agentsAsyncClient = builder.buildAgentsAsyncClient(); + ResponsesAsyncClient responsesAsyncClient = builder.buildResponsesAsyncClient(); + + String agentName = testResourceNamer.randomName("work-iq-async-", 40); + AgentVersionDetails agent + = agentsAsyncClient.createAgentVersion(agentName, createAgentDefinition()).block(Duration.ofMinutes(2)); + Assertions.assertNotNull(agent); + + try { + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + Response response + = responsesAsyncClient + .createAzureResponse(new AzureCreateResponseOptions().setAgentReference(agentReference), + createResponseParams()) + .block(Duration.ofMinutes(3)); + + assertCompletedResponse(response); + } finally { + agentsAsyncClient.deleteAgentVersion(agent.getName(), agent.getVersion()).block(Duration.ofMinutes(1)); + } + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesTestBase.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesTestBase.java new file mode 100644 index 000000000000..8ab340729739 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesTestBase.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ClientTestBase; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.ai.agents.models.WorkIqPreviewTool; +import com.azure.core.test.TestMode; +import com.azure.core.util.Configuration; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseStatus; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.provider.Arguments; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Stream; + +import static com.azure.core.test.TestProxyTestBase.getHttpClients; + +abstract class WorkIQSamplesTestBase extends ClientTestBase { + static final String DISPLAY_NAME_WITH_ARGUMENTS = "{displayName} with [{arguments}]"; + static final String WORK_IQ_RESOURCE_LOCK = "work-iq"; + + private static final String DEFAULT_USER_INPUT = "Use Work IQ to summarize the available enterprise context."; + + static Stream getTestParameters() { + List argumentsList = new ArrayList<>(); + getHttpClients().forEach(httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V1))); + return argumentsList.stream(); + } + + PromptAgentDefinition createAgentDefinition() { + WorkIqPreviewTool workIqTool + = new WorkIqPreviewTool(getRecordedConfig("WORK_IQ_PROJECT_CONNECTION_ID")).setName("work_iq_lookup") + .setDescription("Use Work IQ to answer questions grounded in enterprise data."); + + return new PromptAgentDefinition(getRecordedConfig("FOUNDRY_MODEL_NAME")) + .setInstructions("Use the available Work IQ tools to answer questions and perform tasks.") + .setTools(Collections.singletonList(workIqTool)); + } + + String getUserInput() { + return Configuration.getGlobalConfiguration().get("WORK_IQ_USER_INPUT", DEFAULT_USER_INPUT); + } + + ResponseCreateParams.Builder createResponseParams() { + return ResponseCreateParams.builder().input(getUserInput()); + } + + void assertCompletedResponse(Response response) { + Assertions.assertNotNull(response); + Assertions.assertTrue(response.status().isPresent()); + Assertions.assertEquals(ResponseStatus.COMPLETED, response.status().get()); + Assertions.assertFalse(response.output().isEmpty()); + Assertions.assertTrue(response.output().stream().anyMatch(item -> item.isMessage())); + } + + private String getRecordedConfig(String name) { + if (getTestMode() == TestMode.PLAYBACK) { + return testResourceNamer.recordValueFromConfig(name); + } + + String value = Configuration.getGlobalConfiguration().get(name); + if (getTestMode() == TestMode.RECORD) { + testResourceNamer.recordValueFromConfig(name); + } + return value; + } +} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesTests.java new file mode 100644 index 000000000000..7fe762723016 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/tools/WorkIQSamplesTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents.tools; + +import com.azure.ai.agents.AgentsClient; +import com.azure.ai.agents.AgentsClientBuilder; +import com.azure.ai.agents.AgentsServiceVersion; +import com.azure.ai.agents.ResponsesClient; +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.AzureCreateResponseOptions; +import com.azure.core.http.HttpClient; +import com.openai.models.responses.Response; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.parallel.ResourceLock; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.concurrent.TimeUnit; + +public class WorkIQSamplesTests extends WorkIQSamplesTestBase { + + @Timeout(value = 5, unit = TimeUnit.MINUTES) + @Disabled("Requires WORK_IQ_PROJECT_CONNECTION_ID, which is not available in the current Java work resources.") + @ResourceLock(WORK_IQ_RESOURCE_LOCK) + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("getTestParameters") + public void workIqSyncSample(HttpClient httpClient, AgentsServiceVersion serviceVersion) { + AgentsClientBuilder builder = getClientBuilder(httpClient, serviceVersion); + AgentsClient agentsClient = builder.buildAgentsClient(); + ResponsesClient responsesClient = builder.buildResponsesClient(); + + String agentName = testResourceNamer.randomName("work-iq-sync-", 40); + AgentVersionDetails agent = agentsClient.createAgentVersion(agentName, createAgentDefinition()); + Assertions.assertNotNull(agent); + + try { + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + Response response = responsesClient.createAzureResponse( + new AzureCreateResponseOptions().setAgentReference(agentReference), createResponseParams()); + + assertCompletedResponse(response); + } finally { + agentsClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + } + } +} diff --git a/sdk/ai/azure-ai-agents/tsp-location.yaml.hide b/sdk/ai/azure-ai-agents/tsp-location.yaml similarity index 69% rename from sdk/ai/azure-ai-agents/tsp-location.yaml.hide rename to sdk/ai/azure-ai-agents/tsp-location.yaml index 41216b50f846..e572492cbca2 100644 --- a/sdk/ai/azure-ai-agents/tsp-location.yaml.hide +++ b/sdk/ai/azure-ai-agents/tsp-location.yaml @@ -1,5 +1,5 @@ directory: specification/ai-foundry/data-plane/Foundry/src/sdk-agents -commit: a833499a35901cdbbf8cd5dc637e3dc813d951c0 +commit: 36ed3f88fbc3da46c831e5f0acd4ff85ed163e1a repo: Azure/azure-rest-api-specs additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/agents @@ -7,7 +7,11 @@ additionalDirectories: - specification/ai-foundry/data-plane/Foundry/src/memory-stores - specification/ai-foundry/data-plane/Foundry/src/openai-conversations - specification/ai-foundry/data-plane/Foundry/src/openai-responses + - specification/ai-foundry/data-plane/Foundry/src/openai-evaluations - specification/ai-foundry/data-plane/Foundry/src/tools - specification/ai-foundry/data-plane/Foundry/src/servicepatterns.tsp - specification/ai-foundry/data-plane/Foundry/src/toolboxes - specification/ai-foundry/data-plane/Foundry/src/agents-session-files + - specification/ai-foundry/data-plane/Foundry/src/agents-optimization + - specification/ai-foundry/data-plane/Foundry/src/red-teams + - specification/ai-foundry/data-plane/Foundry/src/skills diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 538c93642766..088560537dce 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -1,15 +1,28 @@ # Release History -## 2.1.0-beta.2 (Unreleased) +## 2.1.0 (2026-05-29) ### Features Added +- Added new preview `DataGenerationJobsClient` and `DataGenerationJobsAsyncClient` sub-clients for creating, retrieving, listing, canceling, and deleting data generation jobs, with related data generation source, output, token usage, and options models. +- Added new preview `ModelsClient` and `ModelsAsyncClient` sub-clients for registering and managing model weights as Foundry `ModelVersion` resources, including pending upload, asynchronous model-version creation, listing, retrieving, updating, deleting, and credential retrieval operations. +- Added new preview `RoutinesClient` and `RoutinesAsyncClient` sub-clients for creating or updating routines, retrieving, enabling, disabling, listing, deleting, listing runs, and dispatching routines, with related routine trigger, action, dispatch payload, and run models. +- Added evaluator generation job operations to `EvaluatorsClient` and `EvaluatorsAsyncClient`, including create, get, list, cancel, and delete operations, plus evaluator pending-upload and credential helper operations. +- Added versioned skill management on `SkillsClient` and `SkillsAsyncClient`, including `createSkillVersion`, `createSkillVersionFromFiles`, `listSkillVersions`, `getSkillVersion`, `getSkillContent`, `getSkillVersionContent`, and `deleteSkillVersion`. +- Added `EvaluationsHelper` and Azure evaluator model types, such as `TestingCriterionAzureAIEvaluator` and `GraderAzureAIEvaluator`, to adapt Azure evaluator definitions to OpenAI evaluation request types. +- Added protocol-style `WithResponse` overloads with `RequestOptions` for connection retrieval and dataset file/folder upload helpers. +- Added new feature-flag values to `FoundryFeaturesOptInKeys`: `ROUTINES_V1_PREVIEW` (`Routines=V1Preview`), `DATA_GENERATION_JOBS_V1_PREVIEW` (`DataGenerationJobs=V1Preview`), `MODELS_V1_PREVIEW` (`Models=V1Preview`), and `AGENTS_OPTIMIZATION_V1_PREVIEW` (`AgentsOptimization=V1Preview`). + ### Breaking Changes -### Bugs Fixed +- The Skills API is now versioned. `SkillDetails` was removed and replaced by `Skill` and `SkillVersion`. Use `createSkillVersion` instead of `createSkill`, `createSkillVersionFromFiles` instead of `createSkillFromPackage`, `getSkillContent`/`getSkillVersionContent` instead of `downloadSkill`, and `deleteSkillVersion` for deleting a specific skill version. `updateSkill` now updates the default version only. +- The `body` parameter on `EvaluationTaxonomiesClient.createEvaluationTaxonomy`, `EvaluationTaxonomiesClient.updateEvaluationTaxonomy`, and their async counterparts was renamed to `taxonomy`. ### Other Changes +- Regenerated client from the updated TypeSpec specification. +- Added samples for data generation jobs, model management, evaluator helper usage, and packaged skill upload/download. + ## 2.1.0-beta.1 (2026-05-12) ### Features Added diff --git a/sdk/ai/azure-ai-projects/README.md b/sdk/ai/azure-ai-projects/README.md index d13bc458a8c7..6db388d1f46a 100644 --- a/sdk/ai/azure-ai-projects/README.md +++ b/sdk/ai/azure-ai-projects/README.md @@ -2,10 +2,14 @@ The AI Projects client library is part of the Azure AI Foundry SDK and provides easy access to resources in your Azure AI Foundry Project. Use it to: -* **Create and run Agents** using the separate package `com.azure.azure-ai-agents`. +* **Create and run Agents** using the separate package `com.azure:azure-ai-agents`. * **Enumerate AI Models** deployed to your Foundry Project using the `Deployments` operations. * **Enumerate connected Azure resources** in your Foundry project using the `Connections` operations. * **Upload documents and create Datasets** to reference them using the `Datasets` operations. +* **Generate datasets** for model, agent, evaluator, and traces scenarios using the preview `DataGenerationJobs` operations. +* **Register and manage model weights** as Foundry `ModelVersion` resources using the preview `Models` operations. +* **Create and dispatch routines** using the preview `Routines` operations. +* **Create and manage skills** using the preview `Skills` operations. * **Create and enumerate Search Indexes** using the `Indexes` operations. The client library uses a single service version `v1` of the AI Foundry [data plane REST APIs](https://aka.ms/azsdk/azure-ai-projects/ga-rest-api-reference). @@ -31,7 +35,7 @@ Various documentation is available to help you get started com.azure azure-ai-projects - 2.1.0-beta.1 + 2.1.0 ``` [//]: # ({x-version-update-end}) @@ -48,6 +52,7 @@ The Azure AI Foundry provides a centralized spot to manage your AI Foundry resou AIProjectClientBuilder builder = new AIProjectClientBuilder(); ConnectionsClient connectionsClient = builder.buildConnectionsClient(); +DataGenerationJobsClient dataGenerationJobsClient = builder.buildDataGenerationJobsClient(); DatasetsClient datasetsClient = builder.buildDatasetsClient(); DeploymentsClient deploymentsClient = builder.buildDeploymentsClient(); EvaluationRulesClient evaluationRulesClient = builder.buildEvaluationRulesClient(); @@ -55,7 +60,9 @@ EvaluationTaxonomiesClient evaluationTaxonomiesClient = builder.buildEvaluationT EvaluatorsClient evaluatorsClient = builder.buildEvaluatorsClient(); IndexesClient indexesClient = builder.buildIndexesClient(); InsightsClient insightsClient = builder.buildInsightsClient(); +ModelsClient modelsClient = builder.buildModelsClient(); RedTeamsClient redTeamsClient = builder.buildRedTeamsClient(); +RoutinesClient routinesClient = builder.buildRoutinesClient(); SchedulesClient schedulesClient = builder.buildSchedulesClient(); SkillsClient skillsClient = builder.buildSkillsClient(); ``` @@ -67,6 +74,24 @@ EvalService evalService = builder.buildOpenAIClient().evals(); EvalServiceAsync evalAsyncService = builder.buildOpenAIAsyncClient().evals(); ``` +When using Azure-specific evaluator models with OpenAI evaluations, use `EvaluationsHelper` to adapt the Azure model to +the OpenAI request type. This keeps application code from depending on the serialization details used by the OpenAI SDK. + +```java com.azure.ai.projects.evaluationsHelper +Map dataMapping = new LinkedHashMap<>(); +dataMapping.put("query", "{{item.query}}"); +dataMapping.put("response", "{{sample.output_text}}"); + +TestingCriterionAzureAIEvaluator coherenceEvaluator = new TestingCriterionAzureAIEvaluator("coherence", + "builtin.coherence") + .setInitializationParameters(Collections.singletonMap("deployment_name", + BinaryData.fromObject("gpt-4o-mini"))) + .setDataMapping(dataMapping); + +EvalCreateParams.TestingCriterion testingCriterion + = EvaluationsHelper.toTestingCriterion(coherenceEvaluator); +``` + For the Agents operation, you can use the `azure-ai-agents` package which is available as transitive dependency: ```java com.azure.ai.projects.agentsSubClients @@ -92,17 +117,18 @@ Several operation groups in the AI Projects client library are in **preview** an |---|---| | `EvaluatorsClient` | `Evaluations=V1Preview` | | `EvaluationTaxonomiesClient` | `Evaluations=V1Preview` | +| `ModelsClient` | `Models=V1Preview` | | `RedTeamsClient` | `RedTeams=V1Preview` | | `SchedulesClient` | `Schedules=V1Preview` | | `SkillsClient` | `Skills=V1Preview` | -The `EvaluationRulesClient` and `InsightsClient` also support the `Foundry-Features` header, but it is **not** automatically set. Instead, you can pass a `FoundryFeaturesOptInKeys` value when calling their methods (e.g., `generateInsight()`, `getInsight()`, `listInsights()`, or `createOrUpdateEvaluationRule()`). +The `DataGenerationJobsClient`, `RoutinesClient`, `EvaluationRulesClient`, and `InsightsClient` also support the `Foundry-Features` header, but it is **not** automatically set. Instead, you can pass a `FoundryFeaturesOptInKeys` value when calling methods that accept it (e.g., `FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW`, `FoundryFeaturesOptInKeys.ROUTINES_V1_PREVIEW`, `generateInsight()`, `getInsight()`, `listInsights()`, or `createOrUpdateEvaluationRule()`). -The `FoundryFeaturesOptInKeys` enum defines all known opt-in keys: `EVALUATIONS_V1_PREVIEW`, `SCHEDULES_V1_PREVIEW`, `RED_TEAMS_V1_PREVIEW`, `INSIGHTS_V1_PREVIEW`, `MEMORY_STORES_V1_PREVIEW`, `TOOLBOXES_V1_PREVIEW`, `SKILLS_V1_PREVIEW`. +The `FoundryFeaturesOptInKeys` enum defines all known opt-in keys: `EVALUATIONS_V1_PREVIEW`, `SCHEDULES_V1_PREVIEW`, `RED_TEAMS_V1_PREVIEW`, `INSIGHTS_V1_PREVIEW`, `MEMORY_STORES_V1_PREVIEW`, `ROUTINES_V1_PREVIEW`, `TOOLBOXES_V1_PREVIEW`, `SKILLS_V1_PREVIEW`, `DATA_GENERATION_JOBS_V1_PREVIEW`, `MODELS_V1_PREVIEW`, `AGENTS_OPTIMIZATION_V1_PREVIEW`. ## Examples -The examples below show common operations for each AI Projects sub-client. For complete runnable samples, see the [package samples][package_samples]. +The examples below show common operations for core AI Projects sub-clients. For complete runnable samples, see the [package samples][package_samples]. Additional preview samples are available for data generation jobs (`DataGenerationJobsSample`, `DataGenerationJobsAsyncSample`, and `DataGenerationJobWithEvaluationSample`), model management (`ModelsSample` and `ModelsAsyncSample`), and packaged skills (`SkillsPackageSample` and `SkillsPackageAsyncSample`). ### Connections operations @@ -630,21 +656,17 @@ Skills are a preview feature. The `SkillsClient` automatically sets the `Skills= #### Create a skill -```java com.azure.ai.projects.SkillsSample.createSkill +```java com.azure.ai.projects.SkillsSample.createSkillVersion -Map metadata = new HashMap<>(); -metadata.put("domain", "support"); - -SkillDetails skill = skillsClient.createSkill( - "product-support-skill", +SkillInlineContent inlineContent = new SkillInlineContent( "Answers product support questions using company policy.", - "You help answer product support questions using company policy and product guidance.", - metadata + "You help answer product support questions using company policy and product guidance." ); -System.out.println("Created skill: " + skill.getName()); -System.out.println("Skill ID: " + skill.getSkillId()); -System.out.println("Blob present: " + skill.isBlobPresent()); +SkillVersion skillVersion = skillsClient.createSkillVersion("product-support-skill", inlineContent, true); + +System.out.println("Created skill version: " + skillVersion.getName()); +System.out.println("Version: " + skillVersion.getVersion()); ``` @@ -653,11 +675,11 @@ System.out.println("Blob present: " + skill.isBlobPresent()); ```java com.azure.ai.projects.SkillsSample.getSkill String skillName = "product-support-skill"; -SkillDetails skill = skillsClient.getSkill(skillName); +Skill skill = skillsClient.getSkill(skillName); System.out.println("Skill name: " + skill.getName()); -System.out.println("Skill ID: " + skill.getSkillId()); System.out.println("Description: " + skill.getDescription()); +System.out.println("Default version: " + skill.getDefaultVersion()); ``` @@ -667,20 +689,10 @@ System.out.println("Description: " + skill.getDescription()); String skillName = "product-support-skill"; -Map metadata = new HashMap<>(); -metadata.put("domain", "support"); -metadata.put("status", "updated"); - -SkillDetails updated = skillsClient.updateSkill( - skillName, - "Updated description for the sample skill.", - null, - metadata -); +Skill updated = skillsClient.updateSkill(skillName, "2"); System.out.println("Updated skill: " + updated.getName()); -System.out.println("Description: " + updated.getDescription()); -System.out.println("Metadata: " + updated.getMetadata()); +System.out.println("Default version: " + updated.getDefaultVersion()); ``` @@ -688,11 +700,10 @@ System.out.println("Metadata: " + updated.getMetadata()); ```java com.azure.ai.projects.SkillsSample.listSkills -PagedIterable skills = skillsClient.listSkills(); -for (SkillDetails skill : skills) { +PagedIterable skills = skillsClient.listSkills(); +for (Skill skill : skills) { System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); + System.out.println("Description: " + skill.getDescription()); System.out.println("-------------------------------------------------"); } @@ -711,21 +722,18 @@ System.out.println("Deleted skill: " + skillName); #### Asynchronous skills operations -```java com.azure.ai.projects.SkillsAsyncSample.createSkill +```java com.azure.ai.projects.SkillsAsyncSample.createSkillVersion -Map metadata = new HashMap<>(); -metadata.put("domain", "support"); - -return skillsAsyncClient.createSkill( - "product-support-skill", +SkillInlineContent inlineContent = new SkillInlineContent( "Answers product support questions using company policy.", - "You help answer product support questions using company policy and product guidance.", - metadata -).doOnNext(skill -> { - System.out.println("Created skill: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); -}); + "You help answer product support questions using company policy and product guidance." +); + +return skillsAsyncClient.createSkillVersion("product-support-skill", inlineContent, true) + .doOnNext(skillVersion -> { + System.out.println("Created skill version: " + skillVersion.getName()); + System.out.println("Version: " + skillVersion.getVersion()); + }); ``` @@ -736,8 +744,8 @@ String skillName = "product-support-skill"; return skillsAsyncClient.getSkill(skillName) .doOnNext(skill -> { System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); System.out.println("Description: " + skill.getDescription()); + System.out.println("Default version: " + skill.getDefaultVersion()); }); ``` @@ -746,20 +754,11 @@ return skillsAsyncClient.getSkill(skillName) String skillName = "product-support-skill"; -Map metadata = new HashMap<>(); -metadata.put("domain", "support"); -metadata.put("status", "updated"); - -return skillsAsyncClient.updateSkill( - skillName, - "Updated description for the sample skill.", - null, - metadata -).doOnNext(updated -> { - System.out.println("Updated skill: " + updated.getName()); - System.out.println("Description: " + updated.getDescription()); - System.out.println("Metadata: " + updated.getMetadata()); -}); +return skillsAsyncClient.updateSkill(skillName, "2") + .doOnNext(updated -> { + System.out.println("Updated skill: " + updated.getName()); + System.out.println("Default version: " + updated.getDefaultVersion()); + }); ``` @@ -768,8 +767,7 @@ return skillsAsyncClient.updateSkill( return skillsAsyncClient.listSkills() .doOnNext(skill -> { System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); + System.out.println("Description: " + skill.getDescription()); System.out.println("-------------------------------------------------"); }); diff --git a/sdk/ai/azure-ai-projects/assets.json b/sdk/ai/azure-ai-projects/assets.json index dcc3df11c8e3..3f4aa5692135 100644 --- a/sdk/ai/azure-ai-projects/assets.json +++ b/sdk/ai/azure-ai-projects/assets.json @@ -1 +1 @@ -{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/ai/azure-ai-projects","Tag": "java/ai/azure-ai-projects_cd9e4bffa9"} \ No newline at end of file +{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/ai/azure-ai-projects","Tag": "java/ai/azure-ai-projects_1d956abc13"} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/checkstyle-suppressions.xml b/sdk/ai/azure-ai-projects/checkstyle-suppressions.xml index b3e38d331800..6d17740fdcdd 100644 --- a/sdk/ai/azure-ai-projects/checkstyle-suppressions.xml +++ b/sdk/ai/azure-ai-projects/checkstyle-suppressions.xml @@ -6,4 +6,9 @@ + + + + + diff --git a/sdk/ai/azure-ai-projects/pom.xml b/sdk/ai/azure-ai-projects/pom.xml index 742eb83f9ba9..5fc0c5642698 100644 --- a/sdk/ai/azure-ai-projects/pom.xml +++ b/sdk/ai/azure-ai-projects/pom.xml @@ -14,7 +14,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator. com.azure azure-ai-projects - 2.1.0-beta.2 + 2.1.0 jar Microsoft Azure SDK for Projects @@ -52,6 +52,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator. --add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED --add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED + false @@ -72,7 +73,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator. com.azure azure-ai-agents - 2.1.0-beta.2 + 2.1.0 com.openai diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/AIProjectClientBuilder.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/AIProjectClientBuilder.java index 21fef4cc8a45..289459572f6d 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/AIProjectClientBuilder.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/AIProjectClientBuilder.java @@ -54,6 +54,7 @@ ConnectionsClient.class, DatasetsClient.class, IndexesClient.class, + ModelsClient.class, DeploymentsClient.class, RedTeamsClient.class, EvaluationRulesClient.class, @@ -61,10 +62,13 @@ EvaluatorsClient.class, InsightsClient.class, SchedulesClient.class, + RoutinesClient.class, SkillsClient.class, + DataGenerationJobsClient.class, ConnectionsAsyncClient.class, DatasetsAsyncClient.class, IndexesAsyncClient.class, + ModelsAsyncClient.class, DeploymentsAsyncClient.class, RedTeamsAsyncClient.class, EvaluationRulesAsyncClient.class, @@ -72,7 +76,9 @@ EvaluatorsAsyncClient.class, InsightsAsyncClient.class, SchedulesAsyncClient.class, - SkillsAsyncClient.class }) + RoutinesAsyncClient.class, + SkillsAsyncClient.class, + DataGenerationJobsAsyncClient.class }) public final class AIProjectClientBuilder implements HttpTrait, ConfigurationTrait, TokenCredentialTrait, EndpointTrait { @@ -648,4 +654,64 @@ public SkillsAsyncClient buildSkillsAsyncClient() { public SkillsClient buildSkillsClient() { return new SkillsClient(buildInnerClient().getSkills()); } + + /** + * Builds an instance of ModelsAsyncClient class. + * + * @return an instance of ModelsAsyncClient. + */ + @Generated + public ModelsAsyncClient buildModelsAsyncClient() { + return new ModelsAsyncClient(buildInnerClient().getModels()); + } + + /** + * Builds an instance of ModelsClient class. + * + * @return an instance of ModelsClient. + */ + @Generated + public ModelsClient buildModelsClient() { + return new ModelsClient(buildInnerClient().getModels()); + } + + /** + * Builds an instance of RoutinesAsyncClient class. + * + * @return an instance of RoutinesAsyncClient. + */ + @Generated + public RoutinesAsyncClient buildRoutinesAsyncClient() { + return new RoutinesAsyncClient(buildInnerClient().getRoutines()); + } + + /** + * Builds an instance of DataGenerationJobsAsyncClient class. + * + * @return an instance of DataGenerationJobsAsyncClient. + */ + @Generated + public DataGenerationJobsAsyncClient buildDataGenerationJobsAsyncClient() { + return new DataGenerationJobsAsyncClient(buildInnerClient().getDataGenerationJobs()); + } + + /** + * Builds an instance of RoutinesClient class. + * + * @return an instance of RoutinesClient. + */ + @Generated + public RoutinesClient buildRoutinesClient() { + return new RoutinesClient(buildInnerClient().getRoutines()); + } + + /** + * Builds an instance of DataGenerationJobsClient class. + * + * @return an instance of DataGenerationJobsClient. + */ + @Generated + public DataGenerationJobsClient buildDataGenerationJobsClient() { + return new DataGenerationJobsClient(buildInnerClient().getDataGenerationJobs()); + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsAsyncClient.java index 66ea7f5271ab..3d4e068e4ab4 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsAsyncClient.java @@ -118,6 +118,28 @@ Mono> getConnectionWithCredentialsWithResponse(String name, return this.serviceClient.getConnectionWithCredentialsWithResponseAsync(name, requestOptions); } + /** + * Get a connection by name. + * + * @param name The friendly name of the connection, provided by the user. + * @param includeCredentials Whether to include connection credentials in the response. + * @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 a connection by name along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getConnectionWithResponse(String name, boolean includeCredentials, + RequestOptions requestOptions) { + if (includeCredentials) { + return getConnectionWithCredentialsWithResponse(name, requestOptions); + } else { + return getConnectionWithResponse(name, requestOptions); + } + } + /** * List all connections in the project, without populating connection credentials. *

Query Parameters

@@ -290,11 +312,9 @@ public PagedFlux listConnections() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getConnection(String name, boolean includeCredentials) { - if (includeCredentials) { - return getConnectionWithCredentials(name); - } else { - return getConnection(name); - } + RequestOptions requestOptions = new RequestOptions(); + return getConnectionWithResponse(name, includeCredentials, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Connection.class)); } /** diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsClient.java index 4f08b3f55ff6..e6db4006e3b6 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ConnectionsClient.java @@ -113,6 +113,28 @@ Response getConnectionWithCredentialsWithResponse(String name, Reque return this.serviceClient.getConnectionWithCredentialsWithResponse(name, requestOptions); } + /** + * Get a connection by name. + * + * @param name The friendly name of the connection, provided by the user. + * @param includeCredentials Whether to include connection credentials in the response. + * @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 a connection by name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getConnectionWithResponse(String name, boolean includeCredentials, + RequestOptions requestOptions) { + if (includeCredentials) { + return getConnectionWithCredentialsWithResponse(name, requestOptions); + } else { + return getConnectionWithResponse(name, requestOptions); + } + } + /** * List all connections in the project, without populating connection credentials. *

Query Parameters

@@ -261,11 +283,9 @@ public PagedIterable listConnections() { */ @ServiceMethod(returns = ReturnType.SINGLE) public Connection getConnection(String name, boolean includeCredentials) { - if (includeCredentials) { - return getConnectionWithCredentials(name); - } else { - return getConnection(name); - } + RequestOptions requestOptions = new RequestOptions(); + return getConnectionWithResponse(name, includeCredentials, requestOptions).getValue() + .toObject(Connection.class); } /** diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DataGenerationJobsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DataGenerationJobsAsyncClient.java new file mode 100644 index 000000000000..6bc7d04834aa --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DataGenerationJobsAsyncClient.java @@ -0,0 +1,847 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.implementation.DataGenerationJobsImpl; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.FluxUtil; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous AIProjectClient type. + */ +@ServiceClient(builder = AIProjectClientBuilder.class, isAsync = true) +public final class DataGenerationJobsAsyncClient { + + @Generated + private final DataGenerationJobsImpl serviceClient; + + /** + * Initializes an instance of DataGenerationJobsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + DataGenerationJobsAsyncClient(DataGenerationJobsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about a data generation job. + * + * Gets the details of a data generation job by its ID along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.getGenerationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGenerationJobs(RequestOptions requestOptions) { + return this.serviceClient.listGenerationJobsAsync(requestOptions); + } + + /** + * Creates a data generation job. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (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 data Generation Job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createGenerationJobWithResponse(BinaryData job, RequestOptions requestOptions) { + return this.serviceClient.createGenerationJobWithResponseAsync(job, requestOptions); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 data Generation Job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelGenerationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.deleteGenerationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + * + * @param jobId The ID of the job. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about a data generation job. + * + * Gets the details of a data generation job by its ID on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)); + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + * + * @param jobId The ID of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about a data generation job. + * + * Gets the details of a data generation job by its ID on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGenerationJob(String jobId) { + // Generated convenience method for getGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGenerationJobs() { + // Generated convenience method for listGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listGenerationJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Creates a data generation job. + * + * @param job The job to create. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job + * unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createGenerationJob(DataGenerationJob job, FoundryFeaturesOptInKeys foundryFeatures, + String operationId) { + // Generated convenience method for createGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (operationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); + } + return createGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)); + } + + /** + * Creates a data generation job. + * + * @param job The job to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createGenerationJob(DataGenerationJob job) { + // Generated convenience method for createGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for cancelGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return cancelGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelGenerationJob(String jobId) { + // Generated convenience method for cancelGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + * + * @param jobId The ID of the job to delete. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for deleteGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return deleteGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + * + * @param jobId The ID of the job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteGenerationJob(String jobId) { + // Generated convenience method for deleteGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGenerationJobs(FoundryFeaturesOptInKeys foundryFeatures, Integer limit, + PageOrder order, String after, String before) { + // Generated convenience method for listGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listGenerationJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(DataGenerationJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DataGenerationJobsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DataGenerationJobsClient.java new file mode 100644 index 000000000000..46c9617afbce --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DataGenerationJobsClient.java @@ -0,0 +1,812 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.implementation.DataGenerationJobsImpl; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** + * Initializes a new instance of the synchronous AIProjectClient type. + */ +@ServiceClient(builder = AIProjectClientBuilder.class) +public final class DataGenerationJobsClient { + + @Generated + private final DataGenerationJobsImpl serviceClient; + + /** + * Initializes an instance of DataGenerationJobsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + DataGenerationJobsClient(DataGenerationJobsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about a data generation job. + * + * Gets the details of a data generation job by its ID along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.getGenerationJobWithResponse(jobId, requestOptions); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGenerationJobs(RequestOptions requestOptions) { + return this.serviceClient.listGenerationJobs(requestOptions); + } + + /** + * Creates a data generation job. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (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 data Generation Job resource along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createGenerationJobWithResponse(BinaryData job, RequestOptions requestOptions) { + return this.serviceClient.createGenerationJobWithResponse(job, requestOptions); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 data Generation Job resource along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelGenerationJobWithResponse(jobId, requestOptions); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.deleteGenerationJobWithResponse(jobId, requestOptions); + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + * + * @param jobId The ID of the job. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about a data generation job. + * + * Gets the details of a data generation job by its ID. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DataGenerationJob getGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getGenerationJobWithResponse(jobId, requestOptions).getValue().toObject(DataGenerationJob.class); + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + * + * @param jobId The ID of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about a data generation job. + * + * Gets the details of a data generation job by its ID. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DataGenerationJob getGenerationJob(String jobId) { + // Generated convenience method for getGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getGenerationJobWithResponse(jobId, requestOptions).getValue().toObject(DataGenerationJob.class); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGenerationJobs() { + // Generated convenience method for listGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listGenerationJobs(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DataGenerationJob.class)); + } + + /** + * Creates a data generation job. + * + * @param job The job to create. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job + * unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DataGenerationJob createGenerationJob(DataGenerationJob job, FoundryFeaturesOptInKeys foundryFeatures, + String operationId) { + // Generated convenience method for createGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (operationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); + } + return createGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue() + .toObject(DataGenerationJob.class); + } + + /** + * Creates a data generation job. + * + * @param job The job to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DataGenerationJob createGenerationJob(DataGenerationJob job) { + // Generated convenience method for createGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue() + .toObject(DataGenerationJob.class); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DataGenerationJob cancelGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for cancelGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return cancelGenerationJobWithResponse(jobId, requestOptions).getValue().toObject(DataGenerationJob.class); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return data Generation Job resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DataGenerationJob cancelGenerationJob(String jobId) { + // Generated convenience method for cancelGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelGenerationJobWithResponse(jobId, requestOptions).getValue().toObject(DataGenerationJob.class); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + * + * @param jobId The ID of the job to delete. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for deleteGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + deleteGenerationJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + * + * @param jobId The ID of the job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteGenerationJob(String jobId) { + // Generated convenience method for deleteGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteGenerationJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGenerationJobs(FoundryFeaturesOptInKeys foundryFeatures, Integer limit, + PageOrder order, String after, String before) { + // Generated convenience method for listGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listGenerationJobs(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(DataGenerationJob.class)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsAsyncClient.java index 07001d10455f..7b818e5f23d8 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsAsyncClient.java @@ -125,7 +125,7 @@ public Mono getCredentials(String name, String version) { * @param version The specific version id of the DatasetVersion to create or replace. * @param filePath The path to the file to upload. * @return A Mono that completes with a FileDatasetVersion representing the created dataset. - * @throws IllegalArgumentException If the provided path is not a file + * @throws IllegalArgumentException If the provided path is not a file. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createDatasetWithFile(String name, String version, Path filePath) { @@ -141,11 +141,58 @@ public Mono createDatasetWithFile(String name, String versio * @param connectionName The name of an Azure Storage Account connection to use for uploading. * If null, the default Azure Storage Account connection will be used. * @return A Mono that completes with a FileDatasetVersion representing the created dataset. - * @throws IllegalArgumentException If the provided path is not a file + * @throws IllegalArgumentException If the provided path is not a file. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createDatasetWithFile(String name, String version, Path filePath, String connectionName) { + RequestOptions requestOptions = new RequestOptions(); + return createDatasetWithFileWithResponse(name, version, filePath, connectionName, requestOptions) + .flatMap(FluxUtil::toMono) + .map(data -> data.toObject(FileDatasetVersion.class)); + } + + /** + * Creates a dataset from a file. Uploads the file to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param filePath The path to the file to upload. + * @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 A FileDatasetVersion representing the created dataset along with {@link Response} on successful + * completion of {@link Mono}. + * @throws IllegalArgumentException If the provided path is not a file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createDatasetWithFileWithResponse(String name, String version, Path filePath, + RequestOptions requestOptions) { + return createDatasetWithFileWithResponse(name, version, filePath, null, requestOptions); + } + + /** + * Creates a dataset from a single file. Uploads the file to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param filePath The path to the file to upload. + * @param connectionName The name of an Azure Storage Account connection to use for uploading. + * If null, the default Azure Storage Account connection will be used. + * @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 A FileDatasetVersion representing the created dataset along with {@link Response} on successful + * completion of {@link Mono}. + * @throws IllegalArgumentException If the provided path is not a file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createDatasetWithFileWithResponse(String name, String version, Path filePath, + String connectionName, RequestOptions requestOptions) { if (!Files.isRegularFile(filePath)) { return Mono.error(new IllegalArgumentException("The provided path is not a file: " + filePath)); } @@ -153,21 +200,21 @@ public Mono createDatasetWithFile(String name, String versio if (connectionName != null) { request.setConnectionName(connectionName); } - return this.pendingUpload(name, version, request).flatMap(pendingUploadResponse -> { - String sasUri = pendingUploadResponse.getBlobReference().getCredential().getSasUrl(); - BlobAsyncClient blobClient = new BlobClientBuilder().endpoint(sasUri) - .blobName(filePath.getFileName().toString()) - .buildAsyncClient(); - return blobClient.upload(BinaryData.fromFile(filePath), true).thenReturn(blobClient.getBlobUrl()); - }).flatMap(blobUrl -> { - RequestOptions requestOptions = new RequestOptions(); - FileDatasetVersion fileDataset = new FileDatasetVersion().setDataUrl(blobUrl); - return this - .createOrUpdateDatasetVersionWithResponse(name, version, BinaryData.fromObject(fileDataset), - requestOptions) - .flatMap(FluxUtil::toMono) - .map(data -> data.toObject(FileDatasetVersion.class)); - }); + return this.pendingUploadWithResponse(name, version, BinaryData.fromObject(request), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PendingUploadResponse.class)) + .flatMap(pendingUploadResponse -> { + String sasUri = pendingUploadResponse.getBlobReference().getCredential().getSasUrl(); + BlobAsyncClient blobClient = new BlobClientBuilder().endpoint(sasUri) + .blobName(filePath.getFileName().toString()) + .buildAsyncClient(); + return blobClient.upload(BinaryData.fromFile(filePath), true).thenReturn(blobClient.getBlobUrl()); + }) + .flatMap(blobUrl -> { + FileDatasetVersion fileDataset = new FileDatasetVersion().setDataUrl(blobUrl); + return this.createOrUpdateDatasetVersionWithResponse(name, version, BinaryData.fromObject(fileDataset), + requestOptions); + }); } /** @@ -198,6 +245,53 @@ public Mono createDatasetWithFolder(String name, String ve @ServiceMethod(returns = ReturnType.SINGLE) public Mono createDatasetWithFolder(String name, String version, Path folderPath, String connectionName) { + RequestOptions requestOptions = new RequestOptions(); + return createDatasetWithFolderWithResponse(name, version, folderPath, connectionName, requestOptions) + .flatMap(FluxUtil::toMono) + .map(data -> data.toObject(FolderDatasetVersion.class)); + } + + /** + * Creates a dataset from a folder. Uploads all files in the folder to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param folderPath The path to the folder containing files to upload. + * @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 A FolderDatasetVersion representing the created dataset along with {@link Response} on successful + * completion of {@link Mono}. + * @throws IllegalArgumentException If the provided path is not a directory. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createDatasetWithFolderWithResponse(String name, String version, Path folderPath, + RequestOptions requestOptions) { + return createDatasetWithFolderWithResponse(name, version, folderPath, null, requestOptions); + } + + /** + * Creates a dataset from a folder. Uploads all files in the folder to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param folderPath The path to the folder containing files to upload. + * @param connectionName The name of an Azure Storage Account connection to use for uploading. + * If null, the default Azure Storage Account connection will be used. + * @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 A FolderDatasetVersion representing the created dataset along with {@link Response} on successful + * completion of {@link Mono}. + * @throws IllegalArgumentException If the provided path is not a directory. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createDatasetWithFolderWithResponse(String name, String version, Path folderPath, + String connectionName, RequestOptions requestOptions) { if (!Files.isDirectory(folderPath)) { return Mono.error(new IllegalArgumentException("The provided path is not a folder: " + folderPath)); } @@ -205,34 +299,35 @@ public Mono createDatasetWithFolder(String name, String ve if (connectionName != null) { request.setConnectionName(connectionName); } - return this.pendingUpload(name, version, request).flatMap(pendingUploadResponse -> { - String containerUrl = pendingUploadResponse.getBlobReference().getBlobUrl(); - String sasUri = pendingUploadResponse.getBlobReference().getCredential().getSasUrl(); - BlobContainerAsyncClient containerClient - = new BlobContainerClientBuilder().endpoint(sasUri).buildAsyncClient(); - try { - List files; - try (Stream fileStream = Files.walk(folderPath)) { - files = fileStream.filter(Files::isRegularFile).collect(Collectors.toList()); + return this.pendingUploadWithResponse(name, version, BinaryData.fromObject(request), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PendingUploadResponse.class)) + .flatMap(pendingUploadResponse -> { + String containerUrl = pendingUploadResponse.getBlobReference().getBlobUrl(); + String sasUri = pendingUploadResponse.getBlobReference().getCredential().getSasUrl(); + BlobContainerAsyncClient containerClient + = new BlobContainerClientBuilder().endpoint(sasUri).buildAsyncClient(); + try { + List files; + try (Stream fileStream = Files.walk(folderPath)) { + files = fileStream.filter(Files::isRegularFile).collect(Collectors.toList()); + } + return Flux.fromIterable(files).flatMap(filePath -> { + String relativePath = folderPath.relativize(filePath).toString().replace('\\', '/'); + return containerClient.getBlobAsyncClient(relativePath) + .upload(BinaryData.fromFile(filePath), true); + }).then(Mono.just(containerUrl)); + } catch (IOException e) { + return Mono.error(new UncheckedIOException("Failed to walk folder path: " + folderPath, e)); + } catch (RuntimeException e) { + return Mono.error(e); } - return Flux.fromIterable(files).flatMap(filePath -> { - String relativePath = folderPath.relativize(filePath).toString().replace('\\', '/'); - return containerClient.getBlobAsyncClient(relativePath).upload(BinaryData.fromFile(filePath), true); - }).then(Mono.just(containerUrl)); - } catch (IOException e) { - return Mono.error(new UncheckedIOException("Failed to walk folder path: " + folderPath, e)); - } catch (RuntimeException e) { - return Mono.error(e); - } - }).flatMap(containerUrl -> { - RequestOptions requestOptions = new RequestOptions(); - FolderDatasetVersion folderDataset = new FolderDatasetVersion().setDataUrl(containerUrl); - return this - .createOrUpdateDatasetVersionWithResponse(name, version, BinaryData.fromObject(folderDataset), - requestOptions) - .flatMap(FluxUtil::toMono) - .map(data -> data.toObject(FolderDatasetVersion.class)); - }); + }) + .flatMap(containerUrl -> { + FolderDatasetVersion folderDataset = new FolderDatasetVersion().setDataUrl(containerUrl); + return this.createOrUpdateDatasetVersionWithResponse(name, version, + BinaryData.fromObject(folderDataset), requestOptions); + }); } /** @@ -244,7 +339,7 @@ public Mono createDatasetWithFolder(String name, String ve * { * pendingUploadId: String (Optional) * connectionName: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
@@ -264,7 +359,7 @@ public Mono createDatasetWithFolder(String name, String ve * } * pendingUploadId: String (Required) * version: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsClient.java index b5e0286aab97..bdb9163e355d 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/DatasetsClient.java @@ -113,13 +113,13 @@ public DatasetCredential getCredentials(String name, String version) { } /** - * Creates a dataset from a folder. + * Creates a dataset from a file. * * @param name The name of the resource. * @param version The specific version id of the DatasetVersion to create or replace. - * @param filePath The path to the folder containing files to upload. + * @param filePath The path to the file to upload. * @return A FileDatasetVersion representing the created dataset. - * @throws IllegalArgumentException If the provided path is not a file + * @throws IllegalArgumentException If the provided path is not a file. */ @ServiceMethod(returns = ReturnType.SINGLE) public FileDatasetVersion createDatasetWithFile(String name, String version, Path filePath) { @@ -139,6 +139,50 @@ public FileDatasetVersion createDatasetWithFile(String name, String version, Pat */ @ServiceMethod(returns = ReturnType.SINGLE) public FileDatasetVersion createDatasetWithFile(String name, String version, Path filePath, String connectionName) { + RequestOptions requestOptions = new RequestOptions(); + return createDatasetWithFileWithResponse(name, version, filePath, connectionName, requestOptions).getValue() + .toObject(FileDatasetVersion.class); + } + + /** + * Creates a dataset from a file. Uploads the file to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param filePath The path to the file to upload. + * @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 A FileDatasetVersion representing the created dataset along with {@link Response}. + * @throws IllegalArgumentException If the provided path is not a file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createDatasetWithFileWithResponse(String name, String version, Path filePath, + RequestOptions requestOptions) { + return createDatasetWithFileWithResponse(name, version, filePath, null, requestOptions); + } + + /** + * Creates a dataset from a single file. Uploads the file to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param filePath The path to the file to upload. + * @param connectionName The name of an Azure Storage Account connection to use for uploading. + * If null, the default Azure Storage Account connection will be used. + * @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 A FileDatasetVersion representing the created dataset along with {@link Response}. + * @throws IllegalArgumentException If the provided path is not a file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createDatasetWithFileWithResponse(String name, String version, Path filePath, + String connectionName, RequestOptions requestOptions) { if (!Files.isRegularFile(filePath)) { throw LOGGER .logThrowableAsError(new IllegalArgumentException("The provided path is not a file: " + filePath)); @@ -147,19 +191,17 @@ public FileDatasetVersion createDatasetWithFile(String name, String version, Pat if (connectionName != null) { body.setConnectionName(connectionName); } - PendingUploadResponse pendingUploadResponse = this.pendingUpload(name, version, body); + PendingUploadResponse pendingUploadResponse + = this.pendingUploadWithResponse(name, version, BinaryData.fromObject(body), requestOptions) + .getValue() + .toObject(PendingUploadResponse.class); BlobReferenceSasCredential credential = pendingUploadResponse.getBlobReference().getCredential(); BlobClient blobClient = new BlobClientBuilder().endpoint(credential.getSasUrl()) .blobName(filePath.getFileName().toString()) .buildClient(); blobClient.upload(BinaryData.fromFile(filePath), true); - RequestOptions requestOptions = new RequestOptions(); - FileDatasetVersion datasetVersion = this - .createOrUpdateDatasetVersionWithResponse(name, version, - BinaryData.fromObject(new FileDatasetVersion().setDataUrl(blobClient.getBlobUrl())), requestOptions) - .getValue() - .toObject(FileDatasetVersion.class); - return datasetVersion; + return this.createOrUpdateDatasetVersionWithResponse(name, version, + BinaryData.fromObject(new FileDatasetVersion().setDataUrl(blobClient.getBlobUrl())), requestOptions); } /** @@ -170,7 +212,7 @@ public FileDatasetVersion createDatasetWithFile(String name, String version, Pat * @param folderPath The path to the folder containing files to upload. * @return A FolderDatasetVersion representing the created dataset. * @throws IllegalArgumentException If the provided path is not a directory. - * @throws UncheckedIOException if an I/ O error is thrown when accessing the starting file + * @throws UncheckedIOException if an I/O error is thrown when accessing the starting file. */ @ServiceMethod(returns = ReturnType.SINGLE) public FolderDatasetVersion createDatasetWithFolder(String name, String version, Path folderPath) { @@ -187,11 +229,57 @@ public FolderDatasetVersion createDatasetWithFolder(String name, String version, * If null, the default Azure Storage Account connection will be used. * @return A FolderDatasetVersion representing the created dataset. * @throws IllegalArgumentException If the provided path is not a directory. - * @throws UncheckedIOException if an I/O error is thrown when accessing the starting file + * @throws UncheckedIOException if an I/O error is thrown when accessing the starting file. */ @ServiceMethod(returns = ReturnType.SINGLE) public FolderDatasetVersion createDatasetWithFolder(String name, String version, Path folderPath, String connectionName) { + RequestOptions requestOptions = new RequestOptions(); + return createDatasetWithFolderWithResponse(name, version, folderPath, connectionName, requestOptions).getValue() + .toObject(FolderDatasetVersion.class); + } + + /** + * Creates a dataset from a folder. Uploads all files in the folder to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param folderPath The path to the folder containing files to upload. + * @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 A FolderDatasetVersion representing the created dataset along with {@link Response}. + * @throws IllegalArgumentException If the provided path is not a directory. + * @throws UncheckedIOException if an I/O error is thrown when accessing the starting file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createDatasetWithFolderWithResponse(String name, String version, Path folderPath, + RequestOptions requestOptions) { + return createDatasetWithFolderWithResponse(name, version, folderPath, null, requestOptions); + } + + /** + * Creates a dataset from a folder. Uploads all files in the folder to blob storage and registers the dataset. + * + * @param name The name of the resource. + * @param version The specific version id of the DatasetVersion to create or replace. + * @param folderPath The path to the folder containing files to upload. + * @param connectionName The name of an Azure Storage Account connection to use for uploading. + * If null, the default Azure Storage Account connection will be used. + * @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 A FolderDatasetVersion representing the created dataset along with {@link Response}. + * @throws IllegalArgumentException If the provided path is not a directory. + * @throws UncheckedIOException if an I/O error is thrown when accessing the starting file. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createDatasetWithFolderWithResponse(String name, String version, Path folderPath, + String connectionName, RequestOptions requestOptions) { if (!Files.isDirectory(folderPath)) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("The provided path is not a folder: " + folderPath)); @@ -200,7 +288,10 @@ public FolderDatasetVersion createDatasetWithFolder(String name, String version, if (connectionName != null) { request.setConnectionName(connectionName); } - PendingUploadResponse pendingUploadResponse = this.pendingUpload(name, version, request); + PendingUploadResponse pendingUploadResponse + = this.pendingUploadWithResponse(name, version, BinaryData.fromObject(request), requestOptions) + .getValue() + .toObject(PendingUploadResponse.class); String containerUrl = pendingUploadResponse.getBlobReference().getBlobUrl(); BlobReferenceSasCredential credential = pendingUploadResponse.getBlobReference().getCredential(); BlobContainerClient containerClient @@ -214,13 +305,8 @@ public FolderDatasetVersion createDatasetWithFolder(String name, String version, } catch (IOException e) { throw LOGGER.logExceptionAsError(new UncheckedIOException("Failed to walk folder path: " + folderPath, e)); } - RequestOptions requestOptions = new RequestOptions(); - FolderDatasetVersion datasetVersion = this - .createOrUpdateDatasetVersionWithResponse(name, version, - BinaryData.fromObject(new FolderDatasetVersion().setDataUrl(containerUrl)), requestOptions) - .getValue() - .toObject(FolderDatasetVersion.class); - return datasetVersion; + return this.createOrUpdateDatasetVersionWithResponse(name, version, + BinaryData.fromObject(new FolderDatasetVersion().setDataUrl(containerUrl)), requestOptions); } /** @@ -232,7 +318,7 @@ public FolderDatasetVersion createDatasetWithFolder(String name, String version, * { * pendingUploadId: String (Optional) * connectionName: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
@@ -252,7 +338,7 @@ public FolderDatasetVersion createDatasetWithFolder(String name, String version, * } * pendingUploadId: String (Required) * version: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesAsyncClient.java index 78040ea0e8d5..8cced7de37f4 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesAsyncClient.java @@ -111,7 +111,8 @@ public Mono> deleteEvaluationRuleWithResponse(String id, RequestO * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesClient.java index 2ad4fa777d0f..9be8ad6e1445 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationRulesClient.java @@ -105,7 +105,8 @@ public Response deleteEvaluationRuleWithResponse(String id, RequestOptions * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesAsyncClient.java index b926fef41037..600c4aea31bb 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesAsyncClient.java @@ -278,7 +278,7 @@ public Mono> deleteEvaluationTaxonomyWithResponse(String name, Re *
* * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -288,9 +288,9 @@ public Mono> deleteEvaluationTaxonomyWithResponse(String name, Re */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createEvaluationTaxonomyWithResponse(String name, BinaryData body, + public Mono> createEvaluationTaxonomyWithResponse(String name, BinaryData taxonomy, RequestOptions requestOptions) { - return this.serviceClient.createEvaluationTaxonomyWithResponseAsync(name, body, requestOptions); + return this.serviceClient.createEvaluationTaxonomyWithResponseAsync(name, taxonomy, requestOptions); } /** @@ -384,7 +384,7 @@ public Mono> createEvaluationTaxonomyWithResponse(String na *
* * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -394,9 +394,9 @@ public Mono> createEvaluationTaxonomyWithResponse(String na */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateEvaluationTaxonomyWithResponse(String name, BinaryData body, + public Mono> updateEvaluationTaxonomyWithResponse(String name, BinaryData taxonomy, RequestOptions requestOptions) { - return this.serviceClient.updateEvaluationTaxonomyWithResponseAsync(name, body, requestOptions); + return this.serviceClient.updateEvaluationTaxonomyWithResponseAsync(name, taxonomy, requestOptions); } /** @@ -513,7 +513,7 @@ public Mono deleteEvaluationTaxonomy(String name) { * Create an evaluation taxonomy. * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -524,10 +524,10 @@ public Mono deleteEvaluationTaxonomy(String name) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createEvaluationTaxonomy(String name, EvaluationTaxonomy body) { + public Mono createEvaluationTaxonomy(String name, EvaluationTaxonomy taxonomy) { // Generated convenience method for createEvaluationTaxonomyWithResponse RequestOptions requestOptions = new RequestOptions(); - return createEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(body), requestOptions) + return createEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(taxonomy), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(EvaluationTaxonomy.class)); } @@ -536,7 +536,7 @@ public Mono createEvaluationTaxonomy(String name, Evaluation * Update an evaluation taxonomy. * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -547,10 +547,10 @@ public Mono createEvaluationTaxonomy(String name, Evaluation */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateEvaluationTaxonomy(String name, EvaluationTaxonomy body) { + public Mono updateEvaluationTaxonomy(String name, EvaluationTaxonomy taxonomy) { // Generated convenience method for updateEvaluationTaxonomyWithResponse RequestOptions requestOptions = new RequestOptions(); - return updateEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(body), requestOptions) + return updateEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(taxonomy), requestOptions) .flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(EvaluationTaxonomy.class)); } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesClient.java index 01f596a5ad70..cdfb59e6bad4 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationTaxonomiesClient.java @@ -272,7 +272,7 @@ public Response deleteEvaluationTaxonomyWithResponse(String name, RequestO *
* * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -282,9 +282,9 @@ public Response deleteEvaluationTaxonomyWithResponse(String name, RequestO */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createEvaluationTaxonomyWithResponse(String name, BinaryData body, + public Response createEvaluationTaxonomyWithResponse(String name, BinaryData taxonomy, RequestOptions requestOptions) { - return this.serviceClient.createEvaluationTaxonomyWithResponse(name, body, requestOptions); + return this.serviceClient.createEvaluationTaxonomyWithResponse(name, taxonomy, requestOptions); } /** @@ -378,7 +378,7 @@ public Response createEvaluationTaxonomyWithResponse(String name, Bi *
* * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -388,9 +388,9 @@ public Response createEvaluationTaxonomyWithResponse(String name, Bi */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateEvaluationTaxonomyWithResponse(String name, BinaryData body, + public Response updateEvaluationTaxonomyWithResponse(String name, BinaryData taxonomy, RequestOptions requestOptions) { - return this.serviceClient.updateEvaluationTaxonomyWithResponse(name, body, requestOptions); + return this.serviceClient.updateEvaluationTaxonomyWithResponse(name, taxonomy, requestOptions); } /** @@ -483,7 +483,7 @@ public void deleteEvaluationTaxonomy(String name) { * Create an evaluation taxonomy. * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -494,10 +494,10 @@ public void deleteEvaluationTaxonomy(String name) { */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public EvaluationTaxonomy createEvaluationTaxonomy(String name, EvaluationTaxonomy body) { + public EvaluationTaxonomy createEvaluationTaxonomy(String name, EvaluationTaxonomy taxonomy) { // Generated convenience method for createEvaluationTaxonomyWithResponse RequestOptions requestOptions = new RequestOptions(); - return createEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(body), requestOptions).getValue() + return createEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(taxonomy), requestOptions).getValue() .toObject(EvaluationTaxonomy.class); } @@ -505,7 +505,7 @@ public EvaluationTaxonomy createEvaluationTaxonomy(String name, EvaluationTaxono * Update an evaluation taxonomy. * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -516,10 +516,10 @@ public EvaluationTaxonomy createEvaluationTaxonomy(String name, EvaluationTaxono */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public EvaluationTaxonomy updateEvaluationTaxonomy(String name, EvaluationTaxonomy body) { + public EvaluationTaxonomy updateEvaluationTaxonomy(String name, EvaluationTaxonomy taxonomy) { // Generated convenience method for updateEvaluationTaxonomyWithResponse RequestOptions requestOptions = new RequestOptions(); - return updateEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(body), requestOptions).getValue() + return updateEvaluationTaxonomyWithResponse(name, BinaryData.fromObject(taxonomy), requestOptions).getValue() .toObject(EvaluationTaxonomy.class); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationsHelper.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationsHelper.java new file mode 100644 index 000000000000..0aad2ca00767 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluationsHelper.java @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.projects; + +import com.azure.ai.projects.implementation.OpenAIJsonHelper; +import com.azure.ai.projects.models.TestingCriterionAzureAIEvaluator; +import com.openai.models.evals.EvalCreateParams; + +/** + * Helper methods for Azure AI evaluations. + */ +public final class EvaluationsHelper { + private EvaluationsHelper() { + } + + /** + * Converts an Azure AI evaluator model to an OpenAI evaluation testing criterion. + * + *

Use this helper when creating OpenAI evaluations with Azure-specific evaluator types such as + * {@link TestingCriterionAzureAIEvaluator}. The helper preserves the Azure evaluator wire shape while hiding the + * serialization details needed to pass it to the OpenAI SDK.

+ * + * @param evaluator The Azure AI evaluator to use as an evaluation testing criterion. + * @return The OpenAI evaluation testing criterion. + * @throws NullPointerException if {@code evaluator} is null. + */ + public static EvalCreateParams.TestingCriterion toTestingCriterion(TestingCriterionAzureAIEvaluator evaluator) { + return OpenAIJsonHelper.toOpenAIType(evaluator, EvalCreateParams.TestingCriterion.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsAsyncClient.java index e10d08ca3193..243b21b7f39e 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsAsyncClient.java @@ -3,9 +3,16 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.projects; +import com.azure.ai.agents.models.PageOrder; import com.azure.ai.projects.implementation.EvaluatorsImpl; +import com.azure.ai.projects.models.DatasetCredential; +import com.azure.ai.projects.models.EvaluatorCredentialInput; +import com.azure.ai.projects.models.EvaluatorGenerationJob; import com.azure.ai.projects.models.EvaluatorVersion; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; import com.azure.ai.projects.models.ListVersionsRequestType; +import com.azure.ai.projects.models.PendingUploadRequest; +import com.azure.ai.projects.models.PendingUploadResponse; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -14,6 +21,7 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; @@ -70,7 +78,7 @@ public final class EvaluatorsAsyncClient { * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -88,6 +96,15 @@ public final class EvaluatorsAsyncClient { * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -142,7 +159,7 @@ public PagedFlux listEvaluatorVersions(String name, RequestOptions r * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -160,6 +177,15 @@ public PagedFlux listEvaluatorVersions(String name, RequestOptions r * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -204,7 +230,7 @@ public PagedFlux listLatestEvaluatorVersions(RequestOptions requestO * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -222,6 +248,15 @@ public PagedFlux listLatestEvaluatorVersions(RequestOptions requestO * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -289,7 +324,7 @@ public Mono> deleteEvaluatorVersionWithResponse(String name, Stri * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -307,6 +342,15 @@ public Mono> deleteEvaluatorVersionWithResponse(String name, Stri * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -335,7 +379,7 @@ public Mono> deleteEvaluatorVersionWithResponse(String name, Stri * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -353,6 +397,15 @@ public Mono> deleteEvaluatorVersionWithResponse(String name, Stri * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -399,7 +452,7 @@ public Mono> createEvaluatorVersionWithResponse(String name * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -417,6 +470,15 @@ public Mono> createEvaluatorVersionWithResponse(String name * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -445,7 +507,7 @@ public Mono> createEvaluatorVersionWithResponse(String name * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -463,6 +525,15 @@ public Mono> createEvaluatorVersionWithResponse(String name * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -730,4 +801,1182 @@ public Mono updateEvaluatorVersion(String name, String version requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorVersion.class)); } + + /** + * Start a new or get an existing pending upload of an evaluator for a specific version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. + * @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 represents the response for a pending upload request along with {@link Response} on successful completion + * of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> startPendingUploadWithResponse(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + return this.serviceClient.startPendingUploadWithResponseAsync(name, version, pendingUploadRequest, + requestOptions); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blob_uri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @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 SAS credential to access the storage account associated with an Evaluator version along with + * {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCredentialsWithResponse(String name, String version, + BinaryData credentialRequest, RequestOptions requestOptions) { + return this.serviceClient.getCredentialsWithResponseAsync(name, version, credentialRequest, requestOptions); + } + + /** + * Start a new or get an existing pending upload of an evaluator for a specific version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response for a pending upload request on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startPendingUpload(String name, String version, + PendingUploadRequest pendingUploadRequest, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for startPendingUploadWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return startPendingUploadWithResponse(name, version, BinaryData.fromObject(pendingUploadRequest), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PendingUploadResponse.class)); + } + + /** + * Start a new or get an existing pending upload of an evaluator for a specific version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response for a pending upload request on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startPendingUpload(String name, String version, + PendingUploadRequest pendingUploadRequest) { + // Generated convenience method for startPendingUploadWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startPendingUploadWithResponse(name, version, BinaryData.fromObject(pendingUploadRequest), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(PendingUploadResponse.class)); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createEvaluatorGenerationJobWithResponse(BinaryData job, + RequestOptions requestOptions) { + return this.serviceClient.createEvaluatorGenerationJobWithResponseAsync(job, requestOptions); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getEvaluatorGenerationJobWithResponse(String jobId, + RequestOptions requestOptions) { + return this.serviceClient.getEvaluatorGenerationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Returns a list of evaluator generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listEvaluatorGenerationJobs(RequestOptions requestOptions) { + return this.serviceClient.listEvaluatorGenerationJobsAsync(requestOptions); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelEvaluatorGenerationJobWithResponse(String jobId, + RequestOptions requestOptions) { + return this.serviceClient.cancelEvaluatorGenerationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.deleteEvaluatorGenerationJobWithResponseAsync(jobId, requestOptions); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + * + * @param job The job to create. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job + * unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createEvaluatorGenerationJob(EvaluatorGenerationJob job, + FoundryFeaturesOptInKeys foundryFeatures, String operationId) { + // Generated convenience method for createEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (operationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); + } + return createEvaluatorGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + * + * @param job The job to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createEvaluatorGenerationJob(EvaluatorGenerationJob job) { + // Generated convenience method for createEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createEvaluatorGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + * + * @param jobId The ID of the job. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getEvaluatorGenerationJob(String jobId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getEvaluatorGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + * + * @param jobId The ID of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getEvaluatorGenerationJob(String jobId) { + // Generated convenience method for getEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEvaluatorGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Returns a list of evaluator generation jobs. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listEvaluatorGenerationJobs(FoundryFeaturesOptInKeys foundryFeatures, + Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listEvaluatorGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listEvaluatorGenerationJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Returns a list of evaluator generation jobs. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listEvaluatorGenerationJobs() { + // Generated convenience method for listEvaluatorGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listEvaluatorGenerationJobs(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelEvaluatorGenerationJob(String jobId, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for cancelEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return cancelEvaluatorGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelEvaluatorGenerationJob(String jobId) { + // Generated convenience method for cancelEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelEvaluatorGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + * + * @param jobId The ID of the job to delete. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteEvaluatorGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for deleteEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return deleteEvaluatorGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + * + * @param jobId The ID of the job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteEvaluatorGenerationJob(String jobId) { + // Generated convenience method for deleteEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteEvaluatorGenerationJobWithResponse(jobId, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS credential to access the storage account associated with an Evaluator version on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCredentials(String name, String version, + EvaluatorCredentialInput credentialRequest, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getCredentialsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getCredentialsWithResponse(name, version, BinaryData.fromObject(credentialRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DatasetCredential.class)); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS credential to access the storage account associated with an Evaluator version on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCredentials(String name, String version, + EvaluatorCredentialInput credentialRequest) { + // Generated convenience method for getCredentialsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCredentialsWithResponse(name, version, BinaryData.fromObject(credentialRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DatasetCredential.class)); + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsClient.java index d2f2dab0ec23..c96a7cdb228a 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/EvaluatorsClient.java @@ -3,9 +3,16 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.projects; +import com.azure.ai.agents.models.PageOrder; import com.azure.ai.projects.implementation.EvaluatorsImpl; +import com.azure.ai.projects.models.DatasetCredential; +import com.azure.ai.projects.models.EvaluatorCredentialInput; +import com.azure.ai.projects.models.EvaluatorGenerationJob; import com.azure.ai.projects.models.EvaluatorVersion; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; import com.azure.ai.projects.models.ListVersionsRequestType; +import com.azure.ai.projects.models.PendingUploadRequest; +import com.azure.ai.projects.models.PendingUploadResponse; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -14,6 +21,7 @@ import com.azure.core.exception.HttpResponseException; import com.azure.core.exception.ResourceModifiedException; import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; @@ -64,7 +72,7 @@ public final class EvaluatorsClient { * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -82,6 +90,15 @@ public final class EvaluatorsClient { * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -136,7 +153,7 @@ public PagedIterable listEvaluatorVersions(String name, RequestOptio * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -154,6 +171,15 @@ public PagedIterable listEvaluatorVersions(String name, RequestOptio * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -198,7 +224,7 @@ public PagedIterable listLatestEvaluatorVersions(RequestOptions requ * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -216,6 +242,15 @@ public PagedIterable listLatestEvaluatorVersions(RequestOptions requ * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -282,7 +317,7 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -300,6 +335,15 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -328,7 +372,7 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -346,6 +390,15 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -392,7 +445,7 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -410,6 +463,15 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -438,7 +500,7 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -456,6 +518,15 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -676,4 +747,1142 @@ public EvaluatorVersion updateEvaluatorVersion(String name, String version, Eval return updateEvaluatorVersionWithResponse(name, version, BinaryData.fromObject(evaluatorVersion), requestOptions).getValue().toObject(EvaluatorVersion.class); } + + /** + * Start a new or get an existing pending upload of an evaluator for a specific version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. + * @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 represents the response for a pending upload request along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response startPendingUploadWithResponse(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + return this.serviceClient.startPendingUploadWithResponse(name, version, pendingUploadRequest, requestOptions); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blob_uri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @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 SAS credential to access the storage account associated with an Evaluator version along with + * {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCredentialsWithResponse(String name, String version, BinaryData credentialRequest, + RequestOptions requestOptions) { + return this.serviceClient.getCredentialsWithResponse(name, version, credentialRequest, requestOptions); + } + + /** + * Start a new or get an existing pending upload of an evaluator for a specific version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response for a pending upload request. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponse startPendingUpload(String name, String version, + PendingUploadRequest pendingUploadRequest, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for startPendingUploadWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return startPendingUploadWithResponse(name, version, BinaryData.fromObject(pendingUploadRequest), + requestOptions).getValue().toObject(PendingUploadResponse.class); + } + + /** + * Start a new or get an existing pending upload of an evaluator for a specific version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response for a pending upload request. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public PendingUploadResponse startPendingUpload(String name, String version, + PendingUploadRequest pendingUploadRequest) { + // Generated convenience method for startPendingUploadWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startPendingUploadWithResponse(name, version, BinaryData.fromObject(pendingUploadRequest), + requestOptions).getValue().toObject(PendingUploadResponse.class); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createEvaluatorGenerationJobWithResponse(BinaryData job, + RequestOptions requestOptions) { + return this.serviceClient.createEvaluatorGenerationJobWithResponse(job, requestOptions); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.getEvaluatorGenerationJobWithResponse(jobId, requestOptions); + } + + /** + * Returns a list of evaluator generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvaluatorGenerationJobs(RequestOptions requestOptions) { + return this.serviceClient.listEvaluatorGenerationJobs(requestOptions); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.cancelEvaluatorGenerationJobWithResponse(jobId, requestOptions); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return this.serviceClient.deleteEvaluatorGenerationJobWithResponse(jobId, requestOptions); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + * + * @param job The job to create. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param operationId Client-generated unique ID for idempotent retries. When absent, the server creates the job + * unconditionally. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatorGenerationJob createEvaluatorGenerationJob(EvaluatorGenerationJob job, + FoundryFeaturesOptInKeys foundryFeatures, String operationId) { + // Generated convenience method for createEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (operationId != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Operation-Id"), operationId); + } + return createEvaluatorGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue() + .toObject(EvaluatorGenerationJob.class); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + * + * @param job The job to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatorGenerationJob createEvaluatorGenerationJob(EvaluatorGenerationJob job) { + // Generated convenience method for createEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createEvaluatorGenerationJobWithResponse(BinaryData.fromObject(job), requestOptions).getValue() + .toObject(EvaluatorGenerationJob.class); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + * + * @param jobId The ID of the job. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatorGenerationJob getEvaluatorGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getEvaluatorGenerationJobWithResponse(jobId, requestOptions).getValue() + .toObject(EvaluatorGenerationJob.class); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + * + * @param jobId The ID of the job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatorGenerationJob getEvaluatorGenerationJob(String jobId) { + // Generated convenience method for getEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getEvaluatorGenerationJobWithResponse(jobId, requestOptions).getValue() + .toObject(EvaluatorGenerationJob.class); + } + + /** + * Returns a list of evaluator generation jobs. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvaluatorGenerationJobs(FoundryFeaturesOptInKeys foundryFeatures, + Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listEvaluatorGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listEvaluatorGenerationJobs(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Returns a list of evaluator generation jobs. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvaluatorGenerationJobs() { + // Generated convenience method for listEvaluatorGenerationJobs + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listEvaluatorGenerationJobs(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(EvaluatorGenerationJob.class)); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatorGenerationJob cancelEvaluatorGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for cancelEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return cancelEvaluatorGenerationJobWithResponse(jobId, requestOptions).getValue() + .toObject(EvaluatorGenerationJob.class); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + * + * @param jobId The ID of the job to cancel. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public EvaluatorGenerationJob cancelEvaluatorGenerationJob(String jobId) { + // Generated convenience method for cancelEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + return cancelEvaluatorGenerationJobWithResponse(jobId, requestOptions).getValue() + .toObject(EvaluatorGenerationJob.class); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + * + * @param jobId The ID of the job to delete. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteEvaluatorGenerationJob(String jobId, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for deleteEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + deleteEvaluatorGenerationJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + * + * @param jobId The ID of the job to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteEvaluatorGenerationJob(String jobId) { + // Generated convenience method for deleteEvaluatorGenerationJobWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteEvaluatorGenerationJobWithResponse(jobId, requestOptions).getValue(); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS credential to access the storage account associated with an Evaluator version. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DatasetCredential getCredentials(String name, String version, EvaluatorCredentialInput credentialRequest, + FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getCredentialsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getCredentialsWithResponse(name, version, BinaryData.fromObject(credentialRequest), requestOptions) + .getValue() + .toObject(DatasetCredential.class); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the SAS credential to access the storage account associated with an Evaluator version. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DatasetCredential getCredentials(String name, String version, EvaluatorCredentialInput credentialRequest) { + // Generated convenience method for getCredentialsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getCredentialsWithResponse(name, version, BinaryData.fromObject(credentialRequest), requestOptions) + .getValue() + .toObject(DatasetCredential.class); + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsAsyncClient.java index b066b0129aba..b13854e1452f 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsAsyncClient.java @@ -55,7 +55,8 @@ public final class InsightsAsyncClient { * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * repeatability-request-idStringNoRepeatability request ID header * repeatability-first-sentStringNoRepeatability first sent header as * HTTP-date @@ -137,7 +138,8 @@ public Mono> generateInsightWithResponse(BinaryData insight * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -198,7 +200,8 @@ public Mono> getInsightWithResponse(String id, RequestOptio * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsClient.java index fddfd744cc55..970636a976f9 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/InsightsClient.java @@ -49,7 +49,8 @@ public final class InsightsClient { * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * repeatability-request-idStringNoRepeatability request ID header * repeatability-first-sentStringNoRepeatability first sent header as * HTTP-date @@ -130,7 +131,8 @@ public Response generateInsightWithResponse(BinaryData insight, Requ * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -191,7 +193,8 @@ public Response getInsightWithResponse(String id, RequestOptions req * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ModelsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ModelsAsyncClient.java new file mode 100644 index 000000000000..b32067370269 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ModelsAsyncClient.java @@ -0,0 +1,747 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects; + +import com.azure.ai.projects.implementation.JsonMergePatchHelper; +import com.azure.ai.projects.implementation.ModelsImpl; +import com.azure.ai.projects.models.CreateAsyncResponse; +import com.azure.ai.projects.models.DatasetCredential; +import com.azure.ai.projects.models.ModelCredentialInput; +import com.azure.ai.projects.models.ModelPendingUploadInput; +import com.azure.ai.projects.models.ModelPendingUploadResult; +import com.azure.ai.projects.models.ModelVersion; +import com.azure.ai.projects.models.UpdateModelVersionInput; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.FluxUtil; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous AIProjectClient type. + */ +@ServiceClient(builder = AIProjectClientBuilder.class, isAsync = true) +public final class ModelsAsyncClient { + + @Generated + private final ModelsImpl serviceClient; + + /** + * Initializes an instance of ModelsAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelsAsyncClient(ModelsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * List all versions of the given ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @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 paged collection of ModelVersion items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listModelVersions(String name, RequestOptions requestOptions) { + return this.serviceClient.listModelVersionsAsync(name, requestOptions); + } + + /** + * List the latest version of each ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ModelVersion items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLatestModelVersions(RequestOptions requestOptions) { + return this.serviceClient.listLatestModelVersionsAsync(requestOptions); + } + + /** + * Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does + * not exist. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the ModelVersion to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the specific version of the ModelVersion along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.getModelVersionWithResponseAsync(name, version, requestOptions); + } + + /** + * Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted + * successfully or if the ModelVersion does not exist. + * + * @param name The name of the resource. + * @param version The version of the ModelVersion to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteModelVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.deleteModelVersionWithResponseAsync(name, version, requestOptions); + } + + /** + * Update an existing ModelVersion with the given version id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the UpdateModelVersionRequest to create or update. + * @param modelVersionUpdate The UpdateModelVersionRequest to create or update. + * @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 model Version Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateModelVersionWithResponse(String name, String version, + BinaryData modelVersionUpdate, RequestOptions requestOptions) { + return this.serviceClient.updateModelVersionWithResponseAsync(name, version, modelVersionUpdate, + requestOptions); + } + + /** + * Start or retrieve a pending upload for a model version. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param pendingUploadRequest The pendingUploadRequest parameter. + * @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 represents the response for a model pending upload request along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> startModelPendingUploadWithResponse(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + return this.serviceClient.startModelPendingUploadWithResponseAsync(name, version, pendingUploadRequest, + requestOptions); + } + + /** + * Get credentials for a model version asset. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobUri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param credentialRequest The credentialRequest parameter. + * @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 credentials for a model version asset along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelCredentialsWithResponse(String name, String version, + BinaryData credentialRequest, RequestOptions requestOptions) { + return this.serviceClient.getModelCredentialsWithResponseAsync(name, version, credentialRequest, + requestOptions); + } + + /** + * List all versions of the given ModelVersion. + * + * @param name The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ModelVersion items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listModelVersions(String name) { + // Generated convenience method for listModelVersions + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listModelVersions(name, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(ModelVersion.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List the latest version of each ModelVersion. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ModelVersion items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLatestModelVersions() { + // Generated convenience method for listLatestModelVersions + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listLatestModelVersions(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(ModelVersion.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does + * not exist. + * + * @param name The name of the resource. + * @param version The specific version id of the ModelVersion to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific version of the ModelVersion on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getModelVersion(String name, String version) { + // Generated convenience method for getModelVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelVersionWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelVersion.class)); + } + + /** + * Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted + * successfully or if the ModelVersion does not exist. + * + * @param name The name of the resource. + * @param version The version of the ModelVersion to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteModelVersion(String name, String version) { + // Generated convenience method for deleteModelVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteModelVersionWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header + * for polling. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     location: String (Optional)
+     *     operationResult: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param modelVersion Model version 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createModelVersionAsyncWithResponse(String name, String version, + BinaryData modelVersion, RequestOptions requestOptions) { + return this.serviceClient.createModelVersionAsyncWithResponseAsync(name, version, modelVersion, requestOptions); + } + + /** + * Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header + * for polling. + * + * @param name Name of the model. + * @param version Version of the model. + * @param modelVersion Model version to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response body on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createModelVersionAsync(String name, String version, ModelVersion modelVersion) { + // Generated convenience method for createModelVersionAsyncWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createModelVersionAsyncWithResponse(name, version, BinaryData.fromObject(modelVersion), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(CreateAsyncResponse.class)); + } + + /** + * Update an existing ModelVersion with the given version id. + * + * @param name The name of the resource. + * @param version The specific version id of the UpdateModelVersionRequest to create or update. + * @param modelVersionUpdate The UpdateModelVersionRequest to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return model Version Definition on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateModelVersion(String name, String version, + UpdateModelVersionInput modelVersionUpdate) { + // Generated convenience method for updateModelVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getUpdateModelVersionInputAccessor() + .prepareModelForJsonMergePatch(modelVersionUpdate, true); + BinaryData modelVersionUpdateInBinaryData = BinaryData.fromObject(modelVersionUpdate); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + modelVersionUpdateInBinaryData.getLength(); + JsonMergePatchHelper.getUpdateModelVersionInputAccessor() + .prepareModelForJsonMergePatch(modelVersionUpdate, false); + return updateModelVersionWithResponse(name, version, modelVersionUpdateInBinaryData, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelVersion.class)); + } + + /** + * Start or retrieve a pending upload for a model version. + * + * @param name Name of the model. + * @param version Version of the model. + * @param pendingUploadRequest The pendingUploadRequest parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response for a model pending upload request on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono startModelPendingUpload(String name, String version, + ModelPendingUploadInput pendingUploadRequest) { + // Generated convenience method for startModelPendingUploadWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startModelPendingUploadWithResponse(name, version, BinaryData.fromObject(pendingUploadRequest), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(ModelPendingUploadResult.class)); + } + + /** + * Get credentials for a model version asset. + * + * @param name Name of the model. + * @param version Version of the model. + * @param credentialRequest The credentialRequest parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return credentials for a model version asset on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getModelCredentials(String name, String version, + ModelCredentialInput credentialRequest) { + // Generated convenience method for getModelCredentialsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelCredentialsWithResponse(name, version, BinaryData.fromObject(credentialRequest), requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DatasetCredential.class)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ModelsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ModelsClient.java new file mode 100644 index 000000000000..080397ea011d --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/ModelsClient.java @@ -0,0 +1,707 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects; + +import com.azure.ai.projects.implementation.JsonMergePatchHelper; +import com.azure.ai.projects.implementation.ModelsImpl; +import com.azure.ai.projects.models.CreateAsyncResponse; +import com.azure.ai.projects.models.DatasetCredential; +import com.azure.ai.projects.models.ModelCredentialInput; +import com.azure.ai.projects.models.ModelPendingUploadInput; +import com.azure.ai.projects.models.ModelPendingUploadResult; +import com.azure.ai.projects.models.ModelVersion; +import com.azure.ai.projects.models.UpdateModelVersionInput; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; + +/** + * Initializes a new instance of the synchronous AIProjectClient type. + */ +@ServiceClient(builder = AIProjectClientBuilder.class) +public final class ModelsClient { + + @Generated + private final ModelsImpl serviceClient; + + /** + * Initializes an instance of ModelsClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + ModelsClient(ModelsImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * List all versions of the given ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @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 paged collection of ModelVersion items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listModelVersions(String name, RequestOptions requestOptions) { + return this.serviceClient.listModelVersions(name, requestOptions); + } + + /** + * List the latest version of each ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ModelVersion items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLatestModelVersions(RequestOptions requestOptions) { + return this.serviceClient.listLatestModelVersions(requestOptions); + } + + /** + * Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does + * not exist. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the ModelVersion to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the specific version of the ModelVersion along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.getModelVersionWithResponse(name, version, requestOptions); + } + + /** + * Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted + * successfully or if the ModelVersion does not exist. + * + * @param name The name of the resource. + * @param version The version of the ModelVersion to delete. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteModelVersionWithResponse(String name, String version, RequestOptions requestOptions) { + return this.serviceClient.deleteModelVersionWithResponse(name, version, requestOptions); + } + + /** + * Update an existing ModelVersion with the given version id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the UpdateModelVersionRequest to create or update. + * @param modelVersionUpdate The UpdateModelVersionRequest to create or update. + * @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 model Version Definition along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateModelVersionWithResponse(String name, String version, + BinaryData modelVersionUpdate, RequestOptions requestOptions) { + return this.serviceClient.updateModelVersionWithResponse(name, version, modelVersionUpdate, requestOptions); + } + + /** + * Start or retrieve a pending upload for a model version. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param pendingUploadRequest The pendingUploadRequest parameter. + * @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 represents the response for a model pending upload request along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response startModelPendingUploadWithResponse(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + return this.serviceClient.startModelPendingUploadWithResponse(name, version, pendingUploadRequest, + requestOptions); + } + + /** + * Get credentials for a model version asset. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobUri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param credentialRequest The credentialRequest parameter. + * @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 credentials for a model version asset along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelCredentialsWithResponse(String name, String version, + BinaryData credentialRequest, RequestOptions requestOptions) { + return this.serviceClient.getModelCredentialsWithResponse(name, version, credentialRequest, requestOptions); + } + + /** + * List all versions of the given ModelVersion. + * + * @param name The name of the resource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ModelVersion items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listModelVersions(String name) { + // Generated convenience method for listModelVersions + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listModelVersions(name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ModelVersion.class)); + } + + /** + * List the latest version of each ModelVersion. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return paged collection of ModelVersion items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLatestModelVersions() { + // Generated convenience method for listLatestModelVersions + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listLatestModelVersions(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(ModelVersion.class)); + } + + /** + * Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does + * not exist. + * + * @param name The name of the resource. + * @param version The specific version id of the ModelVersion to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the specific version of the ModelVersion. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersion getModelVersion(String name, String version) { + // Generated convenience method for getModelVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelVersionWithResponse(name, version, requestOptions).getValue().toObject(ModelVersion.class); + } + + /** + * Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted + * successfully or if the ModelVersion does not exist. + * + * @param name The name of the resource. + * @param version The version of the ModelVersion to delete. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteModelVersion(String name, String version) { + // Generated convenience method for deleteModelVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteModelVersionWithResponse(name, version, requestOptions).getValue(); + } + + /** + * Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header + * for polling. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     location: String (Optional)
+     *     operationResult: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param modelVersion Model version 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 response body along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createModelVersionAsyncWithResponse(String name, String version, + BinaryData modelVersion, RequestOptions requestOptions) { + return this.serviceClient.createModelVersionAsyncWithResponse(name, version, modelVersion, requestOptions); + } + + /** + * Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header + * for polling. + * + * @param name Name of the model. + * @param version Version of the model. + * @param modelVersion Model version to create. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public CreateAsyncResponse createModelVersionAsync(String name, String version, ModelVersion modelVersion) { + // Generated convenience method for createModelVersionAsyncWithResponse + RequestOptions requestOptions = new RequestOptions(); + return createModelVersionAsyncWithResponse(name, version, BinaryData.fromObject(modelVersion), requestOptions) + .getValue() + .toObject(CreateAsyncResponse.class); + } + + /** + * Update an existing ModelVersion with the given version id. + * + * @param name The name of the resource. + * @param version The specific version id of the UpdateModelVersionRequest to create or update. + * @param modelVersionUpdate The UpdateModelVersionRequest to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return model Version Definition. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelVersion updateModelVersion(String name, String version, UpdateModelVersionInput modelVersionUpdate) { + // Generated convenience method for updateModelVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + JsonMergePatchHelper.getUpdateModelVersionInputAccessor() + .prepareModelForJsonMergePatch(modelVersionUpdate, true); + BinaryData modelVersionUpdateInBinaryData = BinaryData.fromObject(modelVersionUpdate); + // BinaryData.fromObject() will not fire serialization, use getLength() to fire serialization. + modelVersionUpdateInBinaryData.getLength(); + JsonMergePatchHelper.getUpdateModelVersionInputAccessor() + .prepareModelForJsonMergePatch(modelVersionUpdate, false); + return updateModelVersionWithResponse(name, version, modelVersionUpdateInBinaryData, requestOptions).getValue() + .toObject(ModelVersion.class); + } + + /** + * Start or retrieve a pending upload for a model version. + * + * @param name Name of the model. + * @param version Version of the model. + * @param pendingUploadRequest The pendingUploadRequest parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents the response for a model pending upload request. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public ModelPendingUploadResult startModelPendingUpload(String name, String version, + ModelPendingUploadInput pendingUploadRequest) { + // Generated convenience method for startModelPendingUploadWithResponse + RequestOptions requestOptions = new RequestOptions(); + return startModelPendingUploadWithResponse(name, version, BinaryData.fromObject(pendingUploadRequest), + requestOptions).getValue().toObject(ModelPendingUploadResult.class); + } + + /** + * Get credentials for a model version asset. + * + * @param name Name of the model. + * @param version Version of the model. + * @param credentialRequest The credentialRequest parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return credentials for a model version asset. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DatasetCredential getModelCredentials(String name, String version, ModelCredentialInput credentialRequest) { + // Generated convenience method for getModelCredentialsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getModelCredentialsWithResponse(name, version, BinaryData.fromObject(credentialRequest), requestOptions) + .getValue() + .toObject(DatasetCredential.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/RoutinesAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/RoutinesAsyncClient.java new file mode 100644 index 000000000000..39869f5d8720 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/RoutinesAsyncClient.java @@ -0,0 +1,960 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects; + +import com.azure.ai.projects.implementation.RoutinesImpl; +import com.azure.ai.projects.implementation.models.CreateOrUpdateRoutineRequest; +import com.azure.ai.projects.implementation.models.DispatchRoutineAsyncRequest; +import com.azure.ai.projects.models.DispatchRoutineResult; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.Routine; +import com.azure.ai.projects.models.RoutineAction; +import com.azure.ai.projects.models.RoutineDispatchPayload; +import com.azure.ai.projects.models.RoutineRun; +import com.azure.ai.projects.models.RoutineTrigger; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +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.FluxUtil; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous AIProjectClient type. + */ +@ServiceClient(builder = AIProjectClientBuilder.class, isAsync = true) +public final class RoutinesAsyncClient { + + @Generated + private final RoutinesImpl serviceClient; + + /** + * Initializes an instance of RoutinesAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + RoutinesAsyncClient(RoutinesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create or update a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     enabled: Boolean (Optional)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param createOrUpdateRoutineRequest The createOrUpdateRoutineRequest parameter. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateRoutineWithResponse(String routineName, + BinaryData createOrUpdateRoutineRequest, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateRoutineWithResponseAsync(routineName, createOrUpdateRoutineRequest, + requestOptions); + } + + /** + * Retrieve a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.getRoutineWithResponseAsync(routineName, requestOptions); + } + + /** + * Enable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enableRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.enableRoutineWithResponseAsync(routineName, requestOptions); + } + + /** + * Disable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> disableRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.disableRoutineWithResponseAsync(routineName, requestOptions); + } + + /** + * List routines. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoThe maximum number of routines to return.
afterStringNoAn opaque cursor returned as last_id by the previous list + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutines(RequestOptions requestOptions) { + return this.serviceClient.listRoutinesAsync(requestOptions); + } + + /** + * Delete a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param routineName The unique name of the routine. + * @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 Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.deleteRoutineWithResponseAsync(routineName, requestOptions); + } + + /** + * List prior runs for a routine. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoAn optional MLflow search-runs filter expression applied within + * the routine's experiment.
limitIntegerNoThe maximum number of runs to return.
afterStringNoAn opaque cursor returned as last_id by the previous list-runs + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String (Optional)
+     *     phase: String(queued/dispatching/completed/failed) (Optional)
+     *     trigger_type: String(custom/github_issue/schedule/timer) (Optional)
+     *     trigger_name: String (Optional)
+     *     attempt_source: String(event_fire/manual_dispatch/queued_dispatch/schedule_delivery/timer_delivery) (Optional)
+     *     action_type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Optional)
+     *     agent_id: String (Optional)
+     *     agent_endpoint_id: String (Optional)
+     *     conversation_id: String (Optional)
+     *     session_id: String (Optional)
+     *     triggered_at: Long (Optional)
+     *     scheduled_fire_at: Long (Optional)
+     *     started_at: Long (Optional)
+     *     ended_at: Long (Optional)
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     response_id: String (Optional)
+     *     task_id: String (Optional)
+     *     error_status_code: Integer (Optional)
+     *     error_type: String (Optional)
+     *     error_message: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutineRuns(String routineName, RequestOptions requestOptions) { + return this.serviceClient.listRoutineRunsAsync(routineName, requestOptions); + } + + /** + * Retrieve a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * Retrieve a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getRoutine(String routineName) { + // Generated convenience method for getRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * Enable a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for enableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return enableRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * Enable a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableRoutine(String routineName) { + // Generated convenience method for enableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return enableRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * Disable a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for disableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return disableRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * Disable a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono disableRoutine(String routineName) { + // Generated convenience method for disableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return disableRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * List routines. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutines() { + // Generated convenience method for listRoutines + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listRoutines(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Delete a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for deleteRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return deleteRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Delete a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteRoutine(String routineName) { + // Generated convenience method for deleteRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteRoutineWithResponse(routineName, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * List prior runs for a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutineRuns(String routineName) { + // Generated convenience method for listRoutineRuns + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listRoutineRuns(routineName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(RoutineRun.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Create or update a routine. + * + * @param routineName The unique name of the routine. + * @param description A human-readable description of the routine. + * @param enabled Whether the routine is enabled. + * @param triggers The triggers configured for the routine. In v1, exactly one trigger entry is supported. + * @param action The action executed when the routine fires. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateRoutine(String routineName, String description, Boolean enabled, + Map triggers, RoutineAction action) { + // Generated convenience method for createOrUpdateRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateOrUpdateRoutineRequest createOrUpdateRoutineRequestObj + = new CreateOrUpdateRoutineRequest().setDescription(description) + .setEnabled(enabled) + .setTriggers(triggers) + .setAction(action); + BinaryData createOrUpdateRoutineRequest = BinaryData.fromObject(createOrUpdateRoutineRequestObj); + return createOrUpdateRoutineWithResponse(routineName, createOrUpdateRoutineRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * Create or update a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateRoutine(String routineName) { + // Generated convenience method for createOrUpdateRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateOrUpdateRoutineRequest createOrUpdateRoutineRequestObj = new CreateOrUpdateRoutineRequest(); + BinaryData createOrUpdateRoutineRequest = BinaryData.fromObject(createOrUpdateRoutineRequestObj); + return createOrUpdateRoutineWithResponse(routineName, createOrUpdateRoutineRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)); + } + + /** + * List routines. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit The maximum number of routines to return. + * @param after An opaque cursor returned as last_id by the previous list response. + * @param before Unsupported. Reserved for future backward pagination support. + * @param order The ordering direction. Supported values are asc and desc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutines(FoundryFeaturesOptInKeys foundryFeatures, Integer limit, String after, + String before, String order) { + // Generated convenience method for listRoutines + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (order != null) { + requestOptions.addQueryParam("order", order, false); + } + PagedFlux pagedFluxResponse = listRoutines(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Routine.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * List prior runs for a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param filter An optional MLflow search-runs filter expression applied within the routine's experiment. + * @param limit The maximum number of runs to return. + * @param after An opaque cursor returned as last_id by the previous list-runs response. + * @param before Unsupported. Reserved for future backward pagination support. + * @param order The ordering direction. Supported values are asc and desc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutineRuns(String routineName, FoundryFeaturesOptInKeys foundryFeatures, + String filter, Integer limit, String after, String before, String order) { + // Generated convenience method for listRoutineRuns + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (order != null) { + requestOptions.addQueryParam("order", order, false); + } + PagedFlux pagedFluxResponse = listRoutineRuns(routineName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(RoutineRun.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Queue an asynchronous routine dispatch. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     payload (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     task_id: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param dispatchRoutineAsyncRequest The dispatchRoutineAsyncRequest parameter. + * @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 identifiers returned after a routine dispatch is queued along with {@link Response} on successful + * completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> dispatchRoutineWithResponse(String routineName, + BinaryData dispatchRoutineAsyncRequest, RequestOptions requestOptions) { + return this.serviceClient.dispatchRoutineWithResponseAsync(routineName, dispatchRoutineAsyncRequest, + requestOptions); + } + + /** + * Queue an asynchronous routine dispatch. + * + * @param routineName The unique name of the routine. + * @param payload A direct action-input override sent downstream when testing a routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identifiers returned after a routine dispatch is queued on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono dispatchRoutine(String routineName, RoutineDispatchPayload payload) { + // Generated convenience method for dispatchRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + DispatchRoutineAsyncRequest dispatchRoutineAsyncRequestObj + = new DispatchRoutineAsyncRequest().setPayload(payload); + BinaryData dispatchRoutineAsyncRequest = BinaryData.fromObject(dispatchRoutineAsyncRequestObj); + return dispatchRoutineWithResponse(routineName, dispatchRoutineAsyncRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DispatchRoutineResult.class)); + } + + /** + * Queue an asynchronous routine dispatch. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identifiers returned after a routine dispatch is queued on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono dispatchRoutine(String routineName) { + // Generated convenience method for dispatchRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + DispatchRoutineAsyncRequest dispatchRoutineAsyncRequestObj = new DispatchRoutineAsyncRequest(); + BinaryData dispatchRoutineAsyncRequest = BinaryData.fromObject(dispatchRoutineAsyncRequestObj); + return dispatchRoutineWithResponse(routineName, dispatchRoutineAsyncRequest, requestOptions) + .flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(DispatchRoutineResult.class)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/RoutinesClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/RoutinesClient.java new file mode 100644 index 000000000000..a1b9e92d9595 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/RoutinesClient.java @@ -0,0 +1,892 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects; + +import com.azure.ai.projects.implementation.RoutinesImpl; +import com.azure.ai.projects.implementation.models.CreateOrUpdateRoutineRequest; +import com.azure.ai.projects.implementation.models.DispatchRoutineAsyncRequest; +import com.azure.ai.projects.models.DispatchRoutineResult; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.Routine; +import com.azure.ai.projects.models.RoutineAction; +import com.azure.ai.projects.models.RoutineDispatchPayload; +import com.azure.ai.projects.models.RoutineRun; +import com.azure.ai.projects.models.RoutineTrigger; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import java.util.Map; + +/** + * Initializes a new instance of the synchronous AIProjectClient type. + */ +@ServiceClient(builder = AIProjectClientBuilder.class) +public final class RoutinesClient { + + @Generated + private final RoutinesImpl serviceClient; + + /** + * Initializes an instance of RoutinesClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + RoutinesClient(RoutinesImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Create or update a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     enabled: Boolean (Optional)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param createOrUpdateRoutineRequest The createOrUpdateRoutineRequest parameter. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateRoutineWithResponse(String routineName, + BinaryData createOrUpdateRoutineRequest, RequestOptions requestOptions) { + return this.serviceClient.createOrUpdateRoutineWithResponse(routineName, createOrUpdateRoutineRequest, + requestOptions); + } + + /** + * Retrieve a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.getRoutineWithResponse(routineName, requestOptions); + } + + /** + * Enable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.enableRoutineWithResponse(routineName, requestOptions); + } + + /** + * Disable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disableRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.disableRoutineWithResponse(routineName, requestOptions); + } + + /** + * List routines. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoThe maximum number of routines to return.
afterStringNoAn opaque cursor returned as last_id by the previous list + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutines(RequestOptions requestOptions) { + return this.serviceClient.listRoutines(requestOptions); + } + + /** + * Delete a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param routineName The unique name of the routine. + * @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 Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return this.serviceClient.deleteRoutineWithResponse(routineName, requestOptions); + } + + /** + * List prior runs for a routine. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoAn optional MLflow search-runs filter expression applied within + * the routine's experiment.
limitIntegerNoThe maximum number of runs to return.
afterStringNoAn opaque cursor returned as last_id by the previous list-runs + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String (Optional)
+     *     phase: String(queued/dispatching/completed/failed) (Optional)
+     *     trigger_type: String(custom/github_issue/schedule/timer) (Optional)
+     *     trigger_name: String (Optional)
+     *     attempt_source: String(event_fire/manual_dispatch/queued_dispatch/schedule_delivery/timer_delivery) (Optional)
+     *     action_type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Optional)
+     *     agent_id: String (Optional)
+     *     agent_endpoint_id: String (Optional)
+     *     conversation_id: String (Optional)
+     *     session_id: String (Optional)
+     *     triggered_at: Long (Optional)
+     *     scheduled_fire_at: Long (Optional)
+     *     started_at: Long (Optional)
+     *     ended_at: Long (Optional)
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     response_id: String (Optional)
+     *     task_id: String (Optional)
+     *     error_status_code: Integer (Optional)
+     *     error_type: String (Optional)
+     *     error_message: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutineRuns(String routineName, RequestOptions requestOptions) { + return this.serviceClient.listRoutineRuns(routineName, requestOptions); + } + + /** + * Retrieve a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine getRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for getRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return getRoutineWithResponse(routineName, requestOptions).getValue().toObject(Routine.class); + } + + /** + * Retrieve a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine getRoutine(String routineName) { + // Generated convenience method for getRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getRoutineWithResponse(routineName, requestOptions).getValue().toObject(Routine.class); + } + + /** + * Enable a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine enableRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for enableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return enableRoutineWithResponse(routineName, requestOptions).getValue().toObject(Routine.class); + } + + /** + * Enable a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine enableRoutine(String routineName) { + // Generated convenience method for enableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return enableRoutineWithResponse(routineName, requestOptions).getValue().toObject(Routine.class); + } + + /** + * Disable a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine disableRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for disableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + return disableRoutineWithResponse(routineName, requestOptions).getValue().toObject(Routine.class); + } + + /** + * Disable a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine disableRoutine(String routineName) { + // Generated convenience method for disableRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + return disableRoutineWithResponse(routineName, requestOptions).getValue().toObject(Routine.class); + } + + /** + * List routines. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutines() { + // Generated convenience method for listRoutines + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listRoutines(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Routine.class)); + } + + /** + * Delete a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteRoutine(String routineName, FoundryFeaturesOptInKeys foundryFeatures) { + // Generated convenience method for deleteRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + deleteRoutineWithResponse(routineName, requestOptions).getValue(); + } + + /** + * Delete a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteRoutine(String routineName) { + // Generated convenience method for deleteRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteRoutineWithResponse(routineName, requestOptions).getValue(); + } + + /** + * List prior runs for a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutineRuns(String routineName) { + // Generated convenience method for listRoutineRuns + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listRoutineRuns(routineName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(RoutineRun.class)); + } + + /** + * Create or update a routine. + * + * @param routineName The unique name of the routine. + * @param description A human-readable description of the routine. + * @param enabled Whether the routine is enabled. + * @param triggers The triggers configured for the routine. In v1, exactly one trigger entry is supported. + * @param action The action executed when the routine fires. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine createOrUpdateRoutine(String routineName, String description, Boolean enabled, + Map triggers, RoutineAction action) { + // Generated convenience method for createOrUpdateRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateOrUpdateRoutineRequest createOrUpdateRoutineRequestObj + = new CreateOrUpdateRoutineRequest().setDescription(description) + .setEnabled(enabled) + .setTriggers(triggers) + .setAction(action); + BinaryData createOrUpdateRoutineRequest = BinaryData.fromObject(createOrUpdateRoutineRequestObj); + return createOrUpdateRoutineWithResponse(routineName, createOrUpdateRoutineRequest, requestOptions).getValue() + .toObject(Routine.class); + } + + /** + * Create or update a routine. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a routine definition returned by the service. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Routine createOrUpdateRoutine(String routineName) { + // Generated convenience method for createOrUpdateRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + CreateOrUpdateRoutineRequest createOrUpdateRoutineRequestObj = new CreateOrUpdateRoutineRequest(); + BinaryData createOrUpdateRoutineRequest = BinaryData.fromObject(createOrUpdateRoutineRequestObj); + return createOrUpdateRoutineWithResponse(routineName, createOrUpdateRoutineRequest, requestOptions).getValue() + .toObject(Routine.class); + } + + /** + * List routines. + * + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param limit The maximum number of routines to return. + * @param after An opaque cursor returned as last_id by the previous list response. + * @param before Unsupported. Reserved for future backward pagination support. + * @param order The ordering direction. Supported values are asc and desc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutines(FoundryFeaturesOptInKeys foundryFeatures, Integer limit, String after, + String before, String order) { + // Generated convenience method for listRoutines + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (order != null) { + requestOptions.addQueryParam("order", order, false); + } + return serviceClient.listRoutines(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(Routine.class)); + } + + /** + * List prior runs for a routine. + * + * @param routineName The unique name of the routine. + * @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted + * preview resources. + * @param filter An optional MLflow search-runs filter expression applied within the routine's experiment. + * @param limit The maximum number of runs to return. + * @param after An opaque cursor returned as last_id by the previous list-runs response. + * @param before Unsupported. Reserved for future backward pagination support. + * @param order The ordering direction. Supported values are asc and desc. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutineRuns(String routineName, FoundryFeaturesOptInKeys foundryFeatures, + String filter, Integer limit, String after, String before, String order) { + // Generated convenience method for listRoutineRuns + RequestOptions requestOptions = new RequestOptions(); + if (foundryFeatures != null) { + requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString()); + } + if (filter != null) { + requestOptions.addQueryParam("filter", filter, false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + if (order != null) { + requestOptions.addQueryParam("order", order, false); + } + return serviceClient.listRoutineRuns(routineName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(RoutineRun.class)); + } + + /** + * Queue an asynchronous routine dispatch. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     payload (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     task_id: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param dispatchRoutineAsyncRequest The dispatchRoutineAsyncRequest parameter. + * @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 identifiers returned after a routine dispatch is queued along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response dispatchRoutineWithResponse(String routineName, BinaryData dispatchRoutineAsyncRequest, + RequestOptions requestOptions) { + return this.serviceClient.dispatchRoutineWithResponse(routineName, dispatchRoutineAsyncRequest, requestOptions); + } + + /** + * Queue an asynchronous routine dispatch. + * + * @param routineName The unique name of the routine. + * @param payload A direct action-input override sent downstream when testing a routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identifiers returned after a routine dispatch is queued. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DispatchRoutineResult dispatchRoutine(String routineName, RoutineDispatchPayload payload) { + // Generated convenience method for dispatchRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + DispatchRoutineAsyncRequest dispatchRoutineAsyncRequestObj + = new DispatchRoutineAsyncRequest().setPayload(payload); + BinaryData dispatchRoutineAsyncRequest = BinaryData.fromObject(dispatchRoutineAsyncRequestObj); + return dispatchRoutineWithResponse(routineName, dispatchRoutineAsyncRequest, requestOptions).getValue() + .toObject(DispatchRoutineResult.class); + } + + /** + * Queue an asynchronous routine dispatch. + * + * @param routineName The unique name of the routine. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return identifiers returned after a routine dispatch is queued. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public DispatchRoutineResult dispatchRoutine(String routineName) { + // Generated convenience method for dispatchRoutineWithResponse + RequestOptions requestOptions = new RequestOptions(); + DispatchRoutineAsyncRequest dispatchRoutineAsyncRequestObj = new DispatchRoutineAsyncRequest(); + BinaryData dispatchRoutineAsyncRequest = BinaryData.fromObject(dispatchRoutineAsyncRequestObj); + return dispatchRoutineWithResponse(routineName, dispatchRoutineAsyncRequest, requestOptions).getValue() + .toObject(DispatchRoutineResult.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsAsyncClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsAsyncClient.java index 19e84e827da1..1f26535abd9f 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsAsyncClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsAsyncClient.java @@ -4,10 +4,15 @@ package com.azure.ai.projects; import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.implementation.MultipartFormDataHelper; import com.azure.ai.projects.implementation.SkillsImpl; -import com.azure.ai.projects.implementation.models.CreateSkillRequest; +import com.azure.ai.projects.implementation.models.CreateSkillVersionRequest; import com.azure.ai.projects.implementation.models.UpdateSkillRequest; -import com.azure.ai.projects.models.SkillDetails; +import com.azure.ai.projects.models.CreateSkillVersionFromFilesBody; +import com.azure.ai.projects.models.Skill; +import com.azure.ai.projects.models.SkillFileDetails; +import com.azure.ai.projects.models.SkillInlineContent; +import com.azure.ai.projects.models.SkillVersion; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -21,9 +26,10 @@ import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; -import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -48,60 +54,95 @@ public final class SkillsAsyncClient { } /** - * Creates a skill. - *

Request Body Schema

+ * Retrieves a skill. + *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
- * + * + * @param name The unique name of the skill. + * @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 a skill resource along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSkillWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getSkillWithResponseAsync(name, requestOptions); + } + + /** + * Returns the list of all skills. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
* - * @param createSkillRequest The createSkillRequest parameter. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSkillWithResponse(BinaryData createSkillRequest, - RequestOptions requestOptions) { - return this.serviceClient.createSkillWithResponseAsync(createSkillRequest, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkills(RequestOptions requestOptions) { + return this.serviceClient.listSkillsAsync(requestOptions); } /** - * Creates a skill from a zip package. + * Update a skill. *

Request Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     default_version: String (Required)
+     * }
      * }
      * 
* @@ -110,92 +151,275 @@ public Mono> createSkillWithResponse(BinaryData createSkill *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
* - * @param body The zip package used to create the skill. + * @param name The name of the skill to update. + * @param updateSkillRequest The updateSkillRequest parameter. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return a skill resource along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSkillFromPackageWithResponse(BinaryData body, + public Mono> updateSkillWithResponse(String name, BinaryData updateSkillRequest, RequestOptions requestOptions) { - return this.serviceClient.createSkillFromPackageWithResponseAsync(body, requestOptions); + return this.serviceClient.updateSkillWithResponseAsync(name, updateSkillRequest, requestOptions); + } + + /** + * Deletes a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The unique name of the skill. + * @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 a deleted skill along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSkillWithResponse(String name, RequestOptions requestOptions) { + return internalDeleteSkillWithResponse(name, requestOptions) + .map(response -> new SimpleResponse<>(response, null)); } /** * Retrieves a skill. + * + * @param name The unique name of the skill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a skill resource on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSkill(String name) { + // Generated convenience method for getSkillWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSkillWithResponse(name, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Skill.class)); + } + + /** + * Returns the list of all skills. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkills(Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listSkills + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listSkills(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Skill.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Returns the list of all skills. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkills() { + // Generated convenience method for listSkills + RequestOptions requestOptions = new RequestOptions(); + PagedFlux pagedFluxResponse = listSkills(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(Skill.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Deletes a skill. + * + * @param skillName The unique name of the skill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a {@link Mono} that completes when the skill is successfully deleted. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteSkill(String skillName) { + // Generated convenience method for deleteSkillWithResponse + RequestOptions requestOptions = new RequestOptions(); + return deleteSkillWithResponse(skillName, requestOptions).then(); + } + + /** + * Creates a new version of a skill. If the skill does not exist, it will be created. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     inline_content (Optional): {
+     *         description: String (Required)
+     *         instructions: String (Required)
+     *         license: String (Optional)
+     *         compatibility: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         allowed_tools (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     default: Boolean (Optional)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. + * @param createSkillVersionRequest The createSkillVersionRequest parameter. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return a specific version of a skill along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSkillWithResponse(String skillName, RequestOptions requestOptions) { - return this.serviceClient.getSkillWithResponseAsync(skillName, requestOptions); + public Mono> createSkillVersionWithResponse(String name, BinaryData createSkillVersionRequest, + RequestOptions requestOptions) { + return this.serviceClient.createSkillVersionWithResponseAsync(name, createSkillVersionRequest, requestOptions); } /** - * Downloads a skill package as a ZIP archive containing {@code SKILL.md}. Returns the original uploaded archive for - * skills created via {@code createSkillFromPackage}; materializes a ZIP from stored instructions for skills created - * via {@code createSkill}. + * Creates a new version of a skill from uploaded files via multipart form data. *

Response Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return a specific version of a skill along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadSkillWithResponse(String skillName, RequestOptions requestOptions) { - return this.serviceClient.downloadSkillWithResponseAsync(skillName, requestOptions); + Mono> createSkillVersionFromFilesWithResponse(String name, BinaryData content, + RequestOptions requestOptions) { + // Operation 'createSkillVersionFromFiles' is of content-type 'multipart/form-data'. Protocol API is not usable + // and hence not generated. + return this.serviceClient.createSkillVersionFromFilesWithResponseAsync(name, content, requestOptions); } /** - * Returns the list of all skills. + * List all versions of a skill. *

Query Parameters

* * @@ -221,17 +445,17 @@ public Mono> downloadSkillWithResponse(String skillName, Re *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill to list versions for. * @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. @@ -241,209 +465,234 @@ public Mono> downloadSkillWithResponse(String skillName, Re */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkills(RequestOptions requestOptions) { - return this.serviceClient.listSkillsAsync(requestOptions); + public PagedFlux listSkillVersions(String name, RequestOptions requestOptions) { + return this.serviceClient.listSkillVersionsAsync(name, requestOptions); } /** - * Updates an existing skill. - *

Request Body Schema

+ * Retrieve a specific version of a skill. + *

Response Body Schema

* *
      * {@code
      * {
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
- * + * + * @param name The name of the skill. + * @param version The version identifier to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific version of a skill along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSkillVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.getSkillVersionWithResponseAsync(name, version, requestOptions); + } + + /** + * Download the zip content for the default version of a skill. *

Response Body Schema

* *
      * {@code
-     * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
-     *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
+     * BinaryData
      * }
      * 
* - * @param skillName The unique name of the skill. - * @param updateSkillRequest The updateSkillRequest parameter. + * @param name The name of the skill. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSkillWithResponse(String skillName, BinaryData updateSkillRequest, - RequestOptions requestOptions) { - return this.serviceClient.updateSkillWithResponseAsync(skillName, updateSkillRequest, requestOptions); + public Mono> getSkillContentWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getSkillContentWithResponseAsync(name, requestOptions); } /** - * Deletes a skill. + * Download the zip content for a specific version of a skill. *

Response Body Schema

* *
      * {@code
-     * {
-     *     name: String (Required)
-     *     deleted: boolean (Required)
-     * }
+     * BinaryData
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param version The version to download content for. * @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 a deleted skill Object along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSkillWithResponse(String skillName, RequestOptions requestOptions) { - return this.serviceClient.deleteSkillWithResponseAsync(skillName, requestOptions); + public Mono> getSkillVersionContentWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.getSkillVersionContentWithResponseAsync(name, version, requestOptions); } /** - * Creates a skill. - * - * @param name The unique name of the skill. - * @param description A human-readable description of the skill. - * @param instructions Instructions that define the behavior of the skill. - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. + * Delete a specific version of a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     *     version: String (Required)
+     * }
+     * }
+     * 
* - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param name The name of the skill. + * @param version The version identifier to delete. + * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object on successful completion of {@link Mono}. + * @return a deleted skill version along with {@link Response} on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSkill(String name, String description, String instructions, - Map metadata) { - // Generated convenience method for createSkillWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateSkillRequest createSkillRequestObj = new CreateSkillRequest(name).setDescription(description) - .setInstructions(instructions) - .setMetadata(metadata); - BinaryData createSkillRequest = BinaryData.fromObject(createSkillRequestObj); - return createSkillWithResponse(createSkillRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)); + Mono> internalDeleteSkillVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.internalDeleteSkillVersionWithResponseAsync(name, version, requestOptions); } /** - * Creates a skill. + * Update a skill. * - * @param name The unique name of the skill. + * @param name The name of the skill to update. + * @param defaultVersion The version identifier that the skill should point to. When set, the skill's default + * version will resolve to this version instead of the latest. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object on successful completion of {@link Mono}. + * @return a skill resource on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSkill(String name) { - // Generated convenience method for createSkillWithResponse + public Mono updateSkill(String name, String defaultVersion) { + // Generated convenience method for updateSkillWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateSkillRequest createSkillRequestObj = new CreateSkillRequest(name); - BinaryData createSkillRequest = BinaryData.fromObject(createSkillRequestObj); - return createSkillWithResponse(createSkillRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)); + UpdateSkillRequest updateSkillRequestObj = new UpdateSkillRequest(defaultVersion); + BinaryData updateSkillRequest = BinaryData.fromObject(updateSkillRequestObj); + return updateSkillWithResponse(name, updateSkillRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(Skill.class)); } /** - * Creates a skill from a zip package. + * Creates a new version of a skill. If the skill does not exist, it will be created. * - * @param body The zip package used to create the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. + * @param inlineContent Inline skill content for simple skills without file uploads. Foundry-specific extension. + * @param defaultParameter Whether to set this version as the default. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object on successful completion of {@link Mono}. + * @return a specific version of a skill on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSkillFromPackage(BinaryData body) { - // Generated convenience method for createSkillFromPackageWithResponse + public Mono createSkillVersion(String name, SkillInlineContent inlineContent, + Boolean defaultParameter) { + // Generated convenience method for createSkillVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return createSkillFromPackageWithResponse(body, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)); + CreateSkillVersionRequest createSkillVersionRequestObj + = new CreateSkillVersionRequest().setInlineContent(inlineContent).setDefaultProperty(defaultParameter); + BinaryData createSkillVersionRequest = BinaryData.fromObject(createSkillVersionRequestObj); + return createSkillVersionWithResponse(name, createSkillVersionRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SkillVersion.class)); } /** - * Retrieves a skill. + * Creates a new version of a skill. If the skill does not exist, it will be created. * - * @param skillName The unique name of the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object on successful completion of {@link Mono}. + * @return a specific version of a skill on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSkill(String skillName) { - // Generated convenience method for getSkillWithResponse + public Mono createSkillVersion(String name) { + // Generated convenience method for createSkillVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return getSkillWithResponse(skillName, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)); + CreateSkillVersionRequest createSkillVersionRequestObj = new CreateSkillVersionRequest(); + BinaryData createSkillVersionRequest = BinaryData.fromObject(createSkillVersionRequestObj); + return createSkillVersionWithResponse(name, createSkillVersionRequest, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SkillVersion.class)); } /** - * Downloads a skill package as a ZIP archive containing {@code SKILL.md}. Returns the original uploaded archive for - * skills created via {@code createSkillFromPackage}; materializes a ZIP from stored instructions for skills created - * via {@code createSkill}. + * Creates a new version of a skill from uploaded files via multipart form data. * - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param content The content parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. + * @return a specific version of a skill on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono downloadSkill(String skillName) { - // Generated convenience method for downloadSkillWithResponse + public Mono createSkillVersionFromFiles(String name, CreateSkillVersionFromFilesBody content) { + // Generated convenience method for createSkillVersionFromFilesWithResponse RequestOptions requestOptions = new RequestOptions(); - return downloadSkillWithResponse(skillName, requestOptions).flatMap(FluxUtil::toMono); + return createSkillVersionFromFilesWithResponse(name, + new MultipartFormDataHelper(requestOptions) + .serializeFileFields("files", + content.getFiles().stream().map(SkillFileDetails::getContent).collect(Collectors.toList()), + content.getFiles().stream().map(SkillFileDetails::getContentType).collect(Collectors.toList()), + content.getFiles().stream().map(SkillFileDetails::getFilename).collect(Collectors.toList())) + .serializeTextField("default", Objects.toString(content.isDefaultProperty())) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SkillVersion.class)); } /** - * Returns the list of all skills. + * List all versions of a skill. * + * @param name The name of the skill to list versions for. * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 20. * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` @@ -464,8 +713,9 @@ public Mono downloadSkill(String skillName) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkills(Integer limit, PageOrder order, String after, String before) { - // Generated convenience method for listSkills + public PagedFlux listSkillVersions(String name, Integer limit, PageOrder order, String after, + String before) { + // Generated convenience method for listSkillVersions RequestOptions requestOptions = new RequestOptions(); if (limit != null) { requestOptions.addQueryParam("limit", String.valueOf(limit), false); @@ -479,24 +729,26 @@ public PagedFlux listSkills(Integer limit, PageOrder order, String if (before != null) { requestOptions.addQueryParam("before", before, false); } - PagedFlux pagedFluxResponse = listSkills(requestOptions); + PagedFlux pagedFluxResponse = listSkillVersions(name, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() .stream() - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)) + .map(protocolMethodData -> protocolMethodData.toObject(SkillVersion.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** - * Returns the list of all skills. + * List all versions of a skill. * + * @param name The name of the skill to list versions for. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -506,96 +758,163 @@ public PagedFlux listSkills(Integer limit, PageOrder order, String */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkills() { - // Generated convenience method for listSkills + public PagedFlux listSkillVersions(String name) { + // Generated convenience method for listSkillVersions RequestOptions requestOptions = new RequestOptions(); - PagedFlux pagedFluxResponse = listSkills(requestOptions); + PagedFlux pagedFluxResponse = listSkillVersions(name, requestOptions); return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { Flux> flux = (continuationTokenParam == null) ? pagedFluxResponse.byPage().take(1) : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), pagedResponse.getStatusCode(), pagedResponse.getHeaders(), pagedResponse.getValue() .stream() - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)) + .map(protocolMethodData -> protocolMethodData.toObject(SkillVersion.class)) .collect(Collectors.toList()), pagedResponse.getContinuationToken(), null)); }); } /** - * Updates an existing skill. + * Retrieve a specific version of a skill. * - * @param skillName The unique name of the skill. - * @param description A human-readable description of the skill. - * @param instructions Instructions that define the behavior of the skill. - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. + * @param name The name of the skill. + * @param version The version identifier to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific version of a skill on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getSkillVersion(String name, String version) { + // Generated convenience method for getSkillVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSkillVersionWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(SkillVersion.class)); + } + + /** + * Download the zip content for the default version of a skill. * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. + * @param name The name of the skill. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSkill(String skillName, String description, String instructions, - Map metadata) { - // Generated convenience method for updateSkillWithResponse + public Mono getSkillContent(String name) { + // Generated convenience method for getSkillContentWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateSkillRequest updateSkillRequestObj - = new UpdateSkillRequest().setDescription(description).setInstructions(instructions).setMetadata(metadata); - BinaryData updateSkillRequest = BinaryData.fromObject(updateSkillRequestObj); - return updateSkillWithResponse(skillName, updateSkillRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)); + return getSkillContentWithResponse(name, requestOptions).flatMap(FluxUtil::toMono); } /** - * Updates an existing skill. + * Download the zip content for a specific version of a skill. * - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param version The version to download content for. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSkill(String skillName) { - // Generated convenience method for updateSkillWithResponse + public Mono getSkillVersionContent(String name, String version) { + // Generated convenience method for getSkillVersionContentWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateSkillRequest updateSkillRequestObj = new UpdateSkillRequest(); - BinaryData updateSkillRequest = BinaryData.fromObject(updateSkillRequestObj); - return updateSkillWithResponse(skillName, updateSkillRequest, requestOptions).flatMap(FluxUtil::toMono) - .map(protocolMethodData -> protocolMethodData.toObject(SkillDetails.class)); + return getSkillVersionContentWithResponse(name, version, requestOptions).flatMap(FluxUtil::toMono); } /** - * Deletes a skill. + * Delete a specific version of a skill. + *

Response Body Schema

* - * @param skillName The unique name of the skill. + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     *     version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the skill. + * @param version The version identifier to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteSkillVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return internalDeleteSkillVersionWithResponse(name, version, requestOptions) + .map(response -> new SimpleResponse<>(response, null)); + } + + /** + * Delete a specific version of a skill. + * + * @param name The name of the skill. + * @param version The version identifier to delete. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a {@link Mono} that completes when the skill is successfully deleted. + * @return a {@link Mono} that completes when the skill version is deleted. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteSkill(String skillName) { - // Generated convenience method for deleteSkillWithResponse + public Mono deleteSkillVersion(String name, String version) { + // Generated convenience method for deleteSkillVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return deleteSkillWithResponse(skillName, requestOptions).then(); + return deleteSkillVersionWithResponse(name, version, requestOptions).then(); + } + + /** + * Deletes a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The unique name of the skill. + * @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 a deleted skill along with {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> internalDeleteSkillWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.internalDeleteSkillWithResponseAsync(name, requestOptions); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsClient.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsClient.java index e026d09c1b4d..9a20863f9980 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsClient.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/SkillsClient.java @@ -4,10 +4,15 @@ package com.azure.ai.projects; import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.implementation.MultipartFormDataHelper; import com.azure.ai.projects.implementation.SkillsImpl; -import com.azure.ai.projects.implementation.models.CreateSkillRequest; +import com.azure.ai.projects.implementation.models.CreateSkillVersionRequest; import com.azure.ai.projects.implementation.models.UpdateSkillRequest; -import com.azure.ai.projects.models.SkillDetails; +import com.azure.ai.projects.models.CreateSkillVersionFromFilesBody; +import com.azure.ai.projects.models.Skill; +import com.azure.ai.projects.models.SkillFileDetails; +import com.azure.ai.projects.models.SkillInlineContent; +import com.azure.ai.projects.models.SkillVersion; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -19,8 +24,10 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.BinaryData; -import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; /** * Initializes a new instance of the synchronous AIProjectClient type. @@ -42,59 +49,95 @@ public final class SkillsClient { } /** - * Creates a skill. - *

Request Body Schema

+ * Retrieves a skill. + *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
- * + * + * @param name The unique name of the skill. + * @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 a skill resource along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSkillWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getSkillWithResponse(name, requestOptions); + } + + /** + * Returns the list of all skills. + *

Query Parameters

+ *
Query Parameters
+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} *

Response Body Schema

* *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
* - * @param createSkillRequest The createSkillRequest parameter. * @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 a skill object along with {@link Response}. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. */ @Generated - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSkillWithResponse(BinaryData createSkillRequest, RequestOptions requestOptions) { - return this.serviceClient.createSkillWithResponse(createSkillRequest, requestOptions); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkills(RequestOptions requestOptions) { + return this.serviceClient.listSkills(requestOptions); } /** - * Creates a skill from a zip package. + * Update a skill. *

Request Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     default_version: String (Required)
+     * }
      * }
      * 
* @@ -103,91 +146,248 @@ public Response createSkillWithResponse(BinaryData createSkillReques *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
* - * @param body The zip package used to create the skill. + * @param name The name of the skill to update. + * @param updateSkillRequest The updateSkillRequest parameter. * @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 a skill object along with {@link Response}. + * @return a skill resource along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSkillFromPackageWithResponse(BinaryData body, RequestOptions requestOptions) { - return this.serviceClient.createSkillFromPackageWithResponse(body, requestOptions); + public Response updateSkillWithResponse(String name, BinaryData updateSkillRequest, + RequestOptions requestOptions) { + return this.serviceClient.updateSkillWithResponse(name, updateSkillRequest, requestOptions); + } + + /** + * Deletes a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The unique name of the skill. + * @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 a deleted skill along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSkillWithResponse(String name, RequestOptions requestOptions) { + return new SimpleResponse<>(internalDeleteSkillWithResponse(name, requestOptions), null); } /** * Retrieves a skill. + * + * @param name The unique name of the skill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a skill resource. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Skill getSkill(String name) { + // Generated convenience method for getSkillWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSkillWithResponse(name, requestOptions).getValue().toObject(Skill.class); + } + + /** + * Returns the list of all skills. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkills(Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listSkills + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listSkills(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Skill.class)); + } + + /** + * Returns the list of all skills. + * + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkills() { + // Generated convenience method for listSkills + RequestOptions requestOptions = new RequestOptions(); + return serviceClient.listSkills(requestOptions).mapPage(bodyItemValue -> bodyItemValue.toObject(Skill.class)); + } + + /** + * Deletes a skill. + * + * @param skillName The unique name of the skill. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteSkill(String skillName) { + // Generated convenience method for deleteSkillWithResponse + RequestOptions requestOptions = new RequestOptions(); + deleteSkillWithResponse(skillName, requestOptions); + } + + /** + * Creates a new version of a skill. If the skill does not exist, it will be created. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     inline_content (Optional): {
+     *         description: String (Required)
+     *         instructions: String (Required)
+     *         license: String (Optional)
+     *         compatibility: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         allowed_tools (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     default: Boolean (Optional)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. + * @param createSkillVersionRequest The createSkillVersionRequest parameter. * @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 a skill object along with {@link Response}. + * @return a specific version of a skill along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSkillWithResponse(String skillName, RequestOptions requestOptions) { - return this.serviceClient.getSkillWithResponse(skillName, requestOptions); + public Response createSkillVersionWithResponse(String name, BinaryData createSkillVersionRequest, + RequestOptions requestOptions) { + return this.serviceClient.createSkillVersionWithResponse(name, createSkillVersionRequest, requestOptions); } /** - * Downloads a skill package as a ZIP archive containing {@code SKILL.md}. Returns the original uploaded archive for - * skills created via {@code createSkillFromPackage}; materializes a ZIP from stored instructions for skills created - * via {@code createSkill}. + * Creates a new version of a skill from uploaded files via multipart form data. *

Response Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return a specific version of a skill along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadSkillWithResponse(String skillName, RequestOptions requestOptions) { - return this.serviceClient.downloadSkillWithResponse(skillName, requestOptions); + Response createSkillVersionFromFilesWithResponse(String name, BinaryData content, + RequestOptions requestOptions) { + // Operation 'createSkillVersionFromFiles' is of content-type 'multipart/form-data'. Protocol API is not usable + // and hence not generated. + return this.serviceClient.createSkillVersionFromFilesWithResponse(name, content, requestOptions); } /** - * Returns the list of all skills. + * List all versions of a skill. *

Query Parameters

* * @@ -213,17 +413,17 @@ public Response downloadSkillWithResponse(String skillName, RequestO *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill to list versions for. * @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. @@ -233,205 +433,231 @@ public Response downloadSkillWithResponse(String skillName, RequestO */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkills(RequestOptions requestOptions) { - return this.serviceClient.listSkills(requestOptions); + public PagedIterable listSkillVersions(String name, RequestOptions requestOptions) { + return this.serviceClient.listSkillVersions(name, requestOptions); } /** - * Updates an existing skill. - *

Request Body Schema

+ * Retrieve a specific version of a skill. + *

Response Body Schema

* *
      * {@code
      * {
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
- * + * + * @param name The name of the skill. + * @param version The version identifier to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific version of a skill along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSkillVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.getSkillVersionWithResponse(name, version, requestOptions); + } + + /** + * Download the zip content for the default version of a skill. *

Response Body Schema

* *
      * {@code
-     * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
-     *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     * }
+     * BinaryData
      * }
      * 
* - * @param skillName The unique name of the skill. - * @param updateSkillRequest The updateSkillRequest parameter. + * @param name The name of the skill. * @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 a skill object along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSkillWithResponse(String skillName, BinaryData updateSkillRequest, - RequestOptions requestOptions) { - return this.serviceClient.updateSkillWithResponse(skillName, updateSkillRequest, requestOptions); + public Response getSkillContentWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.getSkillContentWithResponse(name, requestOptions); } /** - * Deletes a skill. + * Download the zip content for a specific version of a skill. *

Response Body Schema

* *
      * {@code
-     * {
-     *     name: String (Required)
-     *     deleted: boolean (Required)
-     * }
+     * BinaryData
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param version The version to download content for. * @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 a deleted skill Object along with {@link Response}. + * @return the response body along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSkillWithResponse(String skillName, RequestOptions requestOptions) { - return this.serviceClient.deleteSkillWithResponse(skillName, requestOptions); + public Response getSkillVersionContentWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.getSkillVersionContentWithResponse(name, version, requestOptions); } /** - * Creates a skill. - * - * @param name The unique name of the skill. - * @param description A human-readable description of the skill. - * @param instructions Instructions that define the behavior of the skill. - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. + * Delete a specific version of a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     *     version: String (Required)
+     * }
+     * }
+     * 
* - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param name The name of the skill. + * @param version The version identifier to delete. + * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object. + * @return a deleted skill version along with {@link Response}. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SkillDetails createSkill(String name, String description, String instructions, - Map metadata) { - // Generated convenience method for createSkillWithResponse - RequestOptions requestOptions = new RequestOptions(); - CreateSkillRequest createSkillRequestObj = new CreateSkillRequest(name).setDescription(description) - .setInstructions(instructions) - .setMetadata(metadata); - BinaryData createSkillRequest = BinaryData.fromObject(createSkillRequestObj); - return createSkillWithResponse(createSkillRequest, requestOptions).getValue().toObject(SkillDetails.class); + Response internalDeleteSkillVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + return this.serviceClient.internalDeleteSkillVersionWithResponse(name, version, requestOptions); } /** - * Creates a skill. + * Update a skill. * - * @param name The unique name of the skill. + * @param name The name of the skill to update. + * @param defaultVersion The version identifier that the skill should point to. When set, the skill's default + * version will resolve to this version instead of the latest. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object. + * @return a skill resource. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SkillDetails createSkill(String name) { - // Generated convenience method for createSkillWithResponse + public Skill updateSkill(String name, String defaultVersion) { + // Generated convenience method for updateSkillWithResponse RequestOptions requestOptions = new RequestOptions(); - CreateSkillRequest createSkillRequestObj = new CreateSkillRequest(name); - BinaryData createSkillRequest = BinaryData.fromObject(createSkillRequestObj); - return createSkillWithResponse(createSkillRequest, requestOptions).getValue().toObject(SkillDetails.class); + UpdateSkillRequest updateSkillRequestObj = new UpdateSkillRequest(defaultVersion); + BinaryData updateSkillRequest = BinaryData.fromObject(updateSkillRequestObj); + return updateSkillWithResponse(name, updateSkillRequest, requestOptions).getValue().toObject(Skill.class); } /** - * Creates a skill from a zip package. + * Creates a new version of a skill. If the skill does not exist, it will be created. * - * @param body The zip package used to create the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. + * @param inlineContent Inline skill content for simple skills without file uploads. Foundry-specific extension. + * @param defaultParameter Whether to set this version as the default. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object. + * @return a specific version of a skill. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SkillDetails createSkillFromPackage(BinaryData body) { - // Generated convenience method for createSkillFromPackageWithResponse + public SkillVersion createSkillVersion(String name, SkillInlineContent inlineContent, Boolean defaultParameter) { + // Generated convenience method for createSkillVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return createSkillFromPackageWithResponse(body, requestOptions).getValue().toObject(SkillDetails.class); + CreateSkillVersionRequest createSkillVersionRequestObj + = new CreateSkillVersionRequest().setInlineContent(inlineContent).setDefaultProperty(defaultParameter); + BinaryData createSkillVersionRequest = BinaryData.fromObject(createSkillVersionRequestObj); + return createSkillVersionWithResponse(name, createSkillVersionRequest, requestOptions).getValue() + .toObject(SkillVersion.class); } /** - * Retrieves a skill. + * Creates a new version of a skill. If the skill does not exist, it will be created. * - * @param skillName The unique name of the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object. + * @return a specific version of a skill. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SkillDetails getSkill(String skillName) { - // Generated convenience method for getSkillWithResponse + public SkillVersion createSkillVersion(String name) { + // Generated convenience method for createSkillVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - return getSkillWithResponse(skillName, requestOptions).getValue().toObject(SkillDetails.class); + CreateSkillVersionRequest createSkillVersionRequestObj = new CreateSkillVersionRequest(); + BinaryData createSkillVersionRequest = BinaryData.fromObject(createSkillVersionRequestObj); + return createSkillVersionWithResponse(name, createSkillVersionRequest, requestOptions).getValue() + .toObject(SkillVersion.class); } /** - * Downloads a skill package as a ZIP archive containing {@code SKILL.md}. Returns the original uploaded archive for - * skills created via {@code createSkillFromPackage}; materializes a ZIP from stored instructions for skills created - * via {@code createSkill}. + * Creates a new version of a skill from uploaded files via multipart form data. * - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param content The content parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return a specific version of a skill. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public BinaryData downloadSkill(String skillName) { - // Generated convenience method for downloadSkillWithResponse + public SkillVersion createSkillVersionFromFiles(String name, CreateSkillVersionFromFilesBody content) { + // Generated convenience method for createSkillVersionFromFilesWithResponse RequestOptions requestOptions = new RequestOptions(); - return downloadSkillWithResponse(skillName, requestOptions).getValue(); + return createSkillVersionFromFilesWithResponse(name, + new MultipartFormDataHelper(requestOptions) + .serializeFileFields("files", + content.getFiles().stream().map(SkillFileDetails::getContent).collect(Collectors.toList()), + content.getFiles().stream().map(SkillFileDetails::getContentType).collect(Collectors.toList()), + content.getFiles().stream().map(SkillFileDetails::getFilename).collect(Collectors.toList())) + .serializeTextField("default", Objects.toString(content.isDefaultProperty())) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(SkillVersion.class); } /** - * Returns the list of all skills. + * List all versions of a skill. * + * @param name The name of the skill to list versions for. * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the * default is 20. * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` @@ -452,8 +678,9 @@ public BinaryData downloadSkill(String skillName) { */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkills(Integer limit, PageOrder order, String after, String before) { - // Generated convenience method for listSkills + public PagedIterable listSkillVersions(String name, Integer limit, PageOrder order, String after, + String before) { + // Generated convenience method for listSkillVersions RequestOptions requestOptions = new RequestOptions(); if (limit != null) { requestOptions.addQueryParam("limit", String.valueOf(limit), false); @@ -467,13 +694,15 @@ public PagedIterable listSkills(Integer limit, PageOrder order, St if (before != null) { requestOptions.addQueryParam("before", before, false); } - return serviceClient.listSkills(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(SkillDetails.class)); + return serviceClient.listSkillVersions(name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(SkillVersion.class)); } /** - * Returns the list of all skills. + * List all versions of a skill. * + * @param name The name of the skill to list versions for. + * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. @@ -483,73 +712,109 @@ public PagedIterable listSkills(Integer limit, PageOrder order, St */ @Generated @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkills() { - // Generated convenience method for listSkills + public PagedIterable listSkillVersions(String name) { + // Generated convenience method for listSkillVersions RequestOptions requestOptions = new RequestOptions(); - return serviceClient.listSkills(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(SkillDetails.class)); + return serviceClient.listSkillVersions(name, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(SkillVersion.class)); } /** - * Updates an existing skill. + * Retrieve a specific version of a skill. * - * @param skillName The unique name of the skill. - * @param description A human-readable description of the skill. - * @param instructions Instructions that define the behavior of the skill. - * @param metadata Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. + * @param name The name of the skill. + * @param version The version identifier to retrieve. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a specific version of a skill. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public SkillVersion getSkillVersion(String name, String version) { + // Generated convenience method for getSkillVersionWithResponse + RequestOptions requestOptions = new RequestOptions(); + return getSkillVersionWithResponse(name, version, requestOptions).getValue().toObject(SkillVersion.class); + } + + /** + * Download the zip content for the default version of a skill. * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. + * @param name The name of the skill. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SkillDetails updateSkill(String skillName, String description, String instructions, - Map metadata) { - // Generated convenience method for updateSkillWithResponse + public BinaryData getSkillContent(String name) { + // Generated convenience method for getSkillContentWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateSkillRequest updateSkillRequestObj - = new UpdateSkillRequest().setDescription(description).setInstructions(instructions).setMetadata(metadata); - BinaryData updateSkillRequest = BinaryData.fromObject(updateSkillRequestObj); - return updateSkillWithResponse(skillName, updateSkillRequest, requestOptions).getValue() - .toObject(SkillDetails.class); + return getSkillContentWithResponse(name, requestOptions).getValue(); } /** - * Updates an existing skill. + * Download the zip content for a specific version of a skill. * - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param version The version to download content for. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a skill object. + * @return the response. */ @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public SkillDetails updateSkill(String skillName) { - // Generated convenience method for updateSkillWithResponse + public BinaryData getSkillVersionContent(String name, String version) { + // Generated convenience method for getSkillVersionContentWithResponse RequestOptions requestOptions = new RequestOptions(); - UpdateSkillRequest updateSkillRequestObj = new UpdateSkillRequest(); - BinaryData updateSkillRequest = BinaryData.fromObject(updateSkillRequestObj); - return updateSkillWithResponse(skillName, updateSkillRequest, requestOptions).getValue() - .toObject(SkillDetails.class); + return getSkillVersionContentWithResponse(name, version, requestOptions).getValue(); } /** - * Deletes a skill. + * Delete a specific version of a skill. + *

Response Body Schema

* - * @param skillName The unique name of the skill. + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     *     version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The name of the skill. + * @param version The version identifier to delete. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteSkillVersionWithResponse(String name, String version, RequestOptions requestOptions) { + return new SimpleResponse<>(internalDeleteSkillVersionWithResponse(name, version, requestOptions), null); + } + + /** + * Delete a specific version of a skill. + * + * @param name The name of the skill. + * @param version The version identifier to delete. * @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. @@ -558,9 +823,37 @@ public SkillDetails updateSkill(String skillName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSkill(String skillName) { - // Generated convenience method for deleteSkillWithResponse + public void deleteSkillVersion(String name, String version) { + // Generated convenience method for deleteSkillVersionWithResponse RequestOptions requestOptions = new RequestOptions(); - deleteSkillWithResponse(skillName, requestOptions); + deleteSkillVersionWithResponse(name, version, requestOptions); + } + + /** + * Deletes a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     deleted: boolean (Required)
+     * }
+     * }
+     * 
+ * + * @param name The unique name of the skill. + * @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 a deleted skill along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response internalDeleteSkillWithResponse(String name, RequestOptions requestOptions) { + return this.serviceClient.internalDeleteSkillWithResponse(name, requestOptions); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/AIProjectClientImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/AIProjectClientImpl.java index 5224d2637538..53e9e888daba 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/AIProjectClientImpl.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/AIProjectClientImpl.java @@ -122,6 +122,20 @@ public IndexesImpl getIndexes() { return this.indexes; } + /** + * The ModelsImpl object to access its operations. + */ + private final ModelsImpl models; + + /** + * Gets the ModelsImpl object to access its operations. + * + * @return the ModelsImpl object. + */ + public ModelsImpl getModels() { + return this.models; + } + /** * The DeploymentsImpl object to access its operations. */ @@ -220,6 +234,20 @@ public SchedulesImpl getSchedules() { return this.schedules; } + /** + * The RoutinesImpl object to access its operations. + */ + private final RoutinesImpl routines; + + /** + * Gets the RoutinesImpl object to access its operations. + * + * @return the RoutinesImpl object. + */ + public RoutinesImpl getRoutines() { + return this.routines; + } + /** * The SkillsImpl object to access its operations. */ @@ -234,6 +262,20 @@ public SkillsImpl getSkills() { return this.skills; } + /** + * The DataGenerationJobsImpl object to access its operations. + */ + private final DataGenerationJobsImpl dataGenerationJobs; + + /** + * Gets the DataGenerationJobsImpl object to access its operations. + * + * @return the DataGenerationJobsImpl object. + */ + public DataGenerationJobsImpl getDataGenerationJobs() { + return this.dataGenerationJobs; + } + /** * Initializes an instance of AIProjectClient client. * @@ -285,6 +327,7 @@ public AIProjectClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializ this.connections = new ConnectionsImpl(this); this.datasets = new DatasetsImpl(this); this.indexes = new IndexesImpl(this); + this.models = new ModelsImpl(this); this.deployments = new DeploymentsImpl(this); this.redTeams = new RedTeamsImpl(this); this.evaluationRules = new EvaluationRulesImpl(this); @@ -292,6 +335,8 @@ public AIProjectClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializ this.evaluators = new EvaluatorsImpl(this); this.insights = new InsightsImpl(this); this.schedules = new SchedulesImpl(this); + this.routines = new RoutinesImpl(this); this.skills = new SkillsImpl(this); + this.dataGenerationJobs = new DataGenerationJobsImpl(this); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DataGenerationJobsImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DataGenerationJobsImpl.java new file mode 100644 index 000000000000..b2e87a11a7ed --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DataGenerationJobsImpl.java @@ -0,0 +1,1441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.projects.implementation; + +import com.azure.ai.projects.AIProjectsServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataGenerationJobs. + */ +public final class DataGenerationJobsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final DataGenerationJobsService service; + + /** + * The service client containing this operation class. + */ + private final AIProjectClientImpl client; + + /** + * Initializes an instance of DataGenerationJobsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataGenerationJobsImpl(AIProjectClientImpl client) { + this.service = RestProxy.create(DataGenerationJobsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AIProjectsServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for AIProjectClientDataGenerationJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AIProjectClientDataGenerationJobs") + public interface DataGenerationJobsService { + @Get("/data_generation_jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getGenerationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/data_generation_jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getGenerationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/data_generation_jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listGenerationJobs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/data_generation_jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listGenerationJobsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/data_generation_jobs") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createGenerationJob(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData job, + RequestOptions requestOptions, Context context); + + @Post("/data_generation_jobs") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createGenerationJobSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData job, + RequestOptions requestOptions, Context context); + + @Post("/data_generation_jobs/{jobId}:cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cancelGenerationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/data_generation_jobs/{jobId}:cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response cancelGenerationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/data_generation_jobs/{jobId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteGenerationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + + @Delete("/data_generation_jobs/{jobId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteGenerationJobSync(@HostParam("endpoint") String endpoint, @PathParam("jobId") String jobId, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + *

Header Parameters

+ *
Query Parameters
+ * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about a data generation job. + * + * Gets the details of a data generation job by its ID along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGenerationJobWithResponseAsync(String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getGenerationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Get info about a data generation job. + * + * Gets the details of a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about a data generation job. + * + * Gets the details of a data generation job by its ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getGenerationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGenerationJobsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGenerationJobs(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGenerationJobsAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listGenerationJobsSinglePageAsync(requestOptions)); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listGenerationJobsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listGenerationJobsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * Returns a list of data generation jobs + * + * Returns a list of data generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGenerationJobs(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listGenerationJobsSinglePage(requestOptions)); + } + + /** + * Creates a data generation job. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (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 data Generation Job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createGenerationJobWithResponseAsync(BinaryData job, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createGenerationJob(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, job, requestOptions, context)); + } + + /** + * Creates a data generation job. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (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 data Generation Job resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createGenerationJobWithResponse(BinaryData job, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createGenerationJobSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + contentType, accept, job, requestOptions, Context.NONE); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 data Generation Job resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelGenerationJobWithResponseAsync(String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.cancelGenerationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Cancels a data generation job. + * + * Cancels a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         name: String (Required)
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/file) (Required)
+     *                 description: String (Optional)
+     *             }
+     *         ]
+     *         options (Required): {
+     *             type: String(simple_qna/traces/tool_use) (Required)
+     *             max_samples: int (Required)
+     *             train_split: Double (Optional)
+     *             model_options (Optional): {
+     *                 model: String (Required)
+     *             }
+     *         }
+     *         scenario: String(supervised_finetuning/reinforcement_finetuning/evaluation) (Required)
+     *         output_options (Optional): {
+     *             name: String (Optional)
+     *             description: String (Optional)
+     *             tags (Optional): {
+     *                 String: String (Required)
+     *             }
+     *         }
+     *     }
+     *     result (Optional): {
+     *         outputs (Optional): [
+     *              (Optional){
+     *                 type: String(file/dataset) (Required)
+     *             }
+     *         ]
+     *         generated_samples: int (Required)
+     *         token_usage (Optional): {
+     *             prompt_tokens: long (Required)
+     *             completion_tokens: long (Required)
+     *             total_tokens: long (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)
+     *     finished_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 data Generation Job resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.cancelGenerationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteGenerationJobWithResponseAsync(String jobId, RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteGenerationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), requestOptions, context)); + } + + /** + * Deletes a data generation job. + * + * Deletes a data generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return service.deleteGenerationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DatasetsImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DatasetsImpl.java index f376ba88a340..e275c1640370 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DatasetsImpl.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/DatasetsImpl.java @@ -838,7 +838,7 @@ public Response createOrUpdateDatasetVersionWithResponse(String name * { * pendingUploadId: String (Optional) * connectionName: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
@@ -858,7 +858,7 @@ public Response createOrUpdateDatasetVersionWithResponse(String name * } * pendingUploadId: String (Required) * version: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
@@ -893,7 +893,7 @@ public Mono> pendingUploadWithResponseAsync(String name, St * { * pendingUploadId: String (Optional) * connectionName: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } *
@@ -913,7 +913,7 @@ public Mono> pendingUploadWithResponseAsync(String name, St * } * pendingUploadId: String (Required) * version: String (Optional) - * pendingUploadType: String(None/BlobReference) (Required) + * pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required) * } * } * diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationRulesImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationRulesImpl.java index 185770021da4..ee85841e9314 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationRulesImpl.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationRulesImpl.java @@ -305,7 +305,8 @@ public Response deleteEvaluationRuleWithResponse(String id, RequestOptions * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

@@ -382,7 +383,8 @@ public Mono> createOrUpdateEvaluationRuleWithResponseAsync( * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Request Body Schema

diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationTaxonomiesImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationTaxonomiesImpl.java index 879e65c882a8..5689abe1a802 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationTaxonomiesImpl.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluationTaxonomiesImpl.java @@ -151,7 +151,7 @@ Response deleteEvaluationTaxonomySync(@HostParam("endpoint") String endpoi Mono> createEvaluationTaxonomy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData taxonomy, RequestOptions requestOptions, Context context); @Put("/evaluationtaxonomies/{name}") @@ -163,7 +163,7 @@ Mono> createEvaluationTaxonomy(@HostParam("endpoint") Strin Response createEvaluationTaxonomySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData taxonomy, RequestOptions requestOptions, Context context); @Patch("/evaluationtaxonomies/{name}") @@ -175,7 +175,7 @@ Response createEvaluationTaxonomySync(@HostParam("endpoint") String Mono> updateEvaluationTaxonomy(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData taxonomy, RequestOptions requestOptions, Context context); @Patch("/evaluationtaxonomies/{name}") @@ -187,7 +187,7 @@ Mono> updateEvaluationTaxonomy(@HostParam("endpoint") Strin Response updateEvaluationTaxonomySync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("name") String name, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData body, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData taxonomy, RequestOptions requestOptions, Context context); @Get("{nextLink}") @@ -749,7 +749,7 @@ public Response deleteEvaluationTaxonomyWithResponse(String name, RequestO * * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -758,13 +758,13 @@ public Response deleteEvaluationTaxonomyWithResponse(String name, RequestO * @return evaluation Taxonomy Definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createEvaluationTaxonomyWithResponseAsync(String name, BinaryData body, + public Mono> createEvaluationTaxonomyWithResponseAsync(String name, BinaryData taxonomy, RequestOptions requestOptions) { final String foundryFeatures = "Evaluations=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.createEvaluationTaxonomy(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, body, + this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, taxonomy, requestOptions, context)); } @@ -859,7 +859,7 @@ public Mono> createEvaluationTaxonomyWithResponseAsync(Stri * * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -868,13 +868,13 @@ public Mono> createEvaluationTaxonomyWithResponseAsync(Stri * @return evaluation Taxonomy Definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createEvaluationTaxonomyWithResponse(String name, BinaryData body, + public Response createEvaluationTaxonomyWithResponse(String name, BinaryData taxonomy, RequestOptions requestOptions) { final String foundryFeatures = "Evaluations=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; return service.createEvaluationTaxonomySync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, body, + this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, taxonomy, requestOptions, Context.NONE); } @@ -969,7 +969,7 @@ public Response createEvaluationTaxonomyWithResponse(String name, Bi * * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -978,13 +978,13 @@ public Response createEvaluationTaxonomyWithResponse(String name, Bi * @return evaluation Taxonomy Definition along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateEvaluationTaxonomyWithResponseAsync(String name, BinaryData body, + public Mono> updateEvaluationTaxonomyWithResponseAsync(String name, BinaryData taxonomy, RequestOptions requestOptions) { final String foundryFeatures = "Evaluations=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil.withContext(context -> service.updateEvaluationTaxonomy(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, body, + this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, taxonomy, requestOptions, context)); } @@ -1079,7 +1079,7 @@ public Mono> updateEvaluationTaxonomyWithResponseAsync(Stri * * * @param name The name of the evaluation taxonomy. - * @param body The evaluation taxonomy. + * @param taxonomy The evaluation taxonomy. * @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. @@ -1088,13 +1088,13 @@ public Mono> updateEvaluationTaxonomyWithResponseAsync(Stri * @return evaluation Taxonomy Definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateEvaluationTaxonomyWithResponse(String name, BinaryData body, + public Response updateEvaluationTaxonomyWithResponse(String name, BinaryData taxonomy, RequestOptions requestOptions) { final String foundryFeatures = "Evaluations=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; return service.updateEvaluationTaxonomySync(this.client.getEndpoint(), - this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, body, + this.client.getServiceVersion().getVersion(), foundryFeatures, name, contentType, accept, taxonomy, requestOptions, Context.NONE); } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluatorsImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluatorsImpl.java index 0cab4112528c..6274b0ee1e43 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluatorsImpl.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/EvaluatorsImpl.java @@ -214,6 +214,156 @@ Response updateEvaluatorVersionSync(@HostParam("endpoint") String en @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData evaluatorVersion, RequestOptions requestOptions, Context context); + @Post("/evaluators/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> startPendingUpload(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData pendingUploadRequest, + RequestOptions requestOptions, Context context); + + @Post("/evaluators/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response startPendingUploadSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData pendingUploadRequest, + RequestOptions requestOptions, Context context); + + @Post("/evaluators/{name}/versions/{version}/credentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getCredentials(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData credentialRequest, + RequestOptions requestOptions, Context context); + + @Post("/evaluators/{name}/versions/{version}/credentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getCredentialsSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @PathParam("version") String version, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData credentialRequest, RequestOptions requestOptions, + Context context); + + @Post("/evaluator_generation_jobs") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createEvaluatorGenerationJob(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData job, + RequestOptions requestOptions, Context context); + + @Post("/evaluator_generation_jobs") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createEvaluatorGenerationJobSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData job, + RequestOptions requestOptions, Context context); + + @Get("/evaluator_generation_jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getEvaluatorGenerationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/evaluator_generation_jobs/{jobId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getEvaluatorGenerationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/evaluator_generation_jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listEvaluatorGenerationJobs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/evaluator_generation_jobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listEvaluatorGenerationJobsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Post("/evaluator_generation_jobs/{jobId}:cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> cancelEvaluatorGenerationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/evaluator_generation_jobs/{jobId}:cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response cancelEvaluatorGenerationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/evaluator_generation_jobs/{jobId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteEvaluatorGenerationJob(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + + @Delete("/evaluator_generation_jobs/{jobId}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteEvaluatorGenerationJobSync(@HostParam("endpoint") String endpoint, + @PathParam("jobId") String jobId, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @@ -285,7 +435,7 @@ Response listLatestEvaluatorVersionsNextSync( * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -303,6 +453,15 @@ Response listLatestEvaluatorVersionsNextSync( * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -364,7 +523,7 @@ private Mono> listEvaluatorVersionsSinglePageAsync(Str * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -382,6 +541,15 @@ private Mono> listEvaluatorVersionsSinglePageAsync(Str * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -439,7 +607,7 @@ public PagedFlux listEvaluatorVersionsAsync(String name, RequestOpti * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -457,6 +625,15 @@ public PagedFlux listEvaluatorVersionsAsync(String name, RequestOpti * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -515,7 +692,7 @@ private PagedResponse listEvaluatorVersionsSinglePage(String name, R * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -533,6 +710,15 @@ private PagedResponse listEvaluatorVersionsSinglePage(String name, R * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -590,7 +776,7 @@ public PagedIterable listEvaluatorVersions(String name, RequestOptio * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -608,6 +794,15 @@ public PagedIterable listEvaluatorVersions(String name, RequestOptio * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -667,7 +862,7 @@ private Mono> listLatestEvaluatorVersionsSinglePageAsy * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -685,6 +880,15 @@ private Mono> listLatestEvaluatorVersionsSinglePageAsy * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -741,7 +945,7 @@ public PagedFlux listLatestEvaluatorVersionsAsync(RequestOptions req * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -759,6 +963,15 @@ public PagedFlux listLatestEvaluatorVersionsAsync(RequestOptions req * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -816,7 +1029,7 @@ private PagedResponse listLatestEvaluatorVersionsSinglePage(RequestO * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -834,6 +1047,15 @@ private PagedResponse listLatestEvaluatorVersionsSinglePage(RequestO * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -881,7 +1103,7 @@ public PagedIterable listLatestEvaluatorVersions(RequestOptions requ * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -899,6 +1121,15 @@ public PagedIterable listLatestEvaluatorVersions(RequestOptions requ * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -950,7 +1181,7 @@ public Mono> getEvaluatorVersionWithResponseAsync(String na * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -968,6 +1199,15 @@ public Mono> getEvaluatorVersionWithResponseAsync(String na * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1058,7 +1298,7 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1076,6 +1316,15 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1104,7 +1353,7 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1122,6 +1371,15 @@ public Response deleteEvaluatorVersionWithResponse(String name, String ver * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1172,7 +1430,7 @@ public Mono> createEvaluatorVersionWithResponseAsync(String * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1190,6 +1448,15 @@ public Mono> createEvaluatorVersionWithResponseAsync(String * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1218,7 +1485,7 @@ public Mono> createEvaluatorVersionWithResponseAsync(String * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1236,6 +1503,15 @@ public Mono> createEvaluatorVersionWithResponseAsync(String * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1286,7 +1562,7 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1304,6 +1580,15 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1332,7 +1617,7 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1350,6 +1635,15 @@ public Response createEvaluatorVersionWithResponse(String name, Bina * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1401,7 +1695,7 @@ public Mono> updateEvaluatorVersionWithResponseAsync(String * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1419,6 +1713,15 @@ public Mono> updateEvaluatorVersionWithResponseAsync(String * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1447,7 +1750,7 @@ public Mono> updateEvaluatorVersionWithResponseAsync(String * String(quality/safety/agents) (Required) * ] * definition (Required): { - * type: String(prompt/code/prompt_and_code/service/openai_graders) (Required) + * type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required) * init_parameters (Optional): { * String: BinaryData (Required) * } @@ -1465,6 +1768,15 @@ public Mono> updateEvaluatorVersionWithResponseAsync(String * } * } * } + * generation_artifacts (Optional): { + * dataset (Required): { + * name: String (Required) + * version: String (Required) + * } + * kinds (Required): [ + * String (Required) + * ] + * } * created_by: String (Required) * created_at: OffsetDateTime (Required) * modified_at: OffsetDateTime (Required) @@ -1501,147 +1813,1972 @@ public Response updateEvaluatorVersionWithResponse(String name, Stri } /** - * Get the next page of items. + * Start a new or get an existing pending upload of an evaluator for a specific version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     display_name: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     evaluator_type: String(builtin/custom) (Required)
-     *     categories (Required): [
-     *         String(quality/safety/agents) (Required)
-     *     ]
-     *     definition (Required): {
-     *         type: String(prompt/code/prompt_and_code/service/openai_graders) (Required)
-     *         init_parameters (Optional): {
-     *             String: BinaryData (Required)
-     *         }
-     *         data_schema (Optional): {
-     *             String: BinaryData (Required)
-     *         }
-     *         metrics (Optional): {
-     *             String (Required): {
-     *                 type: String(ordinal/continuous/boolean) (Optional)
-     *                 desirable_direction: String(increase/decrease/neutral) (Optional)
-     *                 min_value: Double (Optional)
-     *                 max_value: Double (Optional)
-     *                 threshold: Double (Optional)
-     *                 is_primary: Boolean (Optional)
-     *             }
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
      *         }
      *     }
-     *     created_by: String (Required)
-     *     created_at: OffsetDateTime (Required)
-     *     modified_at: OffsetDateTime (Required)
-     *     id: String (Optional)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     tags (Optional): {
-     *         String: String (Required)
-     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
      * }
      * }
      * 
* - * @param nextLink The URL to get the next list of items. + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. * @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 paged collection of EvaluatorVersion items along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return represents the response for a pending upload request along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listEvaluatorVersionsNextSinglePageAsync(String nextLink, - RequestOptions requestOptions) { - final String foundryFeatures = "Evaluations=V1Preview"; + public Mono> startPendingUploadWithResponseAsync(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listEvaluatorVersionsNext(nextLink, this.client.getEndpoint(), - foundryFeatures, accept, requestOptions, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + return FluxUtil.withContext(context -> service.startPendingUpload(this.client.getEndpoint(), name, version, + this.client.getServiceVersion().getVersion(), contentType, accept, pendingUploadRequest, requestOptions, + context)); } /** - * Get the next page of items. + * Start a new or get an existing pending upload of an evaluator for a specific version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
-     *     display_name: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
-     *     evaluator_type: String(builtin/custom) (Required)
-     *     categories (Required): [
-     *         String(quality/safety/agents) (Required)
-     *     ]
-     *     definition (Required): {
-     *         type: String(prompt/code/prompt_and_code/service/openai_graders) (Required)
-     *         init_parameters (Optional): {
-     *             String: BinaryData (Required)
-     *         }
-     *         data_schema (Optional): {
-     *             String: BinaryData (Required)
-     *         }
-     *         metrics (Optional): {
-     *             String (Required): {
-     *                 type: String(ordinal/continuous/boolean) (Optional)
-     *                 desirable_direction: String(increase/decrease/neutral) (Optional)
-     *                 min_value: Double (Optional)
-     *                 max_value: Double (Optional)
-     *                 threshold: Double (Optional)
-     *                 is_primary: Boolean (Optional)
-     *             }
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
      *         }
      *     }
-     *     created_by: String (Required)
-     *     created_at: OffsetDateTime (Required)
-     *     modified_at: OffsetDateTime (Required)
-     *     id: String (Optional)
-     *     name: String (Required)
-     *     version: String (Required)
-     *     description: String (Optional)
-     *     tags (Optional): {
-     *         String: String (Required)
-     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
      * }
      * }
      * 
* - * @param nextLink The URL to get the next list of items. + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param pendingUploadRequest The pending upload request parameters. * @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 paged collection of EvaluatorVersion items along with {@link PagedResponse}. + * @return represents the response for a pending upload request along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listEvaluatorVersionsNextSinglePage(String nextLink, - RequestOptions requestOptions) { - final String foundryFeatures = "Evaluations=V1Preview"; + public Response startPendingUploadWithResponse(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; final String accept = "application/json"; - Response res = service.listEvaluatorVersionsNextSync(nextLink, this.client.getEndpoint(), - foundryFeatures, accept, requestOptions, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + return service.startPendingUploadSync(this.client.getEndpoint(), name, version, + this.client.getServiceVersion().getVersion(), contentType, accept, pendingUploadRequest, requestOptions, + Context.NONE); } /** - * Get the next page of items. - *

Response Body Schema

- * - *
-     * {@code
+     * Get the SAS credential to access the storage account associated with an Evaluator version.
+     * 

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blob_uri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @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 SAS credential to access the storage account associated with an Evaluator version along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCredentialsWithResponseAsync(String name, String version, + BinaryData credentialRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getCredentials(this.client.getEndpoint(), name, version, + this.client.getServiceVersion().getVersion(), contentType, accept, credentialRequest, requestOptions, + context)); + } + + /** + * Get the SAS credential to access the storage account associated with an Evaluator version. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blob_uri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name parameter. + * @param version The specific version id of the EvaluatorVersion to operate on. + * @param credentialRequest The credential request parameters. + * @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 SAS credential to access the storage account associated with an Evaluator version along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCredentialsWithResponse(String name, String version, BinaryData credentialRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.getCredentialsSync(this.client.getEndpoint(), name, version, + this.client.getServiceVersion().getVersion(), contentType, accept, credentialRequest, requestOptions, + Context.NONE); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createEvaluatorGenerationJobWithResponseAsync(BinaryData job, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createEvaluatorGenerationJob(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, job, requestOptions, context)); + } + + /** + * Creates an evaluator generation job. + * + * Creates an evaluator generation job. The service generates rubric-based evaluator + * definitions from the provided source materials asynchronously. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
Operation-IdStringNoClient-generated unique ID for idempotent retries. When + * absent, the server creates the job unconditionally.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createEvaluatorGenerationJobWithResponse(BinaryData job, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createEvaluatorGenerationJobSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), contentType, accept, job, requestOptions, Context.NONE); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getEvaluatorGenerationJobWithResponseAsync(String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getEvaluatorGenerationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Get info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job. + * @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 info about an evaluator generation job. + * + * Gets the details of an evaluator generation job by its ID along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getEvaluatorGenerationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Returns a list of evaluator generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEvaluatorGenerationJobsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listEvaluatorGenerationJobs(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * Returns a list of evaluator generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listEvaluatorGenerationJobsAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listEvaluatorGenerationJobsSinglePageAsync(requestOptions)); + } + + /** + * Returns a list of evaluator generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listEvaluatorGenerationJobsSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listEvaluatorGenerationJobsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * Returns a list of evaluator generation jobs. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listEvaluatorGenerationJobs(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listEvaluatorGenerationJobsSinglePage(requestOptions)); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelEvaluatorGenerationJobWithResponseAsync(String jobId, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.cancelEvaluatorGenerationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Cancels an evaluator generation job. + * + * Cancels an evaluator generation job by its ID. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     inputs (Optional): {
+     *         sources (Required): [
+     *              (Required){
+     *                 type: String(prompt/agent/traces/dataset) (Required)
+     *             }
+     *         ]
+     *         model: String (Required)
+     *         evaluator_name: String (Required)
+     *         evaluator_display_name: String (Optional)
+     *         evaluator_description: String (Optional)
+     *     }
+     *     result (Optional): {
+     *         display_name: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         evaluator_type: String(builtin/custom) (Required)
+     *         categories (Required): [
+     *             String(quality/safety/agents) (Required)
+     *         ]
+     *         definition (Required): {
+     *             type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *             init_parameters (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             data_schema (Optional): {
+     *                 String: BinaryData (Required)
+     *             }
+     *             metrics (Optional): {
+     *                 String (Required): {
+     *                     type: String(ordinal/continuous/boolean) (Optional)
+     *                     desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                     min_value: Double (Optional)
+     *                     max_value: Double (Optional)
+     *                     threshold: Double (Optional)
+     *                     is_primary: Boolean (Optional)
+     *                 }
+     *             }
+     *         }
+     *         generation_artifacts (Optional): {
+     *             dataset (Required): {
+     *                 name: String (Required)
+     *                 version: String (Required)
+     *             }
+     *             kinds (Required): [
+     *                 String (Required)
+     *             ]
+     *         }
+     *         created_by: String (Required)
+     *         created_at: OffsetDateTime (Required)
+     *         modified_at: OffsetDateTime (Required)
+     *         id: String (Optional)
+     *         name: String (Required)
+     *         version: String (Required)
+     *         description: String (Optional)
+     *         tags (Optional): {
+     *             String: 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)
+     *     finished_at: Long (Optional)
+     *     usage (Optional): {
+     *         input_tokens: long (Required)
+     *         output_tokens: long (Required)
+     *         total_tokens: long (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param jobId The ID of the job to cancel. + * @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 evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions + * from source materials along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.cancelEvaluatorGenerationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteEvaluatorGenerationJobWithResponseAsync(String jobId, + RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteEvaluatorGenerationJob(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), requestOptions, context)); + } + + /** + * Deletes an evaluator generation job by its ID. Deletes the job record only; + * the generated evaluator (if any) is preserved. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param jobId The ID of the job to delete. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteEvaluatorGenerationJobWithResponse(String jobId, RequestOptions requestOptions) { + return service.deleteEvaluatorGenerationJobSync(this.client.getEndpoint(), jobId, + this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     display_name: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     evaluator_type: String(builtin/custom) (Required)
+     *     categories (Required): [
+     *         String(quality/safety/agents) (Required)
+     *     ]
+     *     definition (Required): {
+     *         type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *         init_parameters (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         data_schema (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         metrics (Optional): {
+     *             String (Required): {
+     *                 type: String(ordinal/continuous/boolean) (Optional)
+     *                 desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                 min_value: Double (Optional)
+     *                 max_value: Double (Optional)
+     *                 threshold: Double (Optional)
+     *                 is_primary: Boolean (Optional)
+     *             }
+     *         }
+     *     }
+     *     generation_artifacts (Optional): {
+     *         dataset (Required): {
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         kinds (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     created_by: String (Required)
+     *     created_at: OffsetDateTime (Required)
+     *     modified_at: OffsetDateTime (Required)
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @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 paged collection of EvaluatorVersion items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listEvaluatorVersionsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String foundryFeatures = "Evaluations=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listEvaluatorVersionsNext(nextLink, this.client.getEndpoint(), + foundryFeatures, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     display_name: String (Optional)
+     *     metadata (Optional): {
+     *         String: String (Required)
+     *     }
+     *     evaluator_type: String(builtin/custom) (Required)
+     *     categories (Required): [
+     *         String(quality/safety/agents) (Required)
+     *     ]
+     *     definition (Required): {
+     *         type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
+     *         init_parameters (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         data_schema (Optional): {
+     *             String: BinaryData (Required)
+     *         }
+     *         metrics (Optional): {
+     *             String (Required): {
+     *                 type: String(ordinal/continuous/boolean) (Optional)
+     *                 desirable_direction: String(increase/decrease/neutral) (Optional)
+     *                 min_value: Double (Optional)
+     *                 max_value: Double (Optional)
+     *                 threshold: Double (Optional)
+     *                 is_primary: Boolean (Optional)
+     *             }
+     *         }
+     *     }
+     *     generation_artifacts (Optional): {
+     *         dataset (Required): {
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         kinds (Required): [
+     *             String (Required)
+     *         ]
+     *     }
+     *     created_by: String (Required)
+     *     created_at: OffsetDateTime (Required)
+     *     modified_at: OffsetDateTime (Required)
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @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 paged collection of EvaluatorVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listEvaluatorVersionsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String foundryFeatures = "Evaluations=V1Preview"; + final String accept = "application/json"; + Response res = service.listEvaluatorVersionsNextSync(nextLink, this.client.getEndpoint(), + foundryFeatures, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
      * {
      *     display_name: String (Optional)
      *     metadata (Optional): {
@@ -1652,7 +3789,7 @@ private PagedResponse listEvaluatorVersionsNextSinglePage(String nex
      *         String(quality/safety/agents) (Required)
      *     ]
      *     definition (Required): {
-     *         type: String(prompt/code/prompt_and_code/service/openai_graders) (Required)
+     *         type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
      *         init_parameters (Optional): {
      *             String: BinaryData (Required)
      *         }
@@ -1670,6 +3807,15 @@ private PagedResponse listEvaluatorVersionsNextSinglePage(String nex
      *             }
      *         }
      *     }
+     *     generation_artifacts (Optional): {
+     *         dataset (Required): {
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         kinds (Required): [
+     *             String (Required)
+     *         ]
+     *     }
      *     created_by: String (Required)
      *     created_at: OffsetDateTime (Required)
      *     modified_at: OffsetDateTime (Required)
@@ -1721,7 +3867,7 @@ private Mono> listLatestEvaluatorVersionsNextSinglePag
      *         String(quality/safety/agents) (Required)
      *     ]
      *     definition (Required): {
-     *         type: String(prompt/code/prompt_and_code/service/openai_graders) (Required)
+     *         type: String(prompt/code/prompt_and_code/service/openai_graders/rubric) (Required)
      *         init_parameters (Optional): {
      *             String: BinaryData (Required)
      *         }
@@ -1739,6 +3885,15 @@ private Mono> listLatestEvaluatorVersionsNextSinglePag
      *             }
      *         }
      *     }
+     *     generation_artifacts (Optional): {
+     *         dataset (Required): {
+     *             name: String (Required)
+     *             version: String (Required)
+     *         }
+     *         kinds (Required): [
+     *             String (Required)
+     *         ]
+     *     }
      *     created_by: String (Required)
      *     created_at: OffsetDateTime (Required)
      *     modified_at: OffsetDateTime (Required)
diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/InsightsImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/InsightsImpl.java
index e46ec94e954b..2c32171b387c 100644
--- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/InsightsImpl.java
+++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/InsightsImpl.java
@@ -173,7 +173,8 @@ Response listInsightsNextSync(@PathParam(value = "nextLink", encoded
      * Foundry-FeaturesStringNoA feature flag opt-in required when using preview
      * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview",
      * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview",
-     * "Toolboxes=V1Preview", "Skills=V1Preview".
+     * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview",
+     * "Models=V1Preview", "AgentsOptimization=V1Preview".
      * repeatability-request-idStringNoRepeatability request ID header
      * repeatability-first-sentStringNoRepeatability first sent header as
      * HTTP-date
@@ -264,7 +265,8 @@ public Mono> generateInsightWithResponseAsync(BinaryData in
      * Foundry-FeaturesStringNoA feature flag opt-in required when using preview
      * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview",
      * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview",
-     * "Toolboxes=V1Preview", "Skills=V1Preview".
+     * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview",
+     * "Models=V1Preview", "AgentsOptimization=V1Preview".
      * repeatability-request-idStringNoRepeatability request ID header
      * repeatability-first-sentStringNoRepeatability first sent header as
      * HTTP-date
@@ -361,7 +363,8 @@ public Response generateInsightWithResponse(BinaryData insight, Requ
      * Foundry-FeaturesStringNoA feature flag opt-in required when using preview
      * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview",
      * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview",
-     * "Toolboxes=V1Preview", "Skills=V1Preview".
+     * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview",
+     * "Models=V1Preview", "AgentsOptimization=V1Preview".
      * 
      * You can add these to a request with {@link RequestOptions#addHeader}
      * 

Response Body Schema

@@ -418,7 +421,8 @@ public Mono> getInsightWithResponseAsync(String id, Request * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -480,7 +484,8 @@ public Response getInsightWithResponse(String id, RequestOptions req * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -545,7 +550,8 @@ private Mono> listInsightsSinglePageAsync(RequestOptio * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -608,7 +614,8 @@ public PagedFlux listInsightsAsync(RequestOptions requestOptions) { * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -671,7 +678,8 @@ private PagedResponse listInsightsSinglePage(RequestOptions requestO * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -721,7 +729,8 @@ public PagedIterable listInsights(RequestOptions requestOptions) { * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

@@ -774,7 +783,8 @@ private Mono> listInsightsNextSinglePageAsync(String n * Foundry-FeaturesStringNoA feature flag opt-in required when using preview * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", - * "Toolboxes=V1Preview", "Skills=V1Preview". + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview". * * You can add these to a request with {@link RequestOptions#addHeader} *

Response Body Schema

diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/JsonMergePatchHelper.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/JsonMergePatchHelper.java index e0ae53055cd9..73ce3124292b 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/JsonMergePatchHelper.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/JsonMergePatchHelper.java @@ -8,6 +8,7 @@ import com.azure.ai.projects.models.DatasetVersion; import com.azure.ai.projects.models.EmbeddingConfiguration; import com.azure.ai.projects.models.FieldMapping; +import com.azure.ai.projects.models.UpdateModelVersionInput; import java.util.Map; /** @@ -104,4 +105,21 @@ public static void setEmbeddingConfigurationAccessor(EmbeddingConfigurationAcces public static EmbeddingConfigurationAccessor getEmbeddingConfigurationAccessor() { return embeddingConfigurationAccessor; } + + private static UpdateModelVersionInputAccessor updateModelVersionInputAccessor; + + public interface UpdateModelVersionInputAccessor { + UpdateModelVersionInput prepareModelForJsonMergePatch(UpdateModelVersionInput updateModelVersionInput, + boolean jsonMergePatchEnabled); + + boolean isJsonMergePatch(UpdateModelVersionInput updateModelVersionInput); + } + + public static void setUpdateModelVersionInputAccessor(UpdateModelVersionInputAccessor accessor) { + updateModelVersionInputAccessor = accessor; + } + + public static UpdateModelVersionInputAccessor getUpdateModelVersionInputAccessor() { + return updateModelVersionInputAccessor; + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/ModelsImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/ModelsImpl.java new file mode 100644 index 000000000000..7461b04e8d46 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/ModelsImpl.java @@ -0,0 +1,1894 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.projects.implementation; + +import com.azure.ai.projects.AIProjectsServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Models. + */ +public final class ModelsImpl { + /** + * The proxy service used to perform REST calls. + */ + private final ModelsService service; + + /** + * The service client containing this operation class. + */ + private final AIProjectClientImpl client; + + /** + * Initializes an instance of ModelsImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ModelsImpl(AIProjectClientImpl client) { + this.service = RestProxy.create(ModelsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AIProjectsServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for AIProjectClientModels to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AIProjectClientModels") + public interface ModelsService { + @Get("/models/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listModelVersions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/models/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listModelVersionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listLatestModelVersions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/models") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listLatestModelVersionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/models/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelVersion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("version") String version, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/models/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelVersionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("version") String version, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Delete("/models/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteModelVersion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("version") String version, + RequestOptions requestOptions, Context context); + + @Delete("/models/{name}/versions/{version}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteModelVersionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @PathParam("version") String version, + RequestOptions requestOptions, Context context); + + @Patch("/models/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> updateModelVersion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @PathParam("version") String version, + @HeaderParam("Foundry-Features") String foundryFeatures, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData modelVersionUpdate, RequestOptions requestOptions, + Context context); + + @Patch("/models/{name}/versions/{version}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response updateModelVersionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Content-Type") String contentType, @PathParam("version") String version, + @HeaderParam("Foundry-Features") String foundryFeatures, @HeaderParam("Accept") String accept, + @BodyParam("application/merge-patch+json") BinaryData modelVersionUpdate, RequestOptions requestOptions, + Context context); + + @Post("/models/{name}/versions/{version}/createAsync") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createModelVersionAsync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData modelVersion, RequestOptions requestOptions, Context context); + + @Post("/models/{name}/versions/{version}/createAsync") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createModelVersionAsyncSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData modelVersion, RequestOptions requestOptions, Context context); + + @Post("/models/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> startModelPendingUpload(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData pendingUploadRequest, RequestOptions requestOptions, + Context context); + + @Post("/models/{name}/versions/{version}/startPendingUpload") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response startModelPendingUploadSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData pendingUploadRequest, RequestOptions requestOptions, + Context context); + + @Post("/models/{name}/versions/{version}/credentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getModelCredentials(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData credentialRequest, RequestOptions requestOptions, + Context context); + + @Post("/models/{name}/versions/{version}/credentials") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getModelCredentialsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Foundry-Features") String foundryFeatures, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData credentialRequest, RequestOptions requestOptions, + Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listModelVersionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Foundry-Features") String foundryFeatures, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listModelVersionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Foundry-Features") String foundryFeatures, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listLatestModelVersionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Foundry-Features") String foundryFeatures, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listLatestModelVersionsNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Foundry-Features") String foundryFeatures, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + } + + /** + * List all versions of the given ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @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 paged collection of ModelVersion items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listModelVersionsSinglePageAsync(String name, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listModelVersions(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), name, foundryFeatures, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List all versions of the given ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @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 paged collection of ModelVersion items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listModelVersionsAsync(String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listModelVersionsSinglePageAsync(name, requestOptions), + nextLink -> listModelVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List all versions of the given ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @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 paged collection of ModelVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listModelVersionsSinglePage(String name, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + Response res = service.listModelVersionsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), name, foundryFeatures, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List all versions of the given ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @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 paged collection of ModelVersion items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listModelVersions(String name, RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listModelVersionsSinglePage(name, requestOptions), + nextLink -> listModelVersionsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * List the latest version of each ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ModelVersion items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLatestModelVersionsSinglePageAsync(RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLatestModelVersions(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * List the latest version of each ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ModelVersion items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listLatestModelVersionsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listLatestModelVersionsSinglePageAsync(requestOptions), + nextLink -> listLatestModelVersionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } + + /** + * List the latest version of each ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ModelVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLatestModelVersionsSinglePage(RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + Response res = service.listLatestModelVersionsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * List the latest version of each ModelVersion. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return paged collection of ModelVersion items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listLatestModelVersions(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listLatestModelVersionsSinglePage(requestOptions), + nextLink -> listLatestModelVersionsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does + * not exist. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the ModelVersion to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the specific version of the ModelVersion along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelVersionWithResponseAsync(String name, String version, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.getModelVersion(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, foundryFeatures, version, accept, requestOptions, context)); + } + + /** + * Get the specific version of the ModelVersion. The service returns 404 Not Found error if the ModelVersion does + * not exist. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the ModelVersion to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the specific version of the ModelVersion along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelVersionWithResponse(String name, String version, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return service.getModelVersionSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, foundryFeatures, version, accept, requestOptions, Context.NONE); + } + + /** + * Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted + * successfully or if the ModelVersion does not exist. + * + * @param name The name of the resource. + * @param version The version of the ModelVersion to delete. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteModelVersionWithResponseAsync(String name, String version, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + return FluxUtil.withContext(context -> service.deleteModelVersion(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), name, foundryFeatures, version, requestOptions, context)); + } + + /** + * Delete the specific version of the ModelVersion. The service returns 200 OK if the ModelVersion was deleted + * successfully or if the ModelVersion does not exist. + * + * @param name The name of the resource. + * @param version The version of the ModelVersion to delete. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteModelVersionWithResponse(String name, String version, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + return service.deleteModelVersionSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, foundryFeatures, version, requestOptions, Context.NONE); + } + + /** + * Update an existing ModelVersion with the given version id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the UpdateModelVersionRequest to create or update. + * @param modelVersionUpdate The UpdateModelVersionRequest to create or update. + * @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 model Version Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> updateModelVersionWithResponseAsync(String name, String version, + BinaryData modelVersionUpdate, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.updateModelVersion(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), name, contentType, version, foundryFeatures, accept, + modelVersionUpdate, requestOptions, context)); + } + + /** + * Update an existing ModelVersion with the given version id. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name The name of the resource. + * @param version The specific version id of the UpdateModelVersionRequest to create or update. + * @param modelVersionUpdate The UpdateModelVersionRequest to create or update. + * @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 model Version Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateModelVersionWithResponse(String name, String version, + BinaryData modelVersionUpdate, RequestOptions requestOptions) { + final String contentType = "application/merge-patch+json"; + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return service.updateModelVersionSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + name, contentType, version, foundryFeatures, accept, modelVersionUpdate, requestOptions, Context.NONE); + } + + /** + * Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header + * for polling. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     location: String (Optional)
+     *     operationResult: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param modelVersion Model version 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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createModelVersionAsyncWithResponseAsync(String name, String version, + BinaryData modelVersion, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createModelVersionAsync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, name, version, contentType, accept, + modelVersion, requestOptions, context)); + } + + /** + * Creates a model version asynchronously with blob content validation. Returns 202 Accepted with a Location header + * for polling. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     location: String (Optional)
+     *     operationResult: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param modelVersion Model version 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 response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createModelVersionAsyncWithResponse(String name, String version, + BinaryData modelVersion, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createModelVersionAsyncSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, name, version, contentType, accept, + modelVersion, requestOptions, Context.NONE); + } + + /** + * Start or retrieve a pending upload for a model version. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param pendingUploadRequest The pendingUploadRequest parameter. + * @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 represents the response for a model pending upload request along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> startModelPendingUploadWithResponseAsync(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.startModelPendingUpload(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, name, version, contentType, accept, + pendingUploadRequest, requestOptions, context)); + } + + /** + * Start or retrieve a pending upload for a model version. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     pendingUploadId: String (Optional)
+     *     connectionName: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     *     pendingUploadId: String (Required)
+     *     version: String (Optional)
+     *     pendingUploadType: String(None/BlobReference/TemporaryBlobReference) (Required)
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param pendingUploadRequest The pendingUploadRequest parameter. + * @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 represents the response for a model pending upload request along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response startModelPendingUploadWithResponse(String name, String version, + BinaryData pendingUploadRequest, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.startModelPendingUploadSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, name, version, contentType, accept, + pendingUploadRequest, requestOptions, Context.NONE); + } + + /** + * Get credentials for a model version asset. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobUri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param credentialRequest The credentialRequest parameter. + * @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 credentials for a model version asset along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getModelCredentialsWithResponseAsync(String name, String version, + BinaryData credentialRequest, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getModelCredentials(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), foundryFeatures, name, version, contentType, accept, + credentialRequest, requestOptions, context)); + } + + /** + * Get credentials for a model version asset. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobUri: String (Required)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     blobReference (Required): {
+     *         blobUri: String (Required)
+     *         storageAccountArmId: String (Required)
+     *         credential (Required): {
+     *             sasUri: String (Required)
+     *             type: String(ApiKey/AAD/SAS/CustomKeys/None/AgenticIdentityToken_Preview) (Required)
+     *         }
+     *     }
+     * }
+     * }
+     * 
+ * + * @param name Name of the model. + * @param version Version of the model. + * @param credentialRequest The credentialRequest parameter. + * @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 credentials for a model version asset along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getModelCredentialsWithResponse(String name, String version, + BinaryData credentialRequest, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String contentType = "application/json"; + final String accept = "application/json"; + return service.getModelCredentialsSync(this.client.getEndpoint(), this.client.getServiceVersion().getVersion(), + foundryFeatures, name, version, contentType, accept, credentialRequest, requestOptions, Context.NONE); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @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 paged collection of ModelVersion items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listModelVersionsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listModelVersionsNext(nextLink, this.client.getEndpoint(), foundryFeatures, + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @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 paged collection of ModelVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listModelVersionsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + Response res = service.listModelVersionsNextSync(nextLink, this.client.getEndpoint(), + foundryFeatures, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @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 paged collection of ModelVersion items along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listLatestModelVersionsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listLatestModelVersionsNext(nextLink, this.client.getEndpoint(), + foundryFeatures, accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null)); + } + + /** + * Get the next page of items. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     systemData (Optional): {
+     *         createdAt: Long (Optional)
+     *         createdBy: String (Optional)
+     *         createdByType: String (Optional)
+     *         lastModifiedAt: Long (Optional)
+     *     }
+     *     blobUri: String (Required)
+     *     weightType: String(FullWeight/LoRA/DraftModel) (Optional)
+     *     baseModel: String (Optional)
+     *     source (Optional): {
+     *         sourceType: String(LocalUpload/TrainingJob) (Optional)
+     *         jobId: String (Optional)
+     *     }
+     *     loraConfig (Optional): {
+     *         rank: Integer (Optional)
+     *         alpha: Integer (Optional)
+     *         targetModules (Optional): [
+     *             String (Optional)
+     *         ]
+     *         dropout: Double (Optional)
+     *     }
+     *     artifactProfile (Optional): {
+     *         category: String(DataOnly/RuntimeDependent/Unknown) (Required)
+     *         signals (Optional): [
+     *             String(PickleDeserialization/CustomPythonCode/DynamicOps/NativeBinary/UnknownFormat) (Optional)
+     *         ]
+     *     }
+     *     warnings (Optional): [
+     *          (Optional){
+     *             code: String(RuntimeDependentArtifact/UnclassifiedArtifact) (Optional)
+     *             message: String (Optional)
+     *         }
+     *     ]
+     *     id: String (Optional)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + * @param nextLink The URL to get the next list of items. + * @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 paged collection of ModelVersion items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listLatestModelVersionsNextSinglePage(String nextLink, + RequestOptions requestOptions) { + final String foundryFeatures = "Models=V1Preview"; + final String accept = "application/json"; + Response res = service.listLatestModelVersionsNextSync(nextLink, this.client.getEndpoint(), + foundryFeatures, accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/MultipartFormDataHelper.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/MultipartFormDataHelper.java new file mode 100644 index 000000000000..222b687fd761 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/MultipartFormDataHelper.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.projects.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.UUID; + +// DO NOT modify this helper class + +public final class MultipartFormDataHelper { + /** + * Line separator for the multipart HTTP request. + */ + private static final String CRLF = "\r\n"; + + private static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + + /** + * Value to be used as part of the divider for the multipart requests. + */ + private final String boundary; + + /** + * The actual part separator in the request. This is obtained by prepending "--" to the "boundary". + */ + private final String partSeparator; + + /** + * The marker for the ending of a multipart request. This is obtained by post-pending "--" to the "partSeparator". + */ + private final String endMarker; + + /** + * Charset used for encoding the multipart HTTP request. + */ + private final Charset encoderCharset = StandardCharsets.UTF_8; + + private InputStream requestDataStream = new ByteArrayInputStream(new byte[0]); + private long requestLength = 0; + + private RequestOptions requestOptions; + private BinaryData requestBody; + + /** + * Default constructor used in the code. The boundary is a random value. + * + * @param requestOptions the RequestOptions to update + */ + public MultipartFormDataHelper(RequestOptions requestOptions) { + this(requestOptions, UUID.randomUUID().toString().substring(0, 16)); + } + + private MultipartFormDataHelper(RequestOptions requestOptions, String boundary) { + this.requestOptions = requestOptions; + this.boundary = boundary; + this.partSeparator = "--" + boundary; + this.endMarker = this.partSeparator + "--"; + } + + /** + * Gets the multipart HTTP request body. + * + * @return the BinaryData of the multipart HTTP request body + */ + public BinaryData getRequestBody() { + return requestBody; + } + + // text/plain + /** + * Formats a text/plain field for a multipart HTTP request. + * + * @param fieldName the field name + * @param value the value of the text/plain field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeTextField(String fieldName, String value) { + if (value != null) { + String serialized = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + + "\"" + CRLF + CRLF + value + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + // application/json + /** + * Formats a application/json field for a multipart HTTP request. + * + * @param fieldName the field name + * @param jsonObject the object of the application/json field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeJsonField(String fieldName, Object jsonObject) { + if (jsonObject != null) { + String serialized + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + CRLF + + "Content-Type: application/json" + CRLF + CRLF + BinaryData.fromObject(jsonObject) + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + /** + * Formats a file field for a multipart HTTP request. + * + * @param fieldName the field name + * @param file the BinaryData of the file + * @param contentType the content-type of the file + * @param filename the filename + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileField(String fieldName, BinaryData file, String contentType, + String filename) { + if (file != null) { + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + writeFileField(fieldName, file, contentType, filename); + } + return this; + } + + /** + * Formats a file field (potentially multiple files) for a multipart HTTP request. + * + * @param fieldName the field name + * @param files the List of BinaryData of the files + * @param contentTypes the List of content-type of the files + * @param filenames the List of filenames + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileFields(String fieldName, List files, + List contentTypes, List filenames) { + if (files != null) { + for (int i = 0; i < files.size(); ++i) { + BinaryData file = files.get(i); + String contentType = contentTypes.get(i); + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + String filename = filenames.get(i); + writeFileField(fieldName, file, contentType, filename); + } + } + return this; + } + + /** + * Ends the serialization of the multipart HTTP request. + * + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper end() { + byte[] data = endMarker.getBytes(encoderCharset); + appendBytes(data); + + requestBody = BinaryData.fromStream(requestDataStream, requestLength); + + requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "multipart/form-data; boundary=" + this.boundary) + .setHeader(HttpHeaderName.CONTENT_LENGTH, String.valueOf(requestLength)); + + return this; + } + + private void writeFileField(String fieldName, BinaryData file, String contentType, String filename) { + String contentDispositionFilename = ""; + if (!CoreUtils.isNullOrEmpty(filename)) { + contentDispositionFilename = "; filename=\"" + escapeName(filename) + "\""; + } + + // Multipart preamble + String fileFieldPreamble + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + + contentDispositionFilename + CRLF + "Content-Type: " + contentType + CRLF + CRLF; + byte[] data = fileFieldPreamble.getBytes(encoderCharset); + appendBytes(data); + + // Writing the file into the request as a byte stream + requestLength += file.getLength(); + requestDataStream = new SequenceInputStream(requestDataStream, file.toStream()); + + // CRLF + data = CRLF.getBytes(encoderCharset); + appendBytes(data); + } + + private void appendBytes(byte[] bytes) { + requestLength += bytes.length; + requestDataStream = new SequenceInputStream(requestDataStream, new ByteArrayInputStream(bytes)); + } + + private static String escapeName(String name) { + return name.replace("\n", "%0A").replace("\r", "%0D").replace("\"", "%22"); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/OpenAIJsonHelper.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/OpenAIJsonHelper.java new file mode 100644 index 000000000000..86d15161a12a --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/OpenAIJsonHelper.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.projects.implementation; + +import com.azure.core.util.BinaryData; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import java.io.StringReader; +import java.util.List; +import java.util.stream.Collectors; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.openai.core.ObjectMappers; + +import java.io.IOException; + +/** + * Helper methods for adapting Azure SDK models to openai-java models. + */ +public final class OpenAIJsonHelper { + private static final ObjectMapper MAPPER = ObjectMappers.jsonMapper() + .rebuild() + .configure(MapperFeature.AUTO_DETECT_FIELDS, true) + .configure(MapperFeature.AUTO_DETECT_GETTERS, true) + .configure(MapperFeature.AUTO_DETECT_CREATORS, true) + .configure(MapperFeature.AUTO_DETECT_SETTERS, true) + .build(); + + private OpenAIJsonHelper() { + } + + /** + * Converts an Azure SDK type that implements {@link JsonSerializable} to an openai-java type. + * + * @param azureObject The Azure SDK model to convert. + * @param openAIType The target openai-java type. + * @param The Azure SDK source type. + * @param The openai-java target type. + * @return The openai-java model. + * @throws NullPointerException if {@code azureObject} or {@code openAIType} is null. + * @throws RuntimeException if conversion fails. + */ + public static , T> T toOpenAIType(S azureObject, Class openAIType) { + if (azureObject == null) { + throw new NullPointerException("'azureObject' cannot be null."); + } + if (openAIType == null) { + throw new NullPointerException("'openAIType' cannot be null."); + } + + try { + return MAPPER.readValue(BinaryData.fromObject(azureObject).toString(), openAIType); + } catch (IOException e) { + throw new RuntimeException("Failed to convert Azure SDK type to OpenAI type.", e); + } + } + + /** + * Serializes an openai-java object to {@link BinaryData} whose content is a JSON object. + * The resulting BinaryData can be written to a {@link com.azure.json.JsonWriter} via + * {@code binaryData.writeTo(jsonWriter)} and will produce a JSON object, not a quoted string. + * + * @param openAIObject the openai-java object to serialize. + * @return BinaryData containing the JSON representation, or null if the input is null. + */ + public static BinaryData toBinaryData(Object openAIObject) { + if (openAIObject == null) { + return null; + } + try { + String json = MAPPER.writeValueAsString(openAIObject); + try (JsonReader reader = JsonProviders.createReader(new StringReader(json))) { + reader.nextToken(); + return BinaryData.fromObject(reader.readUntyped()); + } + } catch (IOException e) { + throw new RuntimeException("Failed to convert OpenAI type to BinaryData", e); + } + } + + /** + * Converts a list of OpenAI SDK types to a list of BinaryData objects. + * + * @param The source OpenAI SDK type. + * @param openAIObjects The list of OpenAI SDK objects to convert. + * @return The equivalent list of BinaryData objects, or null if the input is null. + */ + public static List toBinaryDataList(List openAIObjects) { + if (openAIObjects == null) { + return null; + } + return openAIObjects.stream().map(OpenAIJsonHelper::toBinaryData).collect(Collectors.toList()); + } + + /** + * Deserializes {@link BinaryData} to an openai-java type using the openai-java ObjectMapper. + * + * @param data the BinaryData containing JSON. + * @param type the target openai-java class. + * @param the target type. + * @return the deserialized openai-java object, or null if the input is null. + */ + public static T fromBinaryData(BinaryData data, Class type) { + if (data == null) { + return null; + } + try { + return MAPPER.readValue(data.toString(), type); + } catch (IOException e) { + throw new RuntimeException("Failed to deserialize BinaryData to OpenAI type", e); + } + } + + /** + * Deserializes a list of {@link BinaryData} objects to a list of openai-java types. + * + * @param The target openai-java type. + * @param dataList The list of BinaryData objects to convert. + * @param type the target openai-java class. + * @return The equivalent list of openai-java objects, or null if the input is null. + */ + public static List fromBinaryDataList(List dataList, Class type) { + if (dataList == null) { + return null; + } + return dataList.stream().map(data -> fromBinaryData(data, type)).collect(Collectors.toList()); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/RoutinesImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/RoutinesImpl.java new file mode 100644 index 000000000000..90a37ee461e3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/RoutinesImpl.java @@ -0,0 +1,1439 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.projects.implementation; + +import com.azure.ai.projects.AIProjectsServiceVersion; +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in Routines. + */ +public final class RoutinesImpl { + /** + * The proxy service used to perform REST calls. + */ + private final RoutinesService service; + + /** + * The service client containing this operation class. + */ + private final AIProjectClientImpl client; + + /** + * Initializes an instance of RoutinesImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RoutinesImpl(AIProjectClientImpl client) { + this.service = RestProxy.create(RoutinesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public AIProjectsServiceVersion getServiceVersion() { + return client.getServiceVersion(); + } + + /** + * The interface defining all the services for AIProjectClientRoutines to be used by the proxy service to perform + * REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "AIProjectClientRoutines") + public interface RoutinesService { + @Put("/routines/{routine_name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createOrUpdateRoutine(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createOrUpdateRoutineRequest, RequestOptions requestOptions, + Context context); + + @Put("/routines/{routine_name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response createOrUpdateRoutineSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData createOrUpdateRoutineRequest, RequestOptions requestOptions, + Context context); + + @Get("/routines/{routine_name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getRoutine(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/routines/{routine_name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getRoutineSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routines/{routine_name}:enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> enableRoutine(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routines/{routine_name}:enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response enableRoutineSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routines/{routine_name}:disable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> disableRoutine(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routines/{routine_name}:disable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response disableRoutineSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/routines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listRoutines(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/routines") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listRoutinesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Delete("/routines/{routine_name}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> deleteRoutine(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + + @Delete("/routines/{routine_name}") + @ExpectedResponses({ 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response deleteRoutineSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + RequestOptions requestOptions, Context context); + + @Get("/routines/{routine_name}/runs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listRoutineRuns(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/routines/{routine_name}/runs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listRoutineRunsSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/routines/{routine_name}:dispatch_async") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> dispatchRoutine(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData dispatchRoutineAsyncRequest, RequestOptions requestOptions, + Context context); + + @Post("/routines/{routine_name}:dispatch_async") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response dispatchRoutineSync(@HostParam("endpoint") String endpoint, + @PathParam("routine_name") String routineName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData dispatchRoutineAsyncRequest, RequestOptions requestOptions, + Context context); + } + + /** + * Create or update a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     enabled: Boolean (Optional)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param createOrUpdateRoutineRequest The createOrUpdateRoutineRequest parameter. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createOrUpdateRoutineWithResponseAsync(String routineName, + BinaryData createOrUpdateRoutineRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createOrUpdateRoutine(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), contentType, accept, createOrUpdateRoutineRequest, + requestOptions, context)); + } + + /** + * Create or update a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     description: String (Optional)
+     *     enabled: Boolean (Optional)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param createOrUpdateRoutineRequest The createOrUpdateRoutineRequest parameter. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateRoutineWithResponse(String routineName, + BinaryData createOrUpdateRoutineRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createOrUpdateRoutineSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), contentType, accept, createOrUpdateRoutineRequest, + requestOptions, Context.NONE); + } + + /** + * Retrieve a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getRoutineWithResponseAsync(String routineName, RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getRoutine(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Retrieve a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRoutineWithResponse(String routineName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getRoutineSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Enable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> enableRoutineWithResponseAsync(String routineName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.enableRoutine(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Enable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response enableRoutineWithResponse(String routineName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.enableRoutineSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Disable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> disableRoutineWithResponseAsync(String routineName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.disableRoutine(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Disable a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @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 a routine definition returned by the service along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response disableRoutineWithResponse(String routineName, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.disableRoutineSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * List routines. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoThe maximum number of routines to return.
afterStringNoAn opaque cursor returned as last_id by the previous list + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRoutinesSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRoutines(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * List routines. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoThe maximum number of routines to return.
afterStringNoAn opaque cursor returned as last_id by the previous list + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutinesAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listRoutinesSinglePageAsync(requestOptions)); + } + + /** + * List routines. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoThe maximum number of routines to return.
afterStringNoAn opaque cursor returned as last_id by the previous list + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRoutinesSinglePage(RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listRoutinesSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * List routines. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoThe maximum number of routines to return.
afterStringNoAn opaque cursor returned as last_id by the previous list + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     *     description: String (Optional)
+     *     enabled: boolean (Required)
+     *     triggers (Optional): {
+     *         String (Required): {
+     *             type: String(custom/github_issue/schedule/timer) (Required)
+     *         }
+     *     }
+     *     action (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     *     created_at: Long (Optional)
+     *     updated_at: Long (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutines(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listRoutinesSinglePage(requestOptions)); + } + + /** + * Delete a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param routineName The unique name of the routine. + * @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 Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteRoutineWithResponseAsync(String routineName, RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.deleteRoutine(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), requestOptions, context)); + } + + /** + * Delete a routine. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param routineName The unique name of the routine. + * @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 Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteRoutineWithResponse(String routineName, RequestOptions requestOptions) { + return service.deleteRoutineSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), requestOptions, Context.NONE); + } + + /** + * List prior runs for a routine. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoAn optional MLflow search-runs filter expression applied within + * the routine's experiment.
limitIntegerNoThe maximum number of runs to return.
afterStringNoAn opaque cursor returned as last_id by the previous list-runs + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String (Optional)
+     *     phase: String(queued/dispatching/completed/failed) (Optional)
+     *     trigger_type: String(custom/github_issue/schedule/timer) (Optional)
+     *     trigger_name: String (Optional)
+     *     attempt_source: String(event_fire/manual_dispatch/queued_dispatch/schedule_delivery/timer_delivery) (Optional)
+     *     action_type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Optional)
+     *     agent_id: String (Optional)
+     *     agent_endpoint_id: String (Optional)
+     *     conversation_id: String (Optional)
+     *     session_id: String (Optional)
+     *     triggered_at: Long (Optional)
+     *     scheduled_fire_at: Long (Optional)
+     *     started_at: Long (Optional)
+     *     ended_at: Long (Optional)
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     response_id: String (Optional)
+     *     task_id: String (Optional)
+     *     error_status_code: Integer (Optional)
+     *     error_type: String (Optional)
+     *     error_message: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRoutineRunsSinglePageAsync(String routineName, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listRoutineRuns(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * List prior runs for a routine. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoAn optional MLflow search-runs filter expression applied within + * the routine's experiment.
limitIntegerNoThe maximum number of runs to return.
afterStringNoAn opaque cursor returned as last_id by the previous list-runs + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String (Optional)
+     *     phase: String(queued/dispatching/completed/failed) (Optional)
+     *     trigger_type: String(custom/github_issue/schedule/timer) (Optional)
+     *     trigger_name: String (Optional)
+     *     attempt_source: String(event_fire/manual_dispatch/queued_dispatch/schedule_delivery/timer_delivery) (Optional)
+     *     action_type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Optional)
+     *     agent_id: String (Optional)
+     *     agent_endpoint_id: String (Optional)
+     *     conversation_id: String (Optional)
+     *     session_id: String (Optional)
+     *     triggered_at: Long (Optional)
+     *     scheduled_fire_at: Long (Optional)
+     *     started_at: Long (Optional)
+     *     ended_at: Long (Optional)
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     response_id: String (Optional)
+     *     task_id: String (Optional)
+     *     error_status_code: Integer (Optional)
+     *     error_type: String (Optional)
+     *     error_message: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listRoutineRunsAsync(String routineName, RequestOptions requestOptions) { + return new PagedFlux<>(() -> listRoutineRunsSinglePageAsync(routineName, requestOptions)); + } + + /** + * List prior runs for a routine. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoAn optional MLflow search-runs filter expression applied within + * the routine's experiment.
limitIntegerNoThe maximum number of runs to return.
afterStringNoAn opaque cursor returned as last_id by the previous list-runs + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String (Optional)
+     *     phase: String(queued/dispatching/completed/failed) (Optional)
+     *     trigger_type: String(custom/github_issue/schedule/timer) (Optional)
+     *     trigger_name: String (Optional)
+     *     attempt_source: String(event_fire/manual_dispatch/queued_dispatch/schedule_delivery/timer_delivery) (Optional)
+     *     action_type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Optional)
+     *     agent_id: String (Optional)
+     *     agent_endpoint_id: String (Optional)
+     *     conversation_id: String (Optional)
+     *     session_id: String (Optional)
+     *     triggered_at: Long (Optional)
+     *     scheduled_fire_at: Long (Optional)
+     *     started_at: Long (Optional)
+     *     ended_at: Long (Optional)
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     response_id: String (Optional)
+     *     task_id: String (Optional)
+     *     error_status_code: Integer (Optional)
+     *     error_type: String (Optional)
+     *     error_message: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listRoutineRunsSinglePage(String routineName, RequestOptions requestOptions) { + final String accept = "application/json"; + Response res = service.listRoutineRunsSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); + } + + /** + * List prior runs for a routine. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
filterStringNoAn optional MLflow search-runs filter expression applied within + * the routine's experiment.
limitIntegerNoThe maximum number of runs to return.
afterStringNoAn opaque cursor returned as last_id by the previous list-runs + * response.
beforeStringNoUnsupported. Reserved for future backward pagination + * support.
orderStringNoThe ordering direction. Supported values are asc and + * desc.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String (Optional)
+     *     phase: String(queued/dispatching/completed/failed) (Optional)
+     *     trigger_type: String(custom/github_issue/schedule/timer) (Optional)
+     *     trigger_name: String (Optional)
+     *     attempt_source: String(event_fire/manual_dispatch/queued_dispatch/schedule_delivery/timer_delivery) (Optional)
+     *     action_type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Optional)
+     *     agent_id: String (Optional)
+     *     agent_endpoint_id: String (Optional)
+     *     conversation_id: String (Optional)
+     *     session_id: String (Optional)
+     *     triggered_at: Long (Optional)
+     *     scheduled_fire_at: Long (Optional)
+     *     started_at: Long (Optional)
+     *     ended_at: Long (Optional)
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     response_id: String (Optional)
+     *     task_id: String (Optional)
+     *     error_status_code: Integer (Optional)
+     *     error_type: String (Optional)
+     *     error_message: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRoutineRuns(String routineName, RequestOptions requestOptions) { + return new PagedIterable<>(() -> listRoutineRunsSinglePage(routineName, requestOptions)); + } + + /** + * Queue an asynchronous routine dispatch. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     payload (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     task_id: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param dispatchRoutineAsyncRequest The dispatchRoutineAsyncRequest parameter. + * @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 identifiers returned after a routine dispatch is queued along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> dispatchRoutineWithResponseAsync(String routineName, + BinaryData dispatchRoutineAsyncRequest, RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.dispatchRoutine(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), contentType, accept, dispatchRoutineAsyncRequest, + requestOptions, context)); + } + + /** + * Queue an asynchronous routine dispatch. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Foundry-FeaturesStringNoA feature flag opt-in required when using preview + * operations or modifying persisted preview resources. Allowed values: "Evaluations=V1Preview", + * "Schedules=V1Preview", "RedTeams=V1Preview", "Insights=V1Preview", "MemoryStores=V1Preview", + * "Routines=V1Preview", "Toolboxes=V1Preview", "Skills=V1Preview", "DataGenerationJobs=V1Preview", + * "Models=V1Preview", "AgentsOptimization=V1Preview".
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     payload (Optional): {
+     *         type: String(invoke_agent_responses_api/invoke_agent_invocations_api) (Required)
+     *     }
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     dispatch_id: String (Optional)
+     *     action_correlation_id: String (Optional)
+     *     task_id: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param routineName The unique name of the routine. + * @param dispatchRoutineAsyncRequest The dispatchRoutineAsyncRequest parameter. + * @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 identifiers returned after a routine dispatch is queued along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response dispatchRoutineWithResponse(String routineName, BinaryData dispatchRoutineAsyncRequest, + RequestOptions requestOptions) { + final String contentType = "application/json"; + final String accept = "application/json"; + return service.dispatchRoutineSync(this.client.getEndpoint(), routineName, + this.client.getServiceVersion().getVersion(), contentType, accept, dispatchRoutineAsyncRequest, + requestOptions, Context.NONE); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/SkillsImpl.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/SkillsImpl.java index 14f690b127b9..9cad493cd985 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/SkillsImpl.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/SkillsImpl.java @@ -78,176 +78,534 @@ public AIProjectsServiceVersion getServiceVersion() { @Host("{endpoint}") @ServiceInterface(name = "AIProjectClientSkills") public interface SkillsService { - @Post("/skills") - @ExpectedResponses({ 201 }) + @Get("/skills/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSkill(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/skills/{name}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSkillSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/skills") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listSkills(@HostParam("endpoint") String endpoint, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Get("/skills") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response listSkillsSync(@HostParam("endpoint") String endpoint, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/skills/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSkill(@HostParam("endpoint") String endpoint, + Mono> updateSkill(@HostParam("endpoint") String endpoint, @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData createSkillRequest, RequestOptions requestOptions, + @BodyParam("application/json") BinaryData updateSkillRequest, RequestOptions requestOptions, Context context); - @Post("/skills") - @ExpectedResponses({ 201 }) + @Post("/skills/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSkillSync(@HostParam("endpoint") String endpoint, + Response updateSkillSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, - @BodyParam("application/json") BinaryData createSkillRequest, RequestOptions requestOptions, + @BodyParam("application/json") BinaryData updateSkillRequest, RequestOptions requestOptions, Context context); - @Post("/skills:import") - @ExpectedResponses({ 201 }) + @Delete("/skills/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSkillFromPackage(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Foundry-Features") String foundryFeatures, + Mono> internalDeleteSkill(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - @BodyParam("application/zip") BinaryData body, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); - @Post("/skills:import") - @ExpectedResponses({ 201 }) + @Delete("/skills/{name}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSkillFromPackageSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Content-Type") String contentType, @HeaderParam("Foundry-Features") String foundryFeatures, + Response internalDeleteSkillSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - @BodyParam("application/zip") BinaryData body, RequestOptions requestOptions, Context context); + RequestOptions requestOptions, Context context); - @Get("/skills/{skill_name}") + @Post("/skills/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSkill(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + Mono> createSkillVersion(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createSkillVersionRequest, RequestOptions requestOptions, Context context); - @Get("/skills/{skill_name}") + @Post("/skills/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSkillSync(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + Response createSkillVersionSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData createSkillVersionRequest, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/skills/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> createSkillVersionFromFiles(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("content-type") String contentType, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, RequestOptions requestOptions, Context context); - @Get("/skills/{skill_name}:download") + // @Multipart not supported by RestProxy + @Post("/skills/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> downloadSkill(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, + Response createSkillVersionFromFilesSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("content-type") String contentType, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData content, + RequestOptions requestOptions, Context context); + + @Get("/skills/{name}/versions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> listSkillVersions(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/skills/{skill_name}:download") + @Get("/skills/{name}/versions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response downloadSkillSync(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, + Response listSkillVersionsSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/skills") + @Get("/skills/{name}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> listSkills(@HostParam("endpoint") String endpoint, + Mono> getSkillVersion(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/skills") + @Get("/skills/{name}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response listSkillsSync(@HostParam("endpoint") String endpoint, + Response getSkillVersionSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, + @PathParam("version") String version, @HeaderParam("Foundry-Features") String foundryFeatures, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/skills/{name}/content") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> getSkillContent(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); + + @Get("/skills/{name}/content") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response getSkillContentSync(@HostParam("endpoint") String endpoint, @PathParam("name") String name, @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Post("/skills/{skill_name}") + @Get("/skills/{name}/versions/{version}/content") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateSkill(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateSkillRequest, - RequestOptions requestOptions, Context context); + Mono> getSkillVersionContent(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Post("/skills/{skill_name}") + @Get("/skills/{name}/versions/{version}/content") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateSkillSync(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, - @HeaderParam("Accept") String accept, @BodyParam("application/json") BinaryData updateSkillRequest, - RequestOptions requestOptions, Context context); + Response getSkillVersionContentSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Delete("/skills/{skill_name}") + @Delete("/skills/{name}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteSkill(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Mono> internalDeleteSkillVersion(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Delete("/skills/{skill_name}") + @Delete("/skills/{name}/versions/{version}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteSkillSync(@HostParam("endpoint") String endpoint, - @PathParam("skill_name") String skillName, @HeaderParam("Foundry-Features") String foundryFeatures, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, - RequestOptions requestOptions, Context context); + Response internalDeleteSkillVersionSync(@HostParam("endpoint") String endpoint, + @PathParam("name") String name, @PathParam("version") String version, + @HeaderParam("Foundry-Features") String foundryFeatures, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + } + + /** + * Retrieves a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The unique name of the skill. + * @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 a skill resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSkillWithResponseAsync(String name, RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getSkill(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Retrieves a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param name The unique name of the skill. + * @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 a skill resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSkillWithResponse(String name, RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/json"; + return service.getSkillSync(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Returns the list of all skills. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSkillsSinglePageAsync(RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSkills(this.client.getEndpoint(), foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null)); + } + + /** + * Returns the list of all skills. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSkillsAsync(RequestOptions requestOptions) { + return new PagedFlux<>(() -> listSkillsSinglePageAsync(requestOptions)); + } + + /** + * Returns the list of all skills. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     name: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSkillsSinglePage(RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/json"; + Response res = service.listSkillsSync(this.client.getEndpoint(), foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "data"), null, null); } /** - * Creates a skill. - *

Request Body Schema

+ * Returns the list of all skills. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
limitIntegerNoA limit on the number of objects to be returned. Limit can range + * between 1 and 100, and the + * default is 20.
orderStringNoSort order by the `created_at` timestamp of the objects. `asc` + * for ascending order and`desc` + * for descending order. Allowed values: "asc", "desc".
afterStringNoA cursor for use in pagination. `after` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list.
beforeStringNoA cursor for use in pagination. `before` is an object ID that + * defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSkills(RequestOptions requestOptions) { + return new PagedIterable<>(() -> listSkillsSinglePage(requestOptions)); + } + + /** + * Update a skill. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     default_version: String (Required)
      * }
      * }
      * 
@@ -257,49 +615,44 @@ Response deleteSkillSync(@HostParam("endpoint") String endpoint, *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
* - * @param createSkillRequest The createSkillRequest parameter. + * @param name The name of the skill to update. + * @param updateSkillRequest The updateSkillRequest parameter. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return a skill resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSkillWithResponseAsync(BinaryData createSkillRequest, + public Mono> updateSkillWithResponseAsync(String name, BinaryData updateSkillRequest, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createSkill(this.client.getEndpoint(), foundryFeatures, - this.client.getServiceVersion().getVersion(), contentType, accept, createSkillRequest, requestOptions, + return FluxUtil.withContext(context -> service.updateSkill(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), contentType, accept, updateSkillRequest, requestOptions, context)); } /** - * Creates a skill. + * Update a skill. *

Request Body Schema

* *
      * {@code
      * {
-     *     name: String (Required)
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     default_version: String (Required)
      * }
      * }
      * 
@@ -309,248 +662,289 @@ public Mono> createSkillWithResponseAsync(BinaryData create *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     description: String (Required)
+     *     created_at: long (Required)
+     *     default_version: String (Required)
+     *     latest_version: String (Required)
      * }
      * }
      * 
* - * @param createSkillRequest The createSkillRequest parameter. + * @param name The name of the skill to update. + * @param updateSkillRequest The updateSkillRequest parameter. * @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 a skill object along with {@link Response}. + * @return a skill resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSkillWithResponse(BinaryData createSkillRequest, RequestOptions requestOptions) { + public Response updateSkillWithResponse(String name, BinaryData updateSkillRequest, + RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String contentType = "application/json"; final String accept = "application/json"; - return service.createSkillSync(this.client.getEndpoint(), foundryFeatures, - this.client.getServiceVersion().getVersion(), contentType, accept, createSkillRequest, requestOptions, + return service.updateSkillSync(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), contentType, accept, updateSkillRequest, requestOptions, Context.NONE); } /** - * Creates a skill from a zip package. - *

Request Body Schema

- * - *
-     * {@code
-     * BinaryData
-     * }
-     * 
- * + * Deletes a skill. *

Response Body Schema

* *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     deleted: boolean (Required)
      * }
      * }
      * 
* - * @param body The zip package used to create the skill. + * @param name The unique name of the skill. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return a deleted skill along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSkillFromPackageWithResponseAsync(BinaryData body, - RequestOptions requestOptions) { - final String contentType = "application/zip"; + public Mono> internalDeleteSkillWithResponseAsync(String name, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.createSkillFromPackage(this.client.getEndpoint(), contentType, - foundryFeatures, this.client.getServiceVersion().getVersion(), accept, body, requestOptions, context)); + return FluxUtil.withContext(context -> service.internalDeleteSkill(this.client.getEndpoint(), name, + foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Creates a skill from a zip package. - *

Request Body Schema

- * - *
-     * {@code
-     * BinaryData
-     * }
-     * 
- * + * Deletes a skill. *

Response Body Schema

* *
      * {@code
      * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
+     *     id: String (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     deleted: boolean (Required)
      * }
      * }
      * 
* - * @param body The zip package used to create the skill. + * @param name The unique name of the skill. * @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 a skill object along with {@link Response}. + * @return a deleted skill along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSkillFromPackageWithResponse(BinaryData body, RequestOptions requestOptions) { - final String contentType = "application/zip"; + public Response internalDeleteSkillWithResponse(String name, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String accept = "application/json"; - return service.createSkillFromPackageSync(this.client.getEndpoint(), contentType, foundryFeatures, - this.client.getServiceVersion().getVersion(), accept, body, requestOptions, Context.NONE); + return service.internalDeleteSkillSync(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Retrieves a skill. + * Creates a new version of a skill. If the skill does not exist, it will be created. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     inline_content (Optional): {
+     *         description: String (Required)
+     *         instructions: String (Required)
+     *         license: String (Optional)
+     *         compatibility: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         allowed_tools (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     default: Boolean (Optional)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. + * @param createSkillVersionRequest The createSkillVersionRequest parameter. * @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 a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return a specific version of a skill along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSkillWithResponseAsync(String skillName, RequestOptions requestOptions) { + public Mono> createSkillVersionWithResponseAsync(String name, + BinaryData createSkillVersionRequest, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; + final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.getSkill(this.client.getEndpoint(), skillName, foundryFeatures, - this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.createSkillVersion(this.client.getEndpoint(), name, + foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, + createSkillVersionRequest, requestOptions, context)); } /** - * Retrieves a skill. + * Creates a new version of a skill. If the skill does not exist, it will be created. + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     inline_content (Optional): {
+     *         description: String (Required)
+     *         instructions: String (Required)
+     *         license: String (Optional)
+     *         compatibility: String (Optional)
+     *         metadata (Optional): {
+     *             String: String (Required)
+     *         }
+     *         allowed_tools (Optional): [
+     *             String (Optional)
+     *         ]
+     *     }
+     *     default: Boolean (Optional)
+     * }
+     * }
+     * 
+ * *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. If the skill does not exist, it will be created. + * @param createSkillVersionRequest The createSkillVersionRequest parameter. * @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 a skill object along with {@link Response}. + * @return a specific version of a skill along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSkillWithResponse(String skillName, RequestOptions requestOptions) { + public Response createSkillVersionWithResponse(String name, BinaryData createSkillVersionRequest, + RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; + final String contentType = "application/json"; final String accept = "application/json"; - return service.getSkillSync(this.client.getEndpoint(), skillName, foundryFeatures, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return service.createSkillVersionSync(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), contentType, accept, createSkillVersionRequest, + requestOptions, Context.NONE); } /** - * Downloads a skill package as a ZIP archive containing {@code SKILL.md}. Returns the original uploaded archive for - * skills created via {@code createSkillFromPackage}; materializes a ZIP from stored instructions for skills created - * via {@code createSkill}. + * Creates a new version of a skill from uploaded files via multipart form data. *

Response Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. + * @return a specific version of a skill along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> downloadSkillWithResponseAsync(String skillName, RequestOptions requestOptions) { + public Mono> createSkillVersionFromFilesWithResponseAsync(String name, BinaryData content, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String foundryFeatures = "Skills=V1Preview"; - final String accept = "application/zip"; - return FluxUtil.withContext(context -> service.downloadSkill(this.client.getEndpoint(), skillName, - foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.createSkillVersionFromFiles(this.client.getEndpoint(), name, + contentType, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, content, requestOptions, + context)); } /** - * Downloads a skill package as a ZIP archive containing {@code SKILL.md}. Returns the original uploaded archive for - * skills created via {@code createSkillFromPackage}; materializes a ZIP from stored instructions for skills created - * via {@code createSkill}. + * Creates a new version of a skill from uploaded files via multipart form data. *

Response Body Schema

* *
      * {@code
-     * BinaryData
+     * {
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
+     * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param content The content parameter. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return the response body along with {@link Response}. + * @return a specific version of a skill along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response downloadSkillWithResponse(String skillName, RequestOptions requestOptions) { + public Response createSkillVersionFromFilesWithResponse(String name, BinaryData content, + RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; final String foundryFeatures = "Skills=V1Preview"; - final String accept = "application/zip"; - return service.downloadSkillSync(this.client.getEndpoint(), skillName, foundryFeatures, - this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + final String accept = "application/json"; + return service.createSkillVersionFromFilesSync(this.client.getEndpoint(), name, contentType, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, content, requestOptions, Context.NONE); } /** - * Returns the list of all skills. + * List all versions of a skill. *

Query Parameters

* * @@ -576,17 +970,17 @@ public Response downloadSkillWithResponse(String skillName, RequestO *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill to list versions for. * @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. @@ -596,18 +990,19 @@ public Response downloadSkillWithResponse(String skillName, RequestO * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSkillsSinglePageAsync(RequestOptions requestOptions) { + private Mono> listSkillVersionsSinglePageAsync(String name, + RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSkills(this.client.getEndpoint(), foundryFeatures, + .withContext(context -> service.listSkillVersions(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "data"), null, null)); } /** - * Returns the list of all skills. + * List all versions of a skill. *

Query Parameters

*
Query Parameters
* @@ -633,17 +1028,17 @@ private Mono> listSkillsSinglePageAsync(RequestOptions *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill to list versions for. * @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. @@ -652,12 +1047,12 @@ private Mono> listSkillsSinglePageAsync(RequestOptions * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSkillsAsync(RequestOptions requestOptions) { - return new PagedFlux<>(() -> listSkillsSinglePageAsync(requestOptions)); + public PagedFlux listSkillVersionsAsync(String name, RequestOptions requestOptions) { + return new PagedFlux<>(() -> listSkillVersionsSinglePageAsync(name, requestOptions)); } /** - * Returns the list of all skills. + * List all versions of a skill. *

Query Parameters

*
Query Parameters
* @@ -683,17 +1078,17 @@ public PagedFlux listSkillsAsync(RequestOptions requestOptions) { *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill to list versions for. * @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. @@ -702,17 +1097,17 @@ public PagedFlux listSkillsAsync(RequestOptions requestOptions) { * @return the response data for a requested list of items along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSkillsSinglePage(RequestOptions requestOptions) { + private PagedResponse listSkillVersionsSinglePage(String name, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String accept = "application/json"; - Response res = service.listSkillsSync(this.client.getEndpoint(), foundryFeatures, + Response res = service.listSkillVersionsSync(this.client.getEndpoint(), name, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), getValues(res.getValue(), "data"), null, null); } /** - * Returns the list of all skills. + * List all versions of a skill. *

Query Parameters

*
Query Parameters
* @@ -738,17 +1133,17 @@ private PagedResponse listSkillsSinglePage(RequestOptions requestOpt *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill to list versions for. * @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. @@ -757,169 +1152,251 @@ private PagedResponse listSkillsSinglePage(RequestOptions requestOpt * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSkills(RequestOptions requestOptions) { - return new PagedIterable<>(() -> listSkillsSinglePage(requestOptions)); + public PagedIterable listSkillVersions(String name, RequestOptions requestOptions) { + return new PagedIterable<>(() -> listSkillVersionsSinglePage(name, requestOptions)); } /** - * Updates an existing skill. - *

Request Body Schema

+ * Retrieve a specific version of a skill. + *

Response Body Schema

* *
      * {@code
      * {
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     id: String (Required)
+     *     skill_id: String (Required)
+     *     name: String (Required)
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* + * @param name The name of the skill. + * @param version The version identifier to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a specific version of a skill along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSkillVersionWithResponseAsync(String name, String version, + RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getSkillVersion(this.client.getEndpoint(), name, version, + foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Retrieve a specific version of a skill. *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
      *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     *     version: String (Required)
+     *     description: String (Required)
+     *     created_at: long (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. - * @param updateSkillRequest The updateSkillRequest parameter. + * @param name The name of the skill. + * @param version The version identifier to retrieve. * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @return a skill object along with {@link Response} on successful completion of {@link Mono}. + * @return a specific version of a skill along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSkillWithResponseAsync(String skillName, BinaryData updateSkillRequest, + public Response getSkillVersionWithResponse(String name, String version, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; - final String contentType = "application/json"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.updateSkill(this.client.getEndpoint(), skillName, - foundryFeatures, this.client.getServiceVersion().getVersion(), contentType, accept, updateSkillRequest, - requestOptions, context)); + return service.getSkillVersionSync(this.client.getEndpoint(), name, version, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Updates an existing skill. - *

Request Body Schema

+ * Download the zip content for the default version of a skill. + *

Response Body Schema

* *
      * {@code
-     * {
-     *     description: String (Optional)
-     *     instructions: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     * BinaryData
      * }
+     * 
+ * + * @param name The name of the skill. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSkillContentWithResponseAsync(String name, RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/zip"; + return FluxUtil.withContext(context -> service.getSkillContent(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Download the zip content for the default version of a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
      * }
      * 
* + * @param name The name of the skill. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getSkillContentWithResponse(String name, RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/zip"; + return service.getSkillContentSync(this.client.getEndpoint(), name, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + } + + /** + * Download the zip content for a specific version of a skill. *

Response Body Schema

* *
      * {@code
-     * {
-     *     skill_id: String (Required)
-     *     has_blob: boolean (Required)
-     *     name: String (Required)
-     *     description: String (Optional)
-     *     metadata (Optional): {
-     *         String: String (Required)
-     *     }
+     * BinaryData
      * }
+     * 
+ * + * @param name The name of the skill. + * @param version The version to download content for. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getSkillVersionContentWithResponseAsync(String name, String version, + RequestOptions requestOptions) { + final String foundryFeatures = "Skills=V1Preview"; + final String accept = "application/zip"; + return FluxUtil.withContext(context -> service.getSkillVersionContent(this.client.getEndpoint(), name, version, + foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + } + + /** + * Download the zip content for a specific version of a skill. + *

Response Body Schema

+ * + *
+     * {@code
+     * BinaryData
      * }
      * 
* - * @param skillName The unique name of the skill. - * @param updateSkillRequest The updateSkillRequest parameter. + * @param name The name of the skill. + * @param version The version to download content for. * @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 a skill object along with {@link Response}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSkillWithResponse(String skillName, BinaryData updateSkillRequest, + public Response getSkillVersionContentWithResponse(String name, String version, RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; - final String contentType = "application/json"; - final String accept = "application/json"; - return service.updateSkillSync(this.client.getEndpoint(), skillName, foundryFeatures, - this.client.getServiceVersion().getVersion(), contentType, accept, updateSkillRequest, requestOptions, - Context.NONE); + final String accept = "application/zip"; + return service.getSkillVersionContentSync(this.client.getEndpoint(), name, version, foundryFeatures, + this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } /** - * Deletes a skill. + * Delete a specific version of a skill. *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     name: String (Required)
      *     deleted: boolean (Required)
+     *     version: String (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param version The version identifier to delete. * @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 a deleted skill Object along with {@link Response} on successful completion of {@link Mono}. + * @return a deleted skill version along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteSkillWithResponseAsync(String skillName, RequestOptions requestOptions) { + public Mono> internalDeleteSkillVersionWithResponseAsync(String name, String version, + RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.deleteSkill(this.client.getEndpoint(), skillName, - foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); + return FluxUtil.withContext(context -> service.internalDeleteSkillVersion(this.client.getEndpoint(), name, + version, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, context)); } /** - * Deletes a skill. + * Delete a specific version of a skill. *

Response Body Schema

* *
      * {@code
      * {
+     *     id: String (Required)
      *     name: String (Required)
      *     deleted: boolean (Required)
+     *     version: String (Required)
      * }
      * }
      * 
* - * @param skillName The unique name of the skill. + * @param name The name of the skill. + * @param version The version identifier to delete. * @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 a deleted skill Object along with {@link Response}. + * @return a deleted skill version along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteSkillWithResponse(String skillName, RequestOptions requestOptions) { + public Response internalDeleteSkillVersionWithResponse(String name, String version, + RequestOptions requestOptions) { final String foundryFeatures = "Skills=V1Preview"; final String accept = "application/json"; - return service.deleteSkillSync(this.client.getEndpoint(), skillName, foundryFeatures, + return service.internalDeleteSkillVersionSync(this.client.getEndpoint(), name, version, foundryFeatures, this.client.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateOrUpdateRoutineRequest.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateOrUpdateRoutineRequest.java new file mode 100644 index 000000000000..12463e3a9be3 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateOrUpdateRoutineRequest.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.implementation.models; + +import com.azure.ai.projects.models.RoutineAction; +import com.azure.ai.projects.models.RoutineTrigger; +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; +import java.util.Map; + +/** + * The CreateOrUpdateRoutineRequest model. + */ +@Fluent +public final class CreateOrUpdateRoutineRequest implements JsonSerializable { + + /* + * A human-readable description of the routine. + */ + @Generated + private String description; + + /* + * Whether the routine is enabled. + */ + @Generated + private Boolean enabled; + + /* + * The triggers configured for the routine. In v1, exactly one trigger entry is supported. + */ + @Generated + private Map triggers; + + /* + * The action executed when the routine fires. + */ + @Generated + private RoutineAction action; + + /** + * Get the description property: A human-readable description of the routine. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: A human-readable description of the routine. + * + * @param description the description value to set. + * @return the CreateOrUpdateRoutineRequest object itself. + */ + @Generated + public CreateOrUpdateRoutineRequest setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the enabled property: Whether the routine is enabled. + * + * @return the enabled value. + */ + @Generated + public Boolean isEnabled() { + return this.enabled; + } + + /** + * Set the enabled property: Whether the routine is enabled. + * + * @param enabled the enabled value to set. + * @return the CreateOrUpdateRoutineRequest object itself. + */ + @Generated + public CreateOrUpdateRoutineRequest setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the triggers property: The triggers configured for the routine. In v1, exactly one trigger entry is + * supported. + * + * @return the triggers value. + */ + @Generated + public Map getTriggers() { + return this.triggers; + } + + /** + * Get the action property: The action executed when the routine fires. + * + * @return the action value. + */ + @Generated + public RoutineAction getAction() { + return this.action; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeMapField("triggers", this.triggers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("action", this.action); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateOrUpdateRoutineRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateOrUpdateRoutineRequest 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 CreateOrUpdateRoutineRequest. + */ + @Generated + public static CreateOrUpdateRoutineRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateOrUpdateRoutineRequest deserializedCreateOrUpdateRoutineRequest = new CreateOrUpdateRoutineRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("description".equals(fieldName)) { + deserializedCreateOrUpdateRoutineRequest.description = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedCreateOrUpdateRoutineRequest.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("triggers".equals(fieldName)) { + Map triggers = reader.readMap(reader1 -> RoutineTrigger.fromJson(reader1)); + deserializedCreateOrUpdateRoutineRequest.triggers = triggers; + } else if ("action".equals(fieldName)) { + deserializedCreateOrUpdateRoutineRequest.action = RoutineAction.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedCreateOrUpdateRoutineRequest; + }); + } + + /** + * Creates an instance of CreateOrUpdateRoutineRequest class. + */ + @Generated + public CreateOrUpdateRoutineRequest() { + } + + /** + * Set the triggers property: The triggers configured for the routine. In v1, exactly one trigger entry is + * supported. + * + * @param triggers the triggers value to set. + * @return the CreateOrUpdateRoutineRequest object itself. + */ + @Generated + public CreateOrUpdateRoutineRequest setTriggers(Map triggers) { + this.triggers = triggers; + return this; + } + + /** + * Set the action property: The action executed when the routine fires. + * + * @param action the action value to set. + * @return the CreateOrUpdateRoutineRequest object itself. + */ + @Generated + public CreateOrUpdateRoutineRequest setAction(RoutineAction action) { + this.action = action; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateSkillVersionRequest.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateSkillVersionRequest.java new file mode 100644 index 000000000000..d2c64081bbaf --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/CreateSkillVersionRequest.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.implementation.models; + +import com.azure.ai.projects.models.SkillInlineContent; +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; + +/** + * The CreateSkillVersionRequest model. + */ +@Fluent +public final class CreateSkillVersionRequest implements JsonSerializable { + + /* + * Inline skill content for simple skills without file uploads. Foundry-specific extension. + */ + @Generated + private SkillInlineContent inlineContent; + + /* + * Whether to set this version as the default. + */ + @Generated + private Boolean defaultProperty; + + /** + * Creates an instance of CreateSkillVersionRequest class. + */ + @Generated + public CreateSkillVersionRequest() { + } + + /** + * Get the inlineContent property: Inline skill content for simple skills without file uploads. Foundry-specific + * extension. + * + * @return the inlineContent value. + */ + @Generated + public SkillInlineContent getInlineContent() { + return this.inlineContent; + } + + /** + * Set the inlineContent property: Inline skill content for simple skills without file uploads. Foundry-specific + * extension. + * + * @param inlineContent the inlineContent value to set. + * @return the CreateSkillVersionRequest object itself. + */ + @Generated + public CreateSkillVersionRequest setInlineContent(SkillInlineContent inlineContent) { + this.inlineContent = inlineContent; + return this; + } + + /** + * Get the defaultProperty property: Whether to set this version as the default. + * + * @return the defaultProperty value. + */ + @Generated + public Boolean isDefaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Whether to set this version as the default. + * + * @param defaultProperty the defaultProperty value to set. + * @return the CreateSkillVersionRequest object itself. + */ + @Generated + public CreateSkillVersionRequest setDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("inline_content", this.inlineContent); + jsonWriter.writeBooleanField("default", this.defaultProperty); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateSkillVersionRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateSkillVersionRequest 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 CreateSkillVersionRequest. + */ + @Generated + public static CreateSkillVersionRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateSkillVersionRequest deserializedCreateSkillVersionRequest = new CreateSkillVersionRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("inline_content".equals(fieldName)) { + deserializedCreateSkillVersionRequest.inlineContent = SkillInlineContent.fromJson(reader); + } else if ("default".equals(fieldName)) { + deserializedCreateSkillVersionRequest.defaultProperty = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedCreateSkillVersionRequest; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/DispatchRoutineAsyncRequest.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/DispatchRoutineAsyncRequest.java new file mode 100644 index 000000000000..613d2e1ef670 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/DispatchRoutineAsyncRequest.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.implementation.models; + +import com.azure.ai.projects.models.RoutineDispatchPayload; +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; + +/** + * The DispatchRoutineAsyncRequest model. + */ +@Fluent +public final class DispatchRoutineAsyncRequest implements JsonSerializable { + + /* + * A direct action-input override sent downstream when testing a routine. + */ + @Generated + private RoutineDispatchPayload payload; + + /** + * Creates an instance of DispatchRoutineAsyncRequest class. + */ + @Generated + public DispatchRoutineAsyncRequest() { + } + + /** + * Get the payload property: A direct action-input override sent downstream when testing a routine. + * + * @return the payload value. + */ + @Generated + public RoutineDispatchPayload getPayload() { + return this.payload; + } + + /** + * Set the payload property: A direct action-input override sent downstream when testing a routine. + * + * @param payload the payload value to set. + * @return the DispatchRoutineAsyncRequest object itself. + */ + @Generated + public DispatchRoutineAsyncRequest setPayload(RoutineDispatchPayload payload) { + this.payload = payload; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("payload", this.payload); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DispatchRoutineAsyncRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DispatchRoutineAsyncRequest 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 DispatchRoutineAsyncRequest. + */ + @Generated + public static DispatchRoutineAsyncRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DispatchRoutineAsyncRequest deserializedDispatchRoutineAsyncRequest = new DispatchRoutineAsyncRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("payload".equals(fieldName)) { + deserializedDispatchRoutineAsyncRequest.payload = RoutineDispatchPayload.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedDispatchRoutineAsyncRequest; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/UpdateSkillRequest.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/UpdateSkillRequest.java index 851a212a14b3..82c8c2673157 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/UpdateSkillRequest.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/implementation/models/UpdateSkillRequest.java @@ -3,127 +3,20 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.projects.implementation.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.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.Map; /** * The UpdateSkillRequest model. */ -@Fluent +@Immutable public final class UpdateSkillRequest implements JsonSerializable { - /* - * A human-readable description of the skill. - */ - @Generated - private String description; - - /* - * Instructions that define the behavior of the skill. - */ - @Generated - private String instructions; - - /* - * Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. - * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - */ - @Generated - private Map metadata; - - /** - * Creates an instance of UpdateSkillRequest class. - */ - @Generated - public UpdateSkillRequest() { - } - - /** - * Get the description property: A human-readable description of the skill. - * - * @return the description value. - */ - @Generated - public String getDescription() { - return this.description; - } - - /** - * Set the description property: A human-readable description of the skill. - * - * @param description the description value to set. - * @return the UpdateSkillRequest object itself. - */ - @Generated - public UpdateSkillRequest setDescription(String description) { - this.description = description; - return this; - } - - /** - * Get the instructions property: Instructions that define the behavior of the skill. - * - * @return the instructions value. - */ - @Generated - public String getInstructions() { - return this.instructions; - } - - /** - * Set the instructions property: Instructions that define the behavior of the skill. - * - * @param instructions the instructions value to set. - * @return the UpdateSkillRequest object itself. - */ - @Generated - public UpdateSkillRequest setInstructions(String instructions) { - this.instructions = instructions; - return this; - } - - /** - * Get the metadata property: Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. - * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - * - * @return the metadata value. - */ - @Generated - public Map getMetadata() { - return this.metadata; - } - - /** - * Set the metadata property: Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. - * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - * - * @param metadata the metadata value to set. - * @return the UpdateSkillRequest object itself. - */ - @Generated - public UpdateSkillRequest setMetadata(Map metadata) { - this.metadata = metadata; - return this; - } - /** * {@inheritDoc} */ @@ -131,9 +24,7 @@ public UpdateSkillRequest setMetadata(Map metadata) { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeStringField("instructions", this.instructions); - jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("default_version", this.defaultVersion); return jsonWriter.writeEndObject(); } @@ -143,27 +34,51 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of UpdateSkillRequest if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the UpdateSkillRequest. */ @Generated public static UpdateSkillRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - UpdateSkillRequest deserializedUpdateSkillRequest = new UpdateSkillRequest(); + String defaultVersion = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("description".equals(fieldName)) { - deserializedUpdateSkillRequest.description = reader.getString(); - } else if ("instructions".equals(fieldName)) { - deserializedUpdateSkillRequest.instructions = reader.getString(); - } else if ("metadata".equals(fieldName)) { - Map metadata = reader.readMap(reader1 -> reader1.getString()); - deserializedUpdateSkillRequest.metadata = metadata; + if ("default_version".equals(fieldName)) { + defaultVersion = reader.getString(); } else { reader.skipChildren(); } } - return deserializedUpdateSkillRequest; + return new UpdateSkillRequest(defaultVersion); }); } + + /* + * The version identifier that the skill should point to. When set, the skill's default version will resolve to this + * version instead of the latest. + */ + @Generated + private final String defaultVersion; + + /** + * Creates an instance of UpdateSkillRequest class. + * + * @param defaultVersion the defaultVersion value to set. + */ + @Generated + public UpdateSkillRequest(String defaultVersion) { + this.defaultVersion = defaultVersion; + } + + /** + * Get the defaultVersion property: The version identifier that the skill should point to. When set, the skill's + * default version will resolve to this version instead of the latest. + * + * @return the defaultVersion value. + */ + @Generated + public String getDefaultVersion() { + return this.defaultVersion; + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AgentDataGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AgentDataGenerationJobSource.java new file mode 100644 index 000000000000..8c02b35a70e8 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AgentDataGenerationJobSource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Agent source for data generation jobs — references an agent to fetch instructions and metadata from. + */ +@Fluent +public final class AgentDataGenerationJobSource extends DataGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private DataGenerationJobSourceType type = DataGenerationJobSourceType.AGENT; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * The agent name to fetch instructions from. + */ + @Generated + private final String agentName; + + /* + * The agent version. If not specified, the latest version is used. + */ + @Generated + private String agentVersion; + + /** + * Creates an instance of AgentDataGenerationJobSource class. + * + * @param agentName the agentName value to set. + */ + @Generated + public AgentDataGenerationJobSource(String agentName) { + this.agentName = agentName; + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the AgentDataGenerationJobSource object itself. + */ + @Generated + public AgentDataGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the agentName property: The agent name to fetch instructions from. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: The agent version. If not specified, the latest version is used. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. If not specified, the latest version is used. + * + * @param agentVersion the agentVersion value to set. + * @return the AgentDataGenerationJobSource object itself. + */ + @Generated + public AgentDataGenerationJobSource setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("agent_version", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentDataGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentDataGenerationJobSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentDataGenerationJobSource. + */ + @Generated + public static AgentDataGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String agentName = null; + DataGenerationJobSourceType type = DataGenerationJobSourceType.AGENT; + String description = null; + String agentVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + AgentDataGenerationJobSource deserializedAgentDataGenerationJobSource + = new AgentDataGenerationJobSource(agentName); + deserializedAgentDataGenerationJobSource.type = type; + deserializedAgentDataGenerationJobSource.description = description; + deserializedAgentDataGenerationJobSource.agentVersion = agentVersion; + return deserializedAgentDataGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AgentEvaluatorGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AgentEvaluatorGenerationJobSource.java new file mode 100644 index 000000000000..47bad90ee947 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AgentEvaluatorGenerationJobSource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Agent source for evaluator generation jobs — references an agent to fetch instructions and metadata from. + */ +@Fluent +public final class AgentEvaluatorGenerationJobSource extends EvaluatorGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.AGENT; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * The agent name to fetch instructions from. + */ + @Generated + private final String agentName; + + /* + * The agent version. If not specified, the latest version is used. + */ + @Generated + private String agentVersion; + + /** + * Creates an instance of AgentEvaluatorGenerationJobSource class. + * + * @param agentName the agentName value to set. + */ + @Generated + public AgentEvaluatorGenerationJobSource(String agentName) { + this.agentName = agentName; + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public EvaluatorGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the AgentEvaluatorGenerationJobSource object itself. + */ + @Generated + public AgentEvaluatorGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the agentName property: The agent name to fetch instructions from. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Get the agentVersion property: The agent version. If not specified, the latest version is used. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. If not specified, the latest version is used. + * + * @param agentVersion the agentVersion value to set. + * @return the AgentEvaluatorGenerationJobSource object itself. + */ + @Generated + public AgentEvaluatorGenerationJobSource setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("agent_version", this.agentVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AgentEvaluatorGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AgentEvaluatorGenerationJobSource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AgentEvaluatorGenerationJobSource. + */ + @Generated + public static AgentEvaluatorGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String agentName = null; + EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.AGENT; + String description = null; + String agentVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("type".equals(fieldName)) { + type = EvaluatorGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + AgentEvaluatorGenerationJobSource deserializedAgentEvaluatorGenerationJobSource + = new AgentEvaluatorGenerationJobSource(agentName); + deserializedAgentEvaluatorGenerationJobSource.type = type; + deserializedAgentEvaluatorGenerationJobSource.description = description; + deserializedAgentEvaluatorGenerationJobSource.agentVersion = agentVersion; + return deserializedAgentEvaluatorGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ApiError.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ApiError.java new file mode 100644 index 000000000000..57b7d4282a38 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ApiError.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * The ApiError model. + */ +@Immutable +public final class ApiError implements JsonSerializable { + + /* + * The code property. + */ + @Generated + private final String code; + + /* + * The message property. + */ + @Generated + private final String message; + + /* + * The param property. + */ + @Generated + private String param; + + /* + * The type property. + */ + @Generated + private String type; + + /* + * The details property. + */ + @Generated + private List details; + + /* + * The additionalInfo property. + */ + @Generated + private Map additionalInfo; + + /* + * The debugInfo property. + */ + @Generated + private Map debugInfo; + + /** + * Creates an instance of ApiError class. + * + * @param code the code value to set. + * @param message the message value to set. + */ + @Generated + private ApiError(String code, String message) { + this.code = code; + this.message = message; + } + + /** + * Get the code property: The code property. + * + * @return the code value. + */ + @Generated + public String getCode() { + return this.code; + } + + /** + * Get the message property: The message property. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * Get the param property: The param property. + * + * @return the param value. + */ + @Generated + public String getParam() { + return this.param; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the details property: The details property. + * + * @return the details value. + */ + @Generated + public List getDetails() { + return this.details; + } + + /** + * Get the additionalInfo property: The additionalInfo property. + * + * @return the additionalInfo value. + */ + @Generated + public Map getAdditionalInfo() { + return this.additionalInfo; + } + + /** + * Get the debugInfo property: The debugInfo property. + * + * @return the debugInfo value. + */ + @Generated + public Map getDebugInfo() { + return this.debugInfo; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code); + jsonWriter.writeStringField("message", this.message); + jsonWriter.writeStringField("param", this.param); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeMapField("additionalInfo", this.additionalInfo, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeMapField("debugInfo", this.debugInfo, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApiError from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ApiError if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApiError. + */ + @Generated + public static ApiError fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String code = null; + String message = null; + String param = null; + String type = null; + List details = null; + Map additionalInfo = null; + Map debugInfo = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + code = reader.getString(); + } else if ("message".equals(fieldName)) { + message = reader.getString(); + } else if ("param".equals(fieldName)) { + param = reader.getString(); + } else if ("type".equals(fieldName)) { + type = reader.getString(); + } else if ("details".equals(fieldName)) { + details = reader.readArray(reader1 -> ApiError.fromJson(reader1)); + } else if ("additionalInfo".equals(fieldName)) { + additionalInfo = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("debugInfo".equals(fieldName)) { + debugInfo = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else { + reader.skipChildren(); + } + } + ApiError deserializedApiError = new ApiError(code, message); + deserializedApiError.param = param; + deserializedApiError.type = type; + deserializedApiError.details = details; + deserializedApiError.additionalInfo = additionalInfo; + deserializedApiError.debugInfo = debugInfo; + return deserializedApiError; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ArtifactProfile.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ArtifactProfile.java new file mode 100644 index 000000000000..cf2ef8e62ec7 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ArtifactProfile.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Artifact profile of the model. + */ +@Immutable +public final class ArtifactProfile implements JsonSerializable { + + /* + * The category of the artifact profile + */ + @Generated + private final FoundryModelArtifactProfileCategory category; + + /* + * Signals detected in the model artifact + */ + @Generated + private List signals; + + /** + * Creates an instance of ArtifactProfile class. + * + * @param category the category value to set. + */ + @Generated + private ArtifactProfile(FoundryModelArtifactProfileCategory category) { + this.category = category; + } + + /** + * Get the category property: The category of the artifact profile. + * + * @return the category value. + */ + @Generated + public FoundryModelArtifactProfileCategory getCategory() { + return this.category; + } + + /** + * Get the signals property: Signals detected in the model artifact. + * + * @return the signals value. + */ + @Generated + public List getSignals() { + return this.signals; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("category", this.category == null ? null : this.category.toString()); + jsonWriter.writeArrayField("signals", this.signals, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ArtifactProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ArtifactProfile if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ArtifactProfile. + */ + @Generated + public static ArtifactProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FoundryModelArtifactProfileCategory category = null; + List signals = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("category".equals(fieldName)) { + category = FoundryModelArtifactProfileCategory.fromString(reader.getString()); + } else if ("signals".equals(fieldName)) { + signals = reader + .readArray(reader1 -> FoundryModelArtifactProfileSignal.fromString(reader1.getString())); + } else { + reader.skipChildren(); + } + } + ArtifactProfile deserializedArtifactProfile = new ArtifactProfile(category); + deserializedArtifactProfile.signals = signals; + return deserializedArtifactProfile; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AzureAIAgentTarget.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AzureAIAgentTarget.java index 0f8995db22b4..8dc78d28352a 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AzureAIAgentTarget.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/AzureAIAgentTarget.java @@ -3,8 +3,10 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.projects.models; +import com.azure.ai.projects.implementation.OpenAIJsonHelper; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -41,16 +43,6 @@ public final class AzureAIAgentTarget extends Target { @Generated private List toolDescriptions; - /** - * Creates an instance of AzureAIAgentTarget class. - * - * @param name the name value to set. - */ - @Generated - public AzureAIAgentTarget(String name) { - this.name = name; - } - /** * Get the type property: The type of target. * @@ -130,6 +122,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("version", this.version); jsonWriter.writeArrayField("tool_descriptions", this.toolDescriptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("tools", this.tools, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); return jsonWriter.writeEndObject(); } @@ -149,6 +148,7 @@ public static AzureAIAgentTarget fromJson(JsonReader jsonReader) throws IOExcept String type = "azure_ai_agent"; String version = null; List toolDescriptions = null; + List tools = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -160,6 +160,9 @@ public static AzureAIAgentTarget fromJson(JsonReader jsonReader) throws IOExcept version = reader.getString(); } else if ("tool_descriptions".equals(fieldName)) { toolDescriptions = reader.readArray(reader1 -> ToolDescription.fromJson(reader1)); + } else if ("tools".equals(fieldName)) { + tools = reader.readArray(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); } else { reader.skipChildren(); } @@ -168,7 +171,68 @@ public static AzureAIAgentTarget fromJson(JsonReader jsonReader) throws IOExcept deserializedAzureAIAgentTarget.type = type; deserializedAzureAIAgentTarget.version = version; deserializedAzureAIAgentTarget.toolDescriptions = toolDescriptions; + deserializedAzureAIAgentTarget.tools = tools; return deserializedAzureAIAgentTarget; }); } + + /* + * The tools property. + */ + @Generated + private List tools; + + /** + * Get the tools property: The tools property. + * + * @return the tools value. + */ + List getTools() { + // AI Tooling: union type + return this.tools; + } + + /** + * Set the tools property: The tools property. + * + * @param tools the tools value to set. + * @return the AzureAIAgentTarget object itself. + */ + AzureAIAgentTarget setTools(List tools) { + // AI Tooling: union type + this.tools = tools; + return this; + } + + /** + * Get the tools property as a list of {@link com.openai.models.responses.Tool}: The tools property. + * + * @return the tools value as a list of openai-java Tool objects. + */ + public List getToolsAsOpenAITools() { + // AI Tooling: union type + return OpenAIJsonHelper.fromBinaryDataList(this.tools, com.openai.models.responses.Tool.class); + } + + /** + * Set the tools property using a list of {@link com.openai.models.responses.Tool}: The tools property. + * + * @param tools the list of openai-java Tool objects to set. + * @return the AzureAIAgentTarget object itself. + */ + public AzureAIAgentTarget setToolsAsOpenAITools(List tools) { + // AI Tooling: union type + this.tools = OpenAIJsonHelper.toBinaryDataList(tools); + return this; + } + + /** + * Creates an instance of AzureAIAgentTarget class. + * + * @param name the name value to set. + */ + @Generated + public AzureAIAgentTarget(String name) { + this.name = name; + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CreateAsyncResponse.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CreateAsyncResponse.java new file mode 100644 index 000000000000..7bcca172b3d4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CreateAsyncResponse.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CreateAsyncResponse model. + */ +@Immutable +public final class CreateAsyncResponse implements JsonSerializable { + + /* + * URL to poll for operation status. + */ + @Generated + private String location; + + /* + * URL to the operation result, or null if the operation is still in progress. + */ + @Generated + private String operationResult; + + /** + * Creates an instance of CreateAsyncResponse class. + */ + @Generated + private CreateAsyncResponse() { + } + + /** + * Get the location property: URL to poll for operation status. + * + * @return the location value. + */ + @Generated + public String getLocation() { + return this.location; + } + + /** + * Get the operationResult property: URL to the operation result, or null if the operation is still in progress. + * + * @return the operationResult value. + */ + @Generated + public String getOperationResult() { + return this.operationResult; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeStringField("operationResult", this.operationResult); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateAsyncResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateAsyncResponse 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 CreateAsyncResponse. + */ + @Generated + public static CreateAsyncResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateAsyncResponse deserializedCreateAsyncResponse = new CreateAsyncResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("location".equals(fieldName)) { + deserializedCreateAsyncResponse.location = reader.getString(); + } else if ("operationResult".equals(fieldName)) { + deserializedCreateAsyncResponse.operationResult = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedCreateAsyncResponse; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CreateSkillVersionFromFilesBody.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CreateSkillVersionFromFilesBody.java new file mode 100644 index 000000000000..53ef65d4089d --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CreateSkillVersionFromFilesBody.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import java.util.List; + +/** + * Multipart request body for creating a skill version from files. Accepts either a single zip file or multiple + * individual skill files (directory upload). For zip uploads, the server extracts and validates contents. For directory + * uploads, files are validated as-is. + */ +@Fluent +public final class CreateSkillVersionFromFilesBody { + + /* + * Skill files to upload. Upload a single zip file or multiple individual files with relative paths. + */ + @Generated + private final List files; + + /* + * Whether to set this version as the default. Defaults to false. + */ + @Generated + private Boolean defaultProperty; + + /** + * Creates an instance of CreateSkillVersionFromFilesBody class. + * + * @param files the files value to set. + */ + @Generated + public CreateSkillVersionFromFilesBody(List files) { + this.files = files; + } + + /** + * Get the files property: Skill files to upload. Upload a single zip file or multiple individual files with + * relative paths. + * + * @return the files value. + */ + @Generated + public List getFiles() { + return this.files; + } + + /** + * Get the defaultProperty property: Whether to set this version as the default. Defaults to false. + * + * @return the defaultProperty value. + */ + @Generated + public Boolean isDefaultProperty() { + return this.defaultProperty; + } + + /** + * Set the defaultProperty property: Whether to set this version as the default. Defaults to false. + * + * @param defaultProperty the defaultProperty value to set. + * @return the CreateSkillVersionFromFilesBody object itself. + */ + @Generated + public CreateSkillVersionFromFilesBody setDefaultProperty(Boolean defaultProperty) { + this.defaultProperty = defaultProperty; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CronTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CronTrigger.java index 23a2cce73c8b..92253f08e4c7 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CronTrigger.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CronTrigger.java @@ -32,7 +32,7 @@ public final class CronTrigger extends Trigger { private final String expression; /* - * Time zone for the cron schedule. + * Time zone for the cron schedule. Defaults to `UTC`. */ @Generated private String timeZone; @@ -71,7 +71,7 @@ public String getExpression() { } /** - * Get the timeZone property: Time zone for the cron schedule. + * Get the timeZone property: Time zone for the cron schedule. Defaults to `UTC`. * * @return the timeZone value. */ @@ -197,7 +197,7 @@ public CronTrigger setEndTime(OffsetDateTime endTime) { } /** - * Set the timeZone property: Time zone for the cron schedule. + * Set the timeZone property: Time zone for the cron schedule. Defaults to `UTC`. * * @param timeZone the timeZone value to set. * @return the CronTrigger object itself. diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CustomRoutineTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CustomRoutineTrigger.java new file mode 100644 index 000000000000..fa1c9352306e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/CustomRoutineTrigger.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * A custom event routine trigger. + */ +@Fluent +public final class CustomRoutineTrigger extends RoutineTrigger { + + /* + * The trigger type. + */ + @Generated + private RoutineTriggerType type = RoutineTriggerType.CUSTOM; + + /* + * The external provider that emits the custom event. + */ + @Generated + private final String provider; + + /* + * The provider-specific event name that fires the routine. + */ + @Generated + private String eventName; + + /* + * Provider-specific trigger parameters. + */ + @Generated + private final Map parameters; + + /** + * Creates an instance of CustomRoutineTrigger class. + * + * @param provider the provider value to set. + * @param parameters the parameters value to set. + */ + @Generated + public CustomRoutineTrigger(String provider, Map parameters) { + this.provider = provider; + this.parameters = parameters; + } + + /** + * Get the type property: The trigger type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineTriggerType getType() { + return this.type; + } + + /** + * Get the provider property: The external provider that emits the custom event. + * + * @return the provider value. + */ + @Generated + public String getProvider() { + return this.provider; + } + + /** + * Get the eventName property: The provider-specific event name that fires the routine. + * + * @return the eventName value. + */ + @Generated + public String getEventName() { + return this.eventName; + } + + /** + * Set the eventName property: The provider-specific event name that fires the routine. + * + * @param eventName the eventName value to set. + * @return the CustomRoutineTrigger object itself. + */ + @Generated + public CustomRoutineTrigger setEventName(String eventName) { + this.eventName = eventName; + return this; + } + + /** + * Get the parameters property: Provider-specific trigger parameters. + * + * @return the parameters value. + */ + @Generated + public Map getParameters() { + return this.parameters; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provider", this.provider); + jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("event_name", this.eventName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomRoutineTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomRoutineTrigger if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CustomRoutineTrigger. + */ + @Generated + public static CustomRoutineTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String provider = null; + Map parameters = null; + RoutineTriggerType type = RoutineTriggerType.CUSTOM; + String eventName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("provider".equals(fieldName)) { + provider = reader.getString(); + } else if ("parameters".equals(fieldName)) { + parameters = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("type".equals(fieldName)) { + type = RoutineTriggerType.fromString(reader.getString()); + } else if ("event_name".equals(fieldName)) { + eventName = reader.getString(); + } else { + reader.skipChildren(); + } + } + CustomRoutineTrigger deserializedCustomRoutineTrigger = new CustomRoutineTrigger(provider, parameters); + deserializedCustomRoutineTrigger.type = type; + deserializedCustomRoutineTrigger.eventName = eventName; + return deserializedCustomRoutineTrigger; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJob.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJob.java new file mode 100644 index 000000000000..a37f81af9c30 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJob.java @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Data Generation Job resource. + */ +@Fluent +public final class DataGenerationJob implements JsonSerializable { + + /* + * Server-assigned unique identifier. + */ + @Generated + private String id; + + /* + * Caller-supplied inputs. + */ + @Generated + private DataGenerationJobInputs inputs; + + /* + * Result produced on success. + */ + @Generated + private DataGenerationJobResult result; + + /* + * Current lifecycle status. + */ + @Generated + private JobStatus status; + + /* + * Error details — populated only on failure. + */ + @Generated + private ApiError error; + + /* + * The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970). + */ + @Generated + private long createdAt; + + /* + * The timestamp when the job was finished, represented in Unix time (seconds since January 1, 1970). + */ + @Generated + private Long finishedAt; + + /** + * Creates an instance of DataGenerationJob class. + */ + @Generated + public DataGenerationJob() { + } + + /** + * Get the id property: Server-assigned unique identifier. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the inputs property: Caller-supplied inputs. + * + * @return the inputs value. + */ + @Generated + public DataGenerationJobInputs getInputs() { + return this.inputs; + } + + /** + * Set the inputs property: Caller-supplied inputs. + * + * @param inputs the inputs value to set. + * @return the DataGenerationJob object itself. + */ + @Generated + public DataGenerationJob setInputs(DataGenerationJobInputs inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the result property: Result produced on success. + * + * @return the result value. + */ + @Generated + public DataGenerationJobResult getResult() { + return this.result; + } + + /** + * Get the status property: Current lifecycle status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the error property: Error details — populated only on failure. + * + * @return the error value. + */ + @Generated + public ApiError getError() { + return this.error; + } + + /** + * Get the createdAt property: The timestamp when the job was created, represented in Unix time (seconds since + * January 1, 1970). + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the finishedAt property: The timestamp when the job was finished, represented in Unix time (seconds since + * January 1, 1970). + * + * @return the finishedAt value. + */ + @Generated + public OffsetDateTime getFinishedAt() { + if (this.finishedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.finishedAt), ZoneOffset.UTC); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("inputs", this.inputs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJob if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationJob. + */ + @Generated + public static DataGenerationJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataGenerationJob deserializedDataGenerationJob = new DataGenerationJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedDataGenerationJob.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedDataGenerationJob.status = JobStatus.fromString(reader.getString()); + } else if ("created_at".equals(fieldName)) { + deserializedDataGenerationJob.createdAt = reader.getLong(); + } else if ("inputs".equals(fieldName)) { + deserializedDataGenerationJob.inputs = DataGenerationJobInputs.fromJson(reader); + } else if ("result".equals(fieldName)) { + deserializedDataGenerationJob.result = DataGenerationJobResult.fromJson(reader); + } else if ("error".equals(fieldName)) { + deserializedDataGenerationJob.error = ApiError.fromJson(reader); + } else if ("finished_at".equals(fieldName)) { + deserializedDataGenerationJob.finishedAt = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + return deserializedDataGenerationJob; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobInputs.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobInputs.java new file mode 100644 index 000000000000..51a11c440556 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobInputs.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.util.List; + +/** + * Caller-supplied inputs for a data generation job. + */ +@Fluent +public final class DataGenerationJobInputs implements JsonSerializable { + + /* + * The display name of the data generation job. + */ + @Generated + private final String name; + + /* + * The sources used for the data generation job. + */ + @Generated + private final List sources; + + /* + * The options for the data generation job. + */ + @Generated + private final DataGenerationJobOptions options; + + /* + * The scenario of the data generation job. Either for fine-tuning or evaluation. + */ + @Generated + private final DataGenerationJobScenario scenario; + + /* + * Optional caller-supplied metadata for the job's output. See individual fields for whether they apply to file + * outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both. + */ + @Generated + private DataGenerationJobOutputOptions outputOptions; + + /** + * Creates an instance of DataGenerationJobInputs class. + * + * @param name the name value to set. + * @param sources the sources value to set. + * @param options the options value to set. + * @param scenario the scenario value to set. + */ + @Generated + public DataGenerationJobInputs(String name, List sources, DataGenerationJobOptions options, + DataGenerationJobScenario scenario) { + this.name = name; + this.sources = sources; + this.options = options; + this.scenario = scenario; + } + + /** + * Get the name property: The display name of the data generation job. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the sources property: The sources used for the data generation job. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the options property: The options for the data generation job. + * + * @return the options value. + */ + @Generated + public DataGenerationJobOptions getOptions() { + return this.options; + } + + /** + * Get the scenario property: The scenario of the data generation job. Either for fine-tuning or evaluation. + * + * @return the scenario value. + */ + @Generated + public DataGenerationJobScenario getScenario() { + return this.scenario; + } + + /** + * Get the outputOptions property: Optional caller-supplied metadata for the job's output. See individual fields for + * whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both. + * + * @return the outputOptions value. + */ + @Generated + public DataGenerationJobOutputOptions getOutputOptions() { + return this.outputOptions; + } + + /** + * Set the outputOptions property: Optional caller-supplied metadata for the job's output. See individual fields for + * whether they apply to file outputs (fine-tuning scenarios), dataset outputs (evaluation scenario), or both. + * + * @param outputOptions the outputOptions value to set. + * @return the DataGenerationJobInputs object itself. + */ + @Generated + public DataGenerationJobInputs setOutputOptions(DataGenerationJobOutputOptions outputOptions) { + this.outputOptions = outputOptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("options", this.options); + jsonWriter.writeStringField("scenario", this.scenario == null ? null : this.scenario.toString()); + jsonWriter.writeJsonField("output_options", this.outputOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJobInputs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJobInputs if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationJobInputs. + */ + @Generated + public static DataGenerationJobInputs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + List sources = null; + DataGenerationJobOptions options = null; + DataGenerationJobScenario scenario = null; + DataGenerationJobOutputOptions outputOptions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("sources".equals(fieldName)) { + sources = reader.readArray(reader1 -> DataGenerationJobSource.fromJson(reader1)); + } else if ("options".equals(fieldName)) { + options = DataGenerationJobOptions.fromJson(reader); + } else if ("scenario".equals(fieldName)) { + scenario = DataGenerationJobScenario.fromString(reader.getString()); + } else if ("output_options".equals(fieldName)) { + outputOptions = DataGenerationJobOutputOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + DataGenerationJobInputs deserializedDataGenerationJobInputs + = new DataGenerationJobInputs(name, sources, options, scenario); + deserializedDataGenerationJobInputs.outputOptions = outputOptions; + return deserializedDataGenerationJobInputs; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOptions.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOptions.java new file mode 100644 index 000000000000..1011dd2f961b --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOptions.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; + +/** + * Options for managing data generation jobs. + */ +@Fluent +public class DataGenerationJobOptions implements JsonSerializable { + + /* + * The data generation job type. + */ + @Generated + private DataGenerationJobType type = DataGenerationJobType.fromString("DataGenerationJobOptions"); + + /* + * Maximum number of samples to generate. + */ + @Generated + private final int maxSamples; + + /* + * The proportion of the generated data to be used for training when the data is used for fine-tuning. The rest will + * be used for validation. Value should be between 0 and 1. + */ + @Generated + private Double trainSplit; + + /* + * The LLM model options. + */ + @Generated + private DataGenerationModelOptions modelOptions; + + /** + * Creates an instance of DataGenerationJobOptions class. + * + * @param maxSamples the maxSamples value to set. + */ + @Generated + public DataGenerationJobOptions(int maxSamples) { + this.maxSamples = maxSamples; + } + + /** + * Get the type property: The data generation job type. + * + * @return the type value. + */ + @Generated + public DataGenerationJobType getType() { + return this.type; + } + + /** + * Get the maxSamples property: Maximum number of samples to generate. + * + * @return the maxSamples value. + */ + @Generated + public int getMaxSamples() { + return this.maxSamples; + } + + /** + * Get the trainSplit property: The proportion of the generated data to be used for training when the data is used + * for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + * + * @return the trainSplit value. + */ + @Generated + public Double getTrainSplit() { + return this.trainSplit; + } + + /** + * Set the trainSplit property: The proportion of the generated data to be used for training when the data is used + * for fine-tuning. The rest will be used for validation. Value should be between 0 and 1. + * + * @param trainSplit the trainSplit value to set. + * @return the DataGenerationJobOptions object itself. + */ + @Generated + public DataGenerationJobOptions setTrainSplit(Double trainSplit) { + this.trainSplit = trainSplit; + return this; + } + + /** + * Get the modelOptions property: The LLM model options. + * + * @return the modelOptions value. + */ + @Generated + public DataGenerationModelOptions getModelOptions() { + return this.modelOptions; + } + + /** + * Set the modelOptions property: The LLM model options. + * + * @param modelOptions the modelOptions value to set. + * @return the DataGenerationJobOptions object itself. + */ + @Generated + public DataGenerationJobOptions setModelOptions(DataGenerationModelOptions modelOptions) { + this.modelOptions = modelOptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("max_samples", this.maxSamples); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("train_split", this.trainSplit); + jsonWriter.writeJsonField("model_options", this.modelOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJobOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJobOptions if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationJobOptions. + */ + @Generated + public static DataGenerationJobOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("simple_qna".equals(discriminatorValue)) { + return SimpleQnADataGenerationJobOptions.fromJson(readerToUse.reset()); + } else if ("traces".equals(discriminatorValue)) { + return TracesDataGenerationJobOptions.fromJson(readerToUse.reset()); + } else if ("tool_use".equals(discriminatorValue)) { + return ToolUseFineTuningDataGenerationJobOptions.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static DataGenerationJobOptions fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int maxSamples = 0; + DataGenerationJobType type = null; + Double trainSplit = null; + DataGenerationModelOptions modelOptions = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_samples".equals(fieldName)) { + maxSamples = reader.getInt(); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobType.fromString(reader.getString()); + } else if ("train_split".equals(fieldName)) { + trainSplit = reader.getNullable(JsonReader::getDouble); + } else if ("model_options".equals(fieldName)) { + modelOptions = DataGenerationModelOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + DataGenerationJobOptions deserializedDataGenerationJobOptions = new DataGenerationJobOptions(maxSamples); + deserializedDataGenerationJobOptions.type = type; + deserializedDataGenerationJobOptions.trainSplit = trainSplit; + deserializedDataGenerationJobOptions.modelOptions = modelOptions; + return deserializedDataGenerationJobOptions; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutput.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutput.java new file mode 100644 index 000000000000..f42a56ba95d2 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutput.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Output information for a data generation job. + */ +@Immutable +public class DataGenerationJobOutput implements JsonSerializable { + + /* + * The type of the output. + */ + @Generated + private DataGenerationJobOutputType type = DataGenerationJobOutputType.fromString("DataGenerationJobOutput"); + + /** + * Creates an instance of DataGenerationJobOutput class. + */ + @Generated + protected DataGenerationJobOutput() { + } + + /** + * Get the type property: The type of the output. + * + * @return the type value. + */ + @Generated + public DataGenerationJobOutputType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJobOutput 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 DataGenerationJobOutput. + */ + @Generated + public static DataGenerationJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("file".equals(discriminatorValue)) { + return FileDataGenerationJobOutput.fromJson(readerToUse.reset()); + } else if ("dataset".equals(discriminatorValue)) { + return DatasetDataGenerationJobOutput.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static DataGenerationJobOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataGenerationJobOutput deserializedDataGenerationJobOutput = new DataGenerationJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedDataGenerationJobOutput.type + = DataGenerationJobOutputType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedDataGenerationJobOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputOptions.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputOptions.java new file mode 100644 index 000000000000..7fbe7f1d2a46 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputOptions.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.util.Map; + +/** + * Output options for data generation job. + */ +@Fluent +public final class DataGenerationJobOutputOptions implements JsonSerializable { + + /* + * Name to assign to the output. Used as the filename for Azure OpenAI file outputs (fine-tuning scenarios) and as + * the dataset name for dataset outputs (evaluation scenario). + */ + @Generated + private String name; + + /* + * Description to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure + * OpenAI file outputs. + */ + @Generated + private String description; + + /* + * Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); ignored for Azure OpenAI + * file outputs. + */ + @Generated + private Map tags; + + /** + * Creates an instance of DataGenerationJobOutputOptions class. + */ + @Generated + public DataGenerationJobOutputOptions() { + } + + /** + * Get the name property: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + * (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Set the name property: Name to assign to the output. Used as the filename for Azure OpenAI file outputs + * (fine-tuning scenarios) and as the dataset name for dataset outputs (evaluation scenario). + * + * @param name the name value to set. + * @return the DataGenerationJobOutputOptions object itself. + */ + @Generated + public DataGenerationJobOutputOptions setName(String name) { + this.name = name; + return this; + } + + /** + * Get the description property: Description to assign to the output. Applies only to dataset outputs (evaluation + * scenario); ignored for Azure OpenAI file outputs. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Description to assign to the output. Applies only to dataset outputs (evaluation + * scenario); ignored for Azure OpenAI file outputs. + * + * @param description the description value to set. + * @return the DataGenerationJobOutputOptions object itself. + */ + @Generated + public DataGenerationJobOutputOptions setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the tags property: Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); + * ignored for Azure OpenAI file outputs. + * + * @return the tags value. + */ + @Generated + public Map getTags() { + return this.tags; + } + + /** + * Set the tags property: Tags to assign to the output. Applies only to dataset outputs (evaluation scenario); + * ignored for Azure OpenAI file outputs. + * + * @param tags the tags value to set. + * @return the DataGenerationJobOutputOptions object itself. + */ + @Generated + public DataGenerationJobOutputOptions setTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJobOutputOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJobOutputOptions 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 DataGenerationJobOutputOptions. + */ + @Generated + public static DataGenerationJobOutputOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataGenerationJobOutputOptions deserializedDataGenerationJobOutputOptions + = new DataGenerationJobOutputOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + deserializedDataGenerationJobOutputOptions.name = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDataGenerationJobOutputOptions.description = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDataGenerationJobOutputOptions.tags = tags; + } else { + reader.skipChildren(); + } + } + return deserializedDataGenerationJobOutputOptions; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputType.java new file mode 100644 index 000000000000..a4b311e57c5c --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputType.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.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported output file types for a data generation job. + */ +public final class DataGenerationJobOutputType extends ExpandableStringEnum { + + /** + * The generated data is an Azure OpenAI File. + */ + @Generated + public static final DataGenerationJobOutputType FILE = fromString("file"); + + /** + * The generated data is a Dataset. + */ + @Generated + public static final DataGenerationJobOutputType DATASET = fromString("dataset"); + + /** + * Creates a new instance of DataGenerationJobOutputType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DataGenerationJobOutputType() { + } + + /** + * Creates or finds a DataGenerationJobOutputType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataGenerationJobOutputType. + */ + @Generated + public static DataGenerationJobOutputType fromString(String name) { + return fromString(name, DataGenerationJobOutputType.class); + } + + /** + * Gets known DataGenerationJobOutputType values. + * + * @return known DataGenerationJobOutputType values. + */ + @Generated + public static Collection values() { + return values(DataGenerationJobOutputType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobResult.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobResult.java new file mode 100644 index 000000000000..cc5b35ec84d2 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobResult.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Result produced by a successful data generation job. + */ +@Immutable +public final class DataGenerationJobResult implements JsonSerializable { + + /* + * The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation. + */ + @Generated + private List outputs; + + /* + * The number of samples actually generated. + */ + @Generated + private final int generatedSamples; + + /* + * The token usage information for the data generation job. + */ + @Generated + private DataGenerationTokenUsage tokenUsage; + + /** + * Creates an instance of DataGenerationJobResult class. + * + * @param generatedSamples the generatedSamples value to set. + */ + @Generated + private DataGenerationJobResult(int generatedSamples) { + this.generatedSamples = generatedSamples; + } + + /** + * Get the outputs property: The final job outputs: Azure OpenAI files for fine-tuning, or datasets for evaluation. + * + * @return the outputs value. + */ + @Generated + public List getOutputs() { + return this.outputs; + } + + /** + * Get the generatedSamples property: The number of samples actually generated. + * + * @return the generatedSamples value. + */ + @Generated + public int getGeneratedSamples() { + return this.generatedSamples; + } + + /** + * Get the tokenUsage property: The token usage information for the data generation job. + * + * @return the tokenUsage value. + */ + @Generated + public DataGenerationTokenUsage getTokenUsage() { + return this.tokenUsage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("generated_samples", this.generatedSamples); + jsonWriter.writeArrayField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("token_usage", this.tokenUsage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJobResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJobResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationJobResult. + */ + @Generated + public static DataGenerationJobResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int generatedSamples = 0; + List outputs = null; + DataGenerationTokenUsage tokenUsage = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("generated_samples".equals(fieldName)) { + generatedSamples = reader.getInt(); + } else if ("outputs".equals(fieldName)) { + outputs = reader.readArray(reader1 -> DataGenerationJobOutput.fromJson(reader1)); + } else if ("token_usage".equals(fieldName)) { + tokenUsage = DataGenerationTokenUsage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + DataGenerationJobResult deserializedDataGenerationJobResult = new DataGenerationJobResult(generatedSamples); + deserializedDataGenerationJobResult.outputs = outputs; + deserializedDataGenerationJobResult.tokenUsage = tokenUsage; + return deserializedDataGenerationJobResult; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobScenario.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobScenario.java new file mode 100644 index 000000000000..a59cf787f930 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobScenario.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported scenarios for a data generation job. + */ +public final class DataGenerationJobScenario extends ExpandableStringEnum { + + /** + * Supervised Fine-tuning scenario. + */ + @Generated + public static final DataGenerationJobScenario SUPERVISED_FINETUNING = fromString("supervised_finetuning"); + + /** + * Reinforcement Fine-tuning scenario. + */ + @Generated + public static final DataGenerationJobScenario REINFORCEMENT_FINETUNING = fromString("reinforcement_finetuning"); + + /** + * Evaluation scenario. + */ + @Generated + public static final DataGenerationJobScenario EVALUATION = fromString("evaluation"); + + /** + * Creates a new instance of DataGenerationJobScenario value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DataGenerationJobScenario() { + } + + /** + * Creates or finds a DataGenerationJobScenario from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataGenerationJobScenario. + */ + @Generated + public static DataGenerationJobScenario fromString(String name) { + return fromString(name, DataGenerationJobScenario.class); + } + + /** + * Gets known DataGenerationJobScenario values. + * + * @return known DataGenerationJobScenario values. + */ + @Generated + public static Collection values() { + return values(DataGenerationJobScenario.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobSource.java new file mode 100644 index 000000000000..85651698eaba --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobSource.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; + +/** + * The base source model for data generation jobs. + */ +@Fluent +public class DataGenerationJobSource implements JsonSerializable { + + /* + * The type of source. + */ + @Generated + private DataGenerationJobSourceType type = DataGenerationJobSourceType.fromString("DataGenerationJobSource"); + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /** + * Creates an instance of DataGenerationJobSource class. + */ + @Generated + public DataGenerationJobSource() { + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + public DataGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the DataGenerationJobSource object itself. + */ + @Generated + public DataGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationJobSource 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 DataGenerationJobSource. + */ + @Generated + public static DataGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("prompt".equals(discriminatorValue)) { + return PromptDataGenerationJobSource.fromJson(readerToUse.reset()); + } else if ("agent".equals(discriminatorValue)) { + return AgentDataGenerationJobSource.fromJson(readerToUse.reset()); + } else if ("traces".equals(discriminatorValue)) { + return TracesDataGenerationJobSource.fromJson(readerToUse.reset()); + } else if ("file".equals(discriminatorValue)) { + return FileDataGenerationJobSource.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static DataGenerationJobSource fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataGenerationJobSource deserializedDataGenerationJobSource = new DataGenerationJobSource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedDataGenerationJobSource.type + = DataGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedDataGenerationJobSource.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDataGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobSourceType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobSourceType.java new file mode 100644 index 000000000000..20310e7e5653 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobSourceType.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported source types for data generation jobs. + */ +public final class DataGenerationJobSourceType extends ExpandableStringEnum { + + /** + * Prompt source — inline text provided by the user. + */ + @Generated + public static final DataGenerationJobSourceType PROMPT = fromString("prompt"); + + /** + * Agent source — references an agent. + */ + @Generated + public static final DataGenerationJobSourceType AGENT = fromString("agent"); + + /** + * Traces source — conversation traces from Application Insights. + */ + @Generated + public static final DataGenerationJobSourceType TRACES = fromString("traces"); + + /** + * File source — Azure OpenAI file. + */ + @Generated + public static final DataGenerationJobSourceType FILE = fromString("file"); + + /** + * Creates a new instance of DataGenerationJobSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DataGenerationJobSourceType() { + } + + /** + * Creates or finds a DataGenerationJobSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataGenerationJobSourceType. + */ + @Generated + public static DataGenerationJobSourceType fromString(String name) { + return fromString(name, DataGenerationJobSourceType.class); + } + + /** + * Gets known DataGenerationJobSourceType values. + * + * @return known DataGenerationJobSourceType values. + */ + @Generated + public static Collection values() { + return values(DataGenerationJobSourceType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobType.java new file mode 100644 index 000000000000..8fe5e4afc300 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationJobType.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported data generation job types. + */ +public final class DataGenerationJobType extends ExpandableStringEnum { + + /** + * Simple question and answers between user and agent. + */ + @Generated + public static final DataGenerationJobType SIMPLE_QNA = fromString("simple_qna"); + + /** + * Single turn query and response from agent traces. + */ + @Generated + public static final DataGenerationJobType TRACES = fromString("traces"); + + /** + * Tool calling conversation between user and agent. + */ + @Generated + public static final DataGenerationJobType TOOL_USE = fromString("tool_use"); + + /** + * Creates a new instance of DataGenerationJobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public DataGenerationJobType() { + } + + /** + * Creates or finds a DataGenerationJobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataGenerationJobType. + */ + @Generated + public static DataGenerationJobType fromString(String name) { + return fromString(name, DataGenerationJobType.class); + } + + /** + * Gets known DataGenerationJobType values. + * + * @return known DataGenerationJobType values. + */ + @Generated + public static Collection values() { + return values(DataGenerationJobType.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputImage.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationModelOptions.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputImage.java rename to sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationModelOptions.java index 2de241ba0d73..bc5ab0aadb68 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/CodeInterpreterOutputImage.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationModelOptions.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.projects.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,53 +12,35 @@ import java.io.IOException; /** - * Code interpreter output image - * - * The image output from the code interpreter. + * LLM model options for data generation jobs. */ @Immutable -public final class CodeInterpreterOutputImage implements JsonSerializable { +public final class DataGenerationModelOptions implements JsonSerializable { /* - * The type of the output. Always `image`. + * Base model name used to generate data. */ @Generated - private final String type = "image"; - - /* - * The URL of the image output from the code interpreter. - */ - @Generated - private final String url; - - /** - * Creates an instance of CodeInterpreterOutputImage class. - * - * @param url the url value to set. - */ - @Generated - public CodeInterpreterOutputImage(String url) { - this.url = url; - } + private final String model; /** - * Get the type property: The type of the output. Always `image`. + * Creates an instance of DataGenerationModelOptions class. * - * @return the type value. + * @param model the model value to set. */ @Generated - public String getType() { - return this.type; + public DataGenerationModelOptions(String model) { + this.model = model; } /** - * Get the url property: The URL of the image output from the code interpreter. + * Get the model property: Base model name used to generate data. * - * @return the url value. + * @return the model value. */ @Generated - public String getUrl() { - return this.url; + public String getModel() { + return this.model; } /** @@ -68,34 +50,33 @@ public String getUrl() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("url", this.url); + jsonWriter.writeStringField("model", this.model); return jsonWriter.writeEndObject(); } /** - * Reads an instance of CodeInterpreterOutputImage from the JsonReader. + * Reads an instance of DataGenerationModelOptions from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of CodeInterpreterOutputImage if the JsonReader was pointing to an instance of it, or null if + * @return An instance of DataGenerationModelOptions if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the CodeInterpreterOutputImage. + * @throws IOException If an error occurs while reading the DataGenerationModelOptions. */ @Generated - public static CodeInterpreterOutputImage fromJson(JsonReader jsonReader) throws IOException { + public static DataGenerationModelOptions fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String url = null; + String model = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("url".equals(fieldName)) { - url = reader.getString(); + if ("model".equals(fieldName)) { + model = reader.getString(); } else { reader.skipChildren(); } } - return new CodeInterpreterOutputImage(url); + return new DataGenerationModelOptions(model); }); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationTokenUsage.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationTokenUsage.java new file mode 100644 index 000000000000..6830172dd46e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DataGenerationTokenUsage.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Token usage information for a data generation job. + */ +@Immutable +public final class DataGenerationTokenUsage implements JsonSerializable { + + /* + * The number of prompt tokens used. + */ + @Generated + private long promptTokens; + + /* + * The number of completion tokens generated. + */ + @Generated + private long completionTokens; + + /* + * Total number of tokens used. + */ + @Generated + private long totalTokens; + + /** + * Creates an instance of DataGenerationTokenUsage class. + */ + @Generated + private DataGenerationTokenUsage() { + } + + /** + * Get the promptTokens property: The number of prompt tokens used. + * + * @return the promptTokens value. + */ + @Generated + public long getPromptTokens() { + return this.promptTokens; + } + + /** + * Get the completionTokens property: The number of completion tokens generated. + * + * @return the completionTokens value. + */ + @Generated + public long getCompletionTokens() { + return this.completionTokens; + } + + /** + * Get the totalTokens property: Total number of tokens used. + * + * @return the totalTokens value. + */ + @Generated + public long getTotalTokens() { + return this.totalTokens; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataGenerationTokenUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataGenerationTokenUsage if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataGenerationTokenUsage. + */ + @Generated + public static DataGenerationTokenUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataGenerationTokenUsage deserializedDataGenerationTokenUsage = new DataGenerationTokenUsage(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("prompt_tokens".equals(fieldName)) { + deserializedDataGenerationTokenUsage.promptTokens = reader.getLong(); + } else if ("completion_tokens".equals(fieldName)) { + deserializedDataGenerationTokenUsage.completionTokens = reader.getLong(); + } else if ("total_tokens".equals(fieldName)) { + deserializedDataGenerationTokenUsage.totalTokens = reader.getLong(); + } else { + reader.skipChildren(); + } + } + return deserializedDataGenerationTokenUsage; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetDataGenerationJobOutput.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetDataGenerationJobOutput.java new file mode 100644 index 000000000000..746521a80d65 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetDataGenerationJobOutput.java @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +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.Map; + +/** + * Dataset output for a data generation job. + */ +@Immutable +public final class DatasetDataGenerationJobOutput extends DataGenerationJobOutput { + + /* + * The type of the output. + */ + @Generated + private DataGenerationJobOutputType type = DataGenerationJobOutputType.DATASET; + + /* + * The id of the output dataset created. + */ + @Generated + private String id; + + /* + * The name of the output dataset. + */ + @Generated + private String name; + + /* + * The version of the output dataset. + */ + @Generated + private String version; + + /* + * Description of the output dataset. + */ + @Generated + private String description; + + /* + * Tag dictionary of the output dataset. + */ + @Generated + private Map tags; + + /** + * Creates an instance of DatasetDataGenerationJobOutput class. + */ + @Generated + private DatasetDataGenerationJobOutput() { + } + + /** + * Get the type property: The type of the output. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobOutputType getType() { + return this.type; + } + + /** + * Get the id property: The id of the output dataset created. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The name of the output dataset. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: The version of the output dataset. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the description property: Description of the output dataset. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the tags property: Tag dictionary of the output dataset. + * + * @return the tags value. + */ + @Generated + public Map getTags() { + return this.tags; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatasetDataGenerationJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatasetDataGenerationJobOutput 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 DatasetDataGenerationJobOutput. + */ + @Generated + public static DatasetDataGenerationJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatasetDataGenerationJobOutput deserializedDatasetDataGenerationJobOutput + = new DatasetDataGenerationJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedDatasetDataGenerationJobOutput.type + = DataGenerationJobOutputType.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + deserializedDatasetDataGenerationJobOutput.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDatasetDataGenerationJobOutput.name = reader.getString(); + } else if ("version".equals(fieldName)) { + deserializedDatasetDataGenerationJobOutput.version = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedDatasetDataGenerationJobOutput.description = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedDatasetDataGenerationJobOutput.tags = tags; + } else { + reader.skipChildren(); + } + } + return deserializedDatasetDataGenerationJobOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetEvaluatorGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetEvaluatorGenerationJobSource.java new file mode 100644 index 000000000000..b0af845acc60 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetEvaluatorGenerationJobSource.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dataset source for evaluator generation jobs — reference to a dataset. + */ +@Fluent +public final class DatasetEvaluatorGenerationJobSource extends EvaluatorGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.DATASET; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * The name of the dataset. + */ + @Generated + private final String name; + + /* + * The version of the dataset. If not specified, the latest version is used. + */ + @Generated + private String version; + + /** + * Creates an instance of DatasetEvaluatorGenerationJobSource class. + * + * @param name the name value to set. + */ + @Generated + public DatasetEvaluatorGenerationJobSource(String name) { + this.name = name; + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public EvaluatorGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the DatasetEvaluatorGenerationJobSource object itself. + */ + @Generated + public DatasetEvaluatorGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the name property: The name of the dataset. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: The version of the dataset. If not specified, the latest version is used. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Set the version property: The version of the dataset. If not specified, the latest version is used. + * + * @param version the version value to set. + * @return the DatasetEvaluatorGenerationJobSource object itself. + */ + @Generated + public DatasetEvaluatorGenerationJobSource setVersion(String version) { + this.version = version; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatasetEvaluatorGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatasetEvaluatorGenerationJobSource if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatasetEvaluatorGenerationJobSource. + */ + @Generated + public static DatasetEvaluatorGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.DATASET; + String description = null; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("type".equals(fieldName)) { + type = EvaluatorGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + DatasetEvaluatorGenerationJobSource deserializedDatasetEvaluatorGenerationJobSource + = new DatasetEvaluatorGenerationJobSource(name); + deserializedDatasetEvaluatorGenerationJobSource.type = type; + deserializedDatasetEvaluatorGenerationJobSource.description = description; + deserializedDatasetEvaluatorGenerationJobSource.version = version; + return deserializedDatasetEvaluatorGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetReference.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetReference.java new file mode 100644 index 000000000000..51e2f10e15b8 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DatasetReference.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Reference to a versioned Foundry Dataset. + */ +@Immutable +public final class DatasetReference implements JsonSerializable { + + /* + * Dataset name. + */ + @Generated + private final String name; + + /* + * Dataset version. + */ + @Generated + private final String version; + + /** + * Creates an instance of DatasetReference class. + * + * @param name the name value to set. + * @param version the version value to set. + */ + @Generated + private DatasetReference(String name, String version) { + this.name = name; + this.version = version; + } + + /** + * Get the name property: Dataset name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: Dataset version. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DatasetReference from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DatasetReference if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DatasetReference. + */ + @Generated + public static DatasetReference fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new DatasetReference(name, version); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Dimension.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Dimension.java new file mode 100644 index 000000000000..98f05469a855 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Dimension.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; + +/** + * A single dimension — one independent, measurable quality dimension within a rubric evaluator's scoring blueprint. + */ +@Fluent +public final class Dimension implements JsonSerializable { + + /* + * What this dimension measures (e.g., 'Correctly identifies the user's reservation intent and pursues the + * appropriate workflow'). + */ + @Generated + private final String description; + + /* + * Relative weight of this dimension (1-10). The generation pipeline assigns exactly one dimension weight 8-10; all + * others use 1-6. User edits are not constrained by this heuristic. + */ + @Generated + private final int weight; + + /* + * When true, the LLM judge always scores this dimension regardless of relevance (skips applicability assessment). + * The service-generated general quality/policy dimension has this set to true and is non-editable. Users may set + * this on their own custom dimensions. The service defaults to `false` if a value is not specified by the caller. + */ + @Generated + private Boolean alwaysApplicable; + + /** + * Creates an instance of Dimension class. + * + * @param id the id value to set. + * @param description the description value to set. + * @param weight the weight value to set. + */ + @Generated + public Dimension(String id, String description, int weight) { + this.id = id; + this.description = description; + this.weight = weight; + } + + /** + * Get the description property: What this dimension measures (e.g., 'Correctly identifies the user's reservation + * intent and pursues the appropriate workflow'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the weight property: Relative weight of this dimension (1-10). The generation pipeline assigns exactly one + * dimension weight 8-10; all others use 1-6. User edits are not constrained by this heuristic. + * + * @return the weight value. + */ + @Generated + public int getWeight() { + return this.weight; + } + + /** + * Get the alwaysApplicable property: When true, the LLM judge always scores this dimension regardless of relevance + * (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and + * is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is + * not specified by the caller. + * + * @return the alwaysApplicable value. + */ + @Generated + public Boolean isAlwaysApplicable() { + return this.alwaysApplicable; + } + + /** + * Set the alwaysApplicable property: When true, the LLM judge always scores this dimension regardless of relevance + * (skips applicability assessment). The service-generated general quality/policy dimension has this set to true and + * is non-editable. Users may set this on their own custom dimensions. The service defaults to `false` if a value is + * not specified by the caller. + * + * @param alwaysApplicable the alwaysApplicable value to set. + * @return the Dimension object itself. + */ + @Generated + public Dimension setAlwaysApplicable(Boolean alwaysApplicable) { + this.alwaysApplicable = alwaysApplicable; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeIntField("weight", this.weight); + jsonWriter.writeBooleanField("always_applicable", this.alwaysApplicable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Dimension from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Dimension if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Dimension. + */ + @Generated + public static Dimension fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String description = null; + int weight = 0; + Boolean alwaysApplicable = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("weight".equals(fieldName)) { + weight = reader.getInt(); + } else if ("always_applicable".equals(fieldName)) { + alwaysApplicable = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + Dimension deserializedDimension = new Dimension(id, description, weight); + deserializedDimension.alwaysApplicable = alwaysApplicable; + return deserializedDimension; + }); + } + + /* + * Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. Provided by the user + * when manually creating a rubric evaluator or during human-in-the-loop review of a generated set; the generation + * pipeline produces an initial value the user can edit. Editable when saving new versions. + */ + @Generated + private final String id; + + /** + * Get the id property: Stable identifier for this dimension (snake_case, e.g., `correct_resolution`). Required. + * Provided by the user when manually creating a rubric evaluator or during human-in-the-loop review of a generated + * set; the generation pipeline produces an initial value the user can edit. Editable when saving new versions. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DispatchRoutineResult.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DispatchRoutineResult.java new file mode 100644 index 000000000000..39f2d6b22432 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/DispatchRoutineResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Identifiers returned after a routine dispatch is queued. + */ +@Immutable +public final class DispatchRoutineResult implements JsonSerializable { + + /* + * The dispatch identifier created for the routine dispatch. + */ + @Generated + private String dispatchId; + + /* + * A downstream action correlation identifier, when available. + */ + @Generated + private String actionCorrelationId; + + /* + * A workspace task identifier created for the dispatch, when available. + */ + @Generated + private String taskId; + + /** + * Creates an instance of DispatchRoutineResult class. + */ + @Generated + private DispatchRoutineResult() { + } + + /** + * Get the dispatchId property: The dispatch identifier created for the routine dispatch. + * + * @return the dispatchId value. + */ + @Generated + public String getDispatchId() { + return this.dispatchId; + } + + /** + * Get the actionCorrelationId property: A downstream action correlation identifier, when available. + * + * @return the actionCorrelationId value. + */ + @Generated + public String getActionCorrelationId() { + return this.actionCorrelationId; + } + + /** + * Get the taskId property: A workspace task identifier created for the dispatch, when available. + * + * @return the taskId value. + */ + @Generated + public String getTaskId() { + return this.taskId; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("dispatch_id", this.dispatchId); + jsonWriter.writeStringField("action_correlation_id", this.actionCorrelationId); + jsonWriter.writeStringField("task_id", this.taskId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DispatchRoutineResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DispatchRoutineResult 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 DispatchRoutineResult. + */ + @Generated + public static DispatchRoutineResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DispatchRoutineResult deserializedDispatchRoutineResult = new DispatchRoutineResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("dispatch_id".equals(fieldName)) { + deserializedDispatchRoutineResult.dispatchId = reader.getString(); + } else if ("action_correlation_id".equals(fieldName)) { + deserializedDispatchRoutineResult.actionCorrelationId = reader.getString(); + } else if ("task_id".equals(fieldName)) { + deserializedDispatchRoutineResult.taskId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedDispatchRoutineResult; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTask.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTask.java index ab92ef33ccf6..59d1228bfab7 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTask.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTask.java @@ -5,6 +5,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -33,7 +34,7 @@ public final class EvaluationScheduleTask extends ScheduleTask { * The evaluation run payload. */ @Generated - private final EvaluationScheduleTaskEvalRun evalRun; + private final Map evalRun; /** * Get the type property: Type of the task. @@ -62,7 +63,7 @@ public String getEvalId() { * @return the evalRun value. */ @Generated - public EvaluationScheduleTaskEvalRun getEvalRun() { + public Map getEvalRun() { return this.evalRun; } @@ -85,7 +86,13 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeMapField("configuration", getConfiguration(), (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("evalId", this.evalId); - jsonWriter.writeJsonField("evalRun", this.evalRun); + jsonWriter.writeMapField("evalRun", this.evalRun, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -104,7 +111,7 @@ public static EvaluationScheduleTask fromJson(JsonReader jsonReader) throws IOEx return jsonReader.readObject(reader -> { Map configuration = null; String evalId = null; - EvaluationScheduleTaskEvalRun evalRun = null; + Map evalRun = null; ScheduleTaskType type = ScheduleTaskType.EVALUATION; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -114,7 +121,8 @@ public static EvaluationScheduleTask fromJson(JsonReader jsonReader) throws IOEx } else if ("evalId".equals(fieldName)) { evalId = reader.getString(); } else if ("evalRun".equals(fieldName)) { - evalRun = EvaluationScheduleTaskEvalRun.fromJson(reader); + evalRun = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); } else if ("type".equals(fieldName)) { type = ScheduleTaskType.fromString(reader.getString()); } else { @@ -135,7 +143,7 @@ public static EvaluationScheduleTask fromJson(JsonReader jsonReader) throws IOEx * @param evalRun the evalRun value to set. */ @Generated - public EvaluationScheduleTask(String evalId, EvaluationScheduleTaskEvalRun evalRun) { + public EvaluationScheduleTask(String evalId, Map evalRun) { this.evalId = evalId; this.evalRun = evalRun; } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTaskEvalRun.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTaskEvalRun.java deleted file mode 100644 index 13f12e468e87..000000000000 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluationScheduleTaskEvalRun.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.projects.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The EvaluationScheduleTaskEvalRun model. - */ -@Immutable -public final class EvaluationScheduleTaskEvalRun implements JsonSerializable { - - /** - * Creates an instance of EvaluationScheduleTaskEvalRun class. - */ - @Generated - public EvaluationScheduleTaskEvalRun() { - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of EvaluationScheduleTaskEvalRun from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of EvaluationScheduleTaskEvalRun 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 EvaluationScheduleTaskEvalRun. - */ - @Generated - public static EvaluationScheduleTaskEvalRun fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - EvaluationScheduleTaskEvalRun deserializedEvaluationScheduleTaskEvalRun - = new EvaluationScheduleTaskEvalRun(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - reader.skipChildren(); - } - return deserializedEvaluationScheduleTaskEvalRun; - }); - } -} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorCredentialInput.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorCredentialInput.java new file mode 100644 index 000000000000..e291b7ada7fc --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorCredentialInput.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Request body for getting evaluator credentials. + */ +@Immutable +public final class EvaluatorCredentialInput implements JsonSerializable { + + /* + * The blob URI for the evaluator storage. Example: `https://account.blob.core.windows.net:443/container` + */ + @Generated + private final String blobUrl; + + /** + * Creates an instance of EvaluatorCredentialInput class. + * + * @param blobUrl the blobUrl value to set. + */ + @Generated + public EvaluatorCredentialInput(String blobUrl) { + this.blobUrl = blobUrl; + } + + /** + * Get the blobUrl property: The blob URI for the evaluator storage. Example: + * `https://account.blob.core.windows.net:443/container`. + * + * @return the blobUrl value. + */ + @Generated + public String getBlobUrl() { + return this.blobUrl; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("blob_uri", this.blobUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatorCredentialInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatorCredentialInput if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EvaluatorCredentialInput. + */ + @Generated + public static EvaluatorCredentialInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String blobUrl = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("blob_uri".equals(fieldName)) { + blobUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new EvaluatorCredentialInput(blobUrl); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinition.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinition.java index 8c9db84a7c82..95264c7257a9 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinition.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinition.java @@ -162,6 +162,8 @@ public static EvaluatorDefinition fromJson(JsonReader jsonReader) throws IOExcep return CodeBasedEvaluatorDefinition.fromJson(readerToUse.reset()); } else if ("prompt".equals(discriminatorValue)) { return PromptBasedEvaluatorDefinition.fromJson(readerToUse.reset()); + } else if ("rubric".equals(discriminatorValue)) { + return RubricBasedEvaluatorDefinition.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinitionType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinitionType.java index 9e2d5501690d..09caa1ddd4c0 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinitionType.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorDefinitionType.java @@ -72,4 +72,11 @@ public static EvaluatorDefinitionType fromString(String name) { public static Collection values() { return values(EvaluatorDefinitionType.class); } + + /** + * Rubric-based evaluator definition. Stores dimensions (the scoring blueprint) for both quality and safety + * evaluators. Can be created via the generate API or manually via createVersion. + */ + @Generated + public static final EvaluatorDefinitionType RUBRIC = fromString("rubric"); } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationArtifacts.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationArtifacts.java new file mode 100644 index 000000000000..67ffdbaf0f66 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationArtifacts.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Service-managed provenance artifacts produced by an evaluator generation job. Present only on EvaluatorVersion + * resources created via the generation pipeline. The combined-JSONL Foundry Dataset is read-only and resolves to a + * versioned dataset in a service-reserved namespace. + */ +@Immutable +public final class EvaluatorGenerationArtifacts implements JsonSerializable { + + /* + * Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to `EvaluatorVersion.version`) + * holding all artifacts produced by the generation pipeline. Each row in the JSONL carries a `kind` field + * discriminating its content (e.g. `spec`, `tools`, `context`). + */ + @Generated + private final DatasetReference dataset; + + /* + * The kinds of rows present in `dataset`. Always contains `"spec"` (the generated evaluation specification, a + * Markdown document describing what the evaluator measures). May additionally contain `"tools"` (when the + * generation pipeline produced or inferred OpenAI tool schemas) and/or `"context"` (when supplementary materials + * such as file uploads or trace samples were used during generation). + */ + @Generated + private final List kinds; + + /** + * Creates an instance of EvaluatorGenerationArtifacts class. + * + * @param dataset the dataset value to set. + * @param kinds the kinds value to set. + */ + @Generated + private EvaluatorGenerationArtifacts(DatasetReference dataset, List kinds) { + this.dataset = dataset; + this.kinds = kinds; + } + + /** + * Get the dataset property: Reference to the single Foundry Dataset (one combined JSONL file, version-aligned to + * `EvaluatorVersion.version`) holding all artifacts produced by the generation pipeline. Each row in the JSONL + * carries a `kind` field discriminating its content (e.g. `spec`, `tools`, `context`). + * + * @return the dataset value. + */ + @Generated + public DatasetReference getDataset() { + return this.dataset; + } + + /** + * Get the kinds property: The kinds of rows present in `dataset`. Always contains `"spec"` (the generated + * evaluation specification, a Markdown document describing what the evaluator measures). May additionally contain + * `"tools"` (when the generation pipeline produced or inferred OpenAI tool schemas) and/or `"context"` (when + * supplementary materials such as file uploads or trace samples were used during generation). + * + * @return the kinds value. + */ + @Generated + public List getKinds() { + return this.kinds; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("dataset", this.dataset); + jsonWriter.writeArrayField("kinds", this.kinds, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatorGenerationArtifacts from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatorGenerationArtifacts if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EvaluatorGenerationArtifacts. + */ + @Generated + public static EvaluatorGenerationArtifacts fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DatasetReference dataset = null; + List kinds = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("dataset".equals(fieldName)) { + dataset = DatasetReference.fromJson(reader); + } else if ("kinds".equals(fieldName)) { + kinds = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + return new EvaluatorGenerationArtifacts(dataset, kinds); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationInputs.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationInputs.java new file mode 100644 index 000000000000..ea557319a4a4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationInputs.java @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.util.List; + +/** + * Caller-supplied inputs for an evaluator generation job. + */ +@Fluent +public final class EvaluatorGenerationInputs implements JsonSerializable { + + /* + * Source materials for generation — agent descriptions, prompts, traces, or datasets. Each entry is an + * `EvaluatorGenerationJobSource` variant discriminated by `type`. + */ + @Generated + private final List sources; + + /* + * The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must provide their own model rather + * than relying on service-owned capacity. + */ + @Generated + private final String model; + + /* + * The evaluator name (immutable identifier). 1-256 characters; allowed characters are ASCII letters, digits, + * underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` is reserved for + * system-managed evaluators and is rejected by the service. If an evaluator with this name already exists in the + * project (and is rubric-subtype), the service creates a new version under the same name and uses the prior + * version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive loop). Old + * versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a rubric-subtype + * evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`. + */ + @Generated + private final String evaluatorName; + + /* + * Optional human-friendly display name for the resulting evaluator. Surfaced as `EvaluatorVersion.display_name` on + * the persisted evaluator. When omitted, the service uses `evaluator_name` as the display name. The `evaluator_` + * prefix disambiguates this from the immutable `evaluator_name` identifier. + */ + @Generated + private String evaluatorDisplayName; + + /* + * Optional human-friendly description for the resulting evaluator. Surfaced as `EvaluatorVersion.description` on + * the persisted evaluator. Typically collected from the UI alongside `evaluator_display_name`. The `evaluator_` + * prefix disambiguates this from any other description fields on related models. + */ + @Generated + private String evaluatorDescription; + + /** + * Creates an instance of EvaluatorGenerationInputs class. + * + * @param sources the sources value to set. + * @param model the model value to set. + * @param evaluatorName the evaluatorName value to set. + */ + @Generated + public EvaluatorGenerationInputs(List sources, String model, String evaluatorName) { + this.sources = sources; + this.model = model; + this.evaluatorName = evaluatorName; + } + + /** + * Get the sources property: Source materials for generation — agent descriptions, prompts, traces, or datasets. + * Each entry is an `EvaluatorGenerationJobSource` variant discriminated by `type`. + * + * @return the sources value. + */ + @Generated + public List getSources() { + return this.sources; + } + + /** + * Get the model property: The LLM model to use for rubric generation (e.g., 'gpt-4o'). Required — users must + * provide their own model rather than relying on service-owned capacity. + * + * @return the model value. + */ + @Generated + public String getModel() { + return this.model; + } + + /** + * Get the evaluatorName property: The evaluator name (immutable identifier). 1-256 characters; allowed characters + * are ASCII letters, digits, underscore (`_`), period (`.`), tilde (`~`), and hyphen (`-`). The prefix `builtin.` + * is reserved for system-managed evaluators and is rejected by the service. If an evaluator with this name already + * exists in the project (and is rubric-subtype), the service creates a new version under the same name and uses the + * prior version's `dimensions` as context for incremental improvement (foundation of the post-//build adaptive + * loop). Old versions remain queryable via `get_version(name, version)`. If the existing evaluator is not a + * rubric-subtype evaluator (built-in, prompt-based, code-based), the request is rejected with `400 Bad Request`. + * + * @return the evaluatorName value. + */ + @Generated + public String getEvaluatorName() { + return this.evaluatorName; + } + + /** + * Get the evaluatorDisplayName property: Optional human-friendly display name for the resulting evaluator. Surfaced + * as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as + * the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier. + * + * @return the evaluatorDisplayName value. + */ + @Generated + public String getEvaluatorDisplayName() { + return this.evaluatorDisplayName; + } + + /** + * Set the evaluatorDisplayName property: Optional human-friendly display name for the resulting evaluator. Surfaced + * as `EvaluatorVersion.display_name` on the persisted evaluator. When omitted, the service uses `evaluator_name` as + * the display name. The `evaluator_` prefix disambiguates this from the immutable `evaluator_name` identifier. + * + * @param evaluatorDisplayName the evaluatorDisplayName value to set. + * @return the EvaluatorGenerationInputs object itself. + */ + @Generated + public EvaluatorGenerationInputs setEvaluatorDisplayName(String evaluatorDisplayName) { + this.evaluatorDisplayName = evaluatorDisplayName; + return this; + } + + /** + * Get the evaluatorDescription property: Optional human-friendly description for the resulting evaluator. Surfaced + * as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside + * `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related + * models. + * + * @return the evaluatorDescription value. + */ + @Generated + public String getEvaluatorDescription() { + return this.evaluatorDescription; + } + + /** + * Set the evaluatorDescription property: Optional human-friendly description for the resulting evaluator. Surfaced + * as `EvaluatorVersion.description` on the persisted evaluator. Typically collected from the UI alongside + * `evaluator_display_name`. The `evaluator_` prefix disambiguates this from any other description fields on related + * models. + * + * @param evaluatorDescription the evaluatorDescription value to set. + * @return the EvaluatorGenerationInputs object itself. + */ + @Generated + public EvaluatorGenerationInputs setEvaluatorDescription(String evaluatorDescription) { + this.evaluatorDescription = evaluatorDescription; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("model", this.model); + jsonWriter.writeStringField("evaluator_name", this.evaluatorName); + jsonWriter.writeStringField("evaluator_display_name", this.evaluatorDisplayName); + jsonWriter.writeStringField("evaluator_description", this.evaluatorDescription); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatorGenerationInputs from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatorGenerationInputs if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EvaluatorGenerationInputs. + */ + @Generated + public static EvaluatorGenerationInputs fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + List sources = null; + String model = null; + String evaluatorName = null; + String evaluatorDisplayName = null; + String evaluatorDescription = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("sources".equals(fieldName)) { + sources = reader.readArray(reader1 -> EvaluatorGenerationJobSource.fromJson(reader1)); + } else if ("model".equals(fieldName)) { + model = reader.getString(); + } else if ("evaluator_name".equals(fieldName)) { + evaluatorName = reader.getString(); + } else if ("evaluator_display_name".equals(fieldName)) { + evaluatorDisplayName = reader.getString(); + } else if ("evaluator_description".equals(fieldName)) { + evaluatorDescription = reader.getString(); + } else { + reader.skipChildren(); + } + } + EvaluatorGenerationInputs deserializedEvaluatorGenerationInputs + = new EvaluatorGenerationInputs(sources, model, evaluatorName); + deserializedEvaluatorGenerationInputs.evaluatorDisplayName = evaluatorDisplayName; + deserializedEvaluatorGenerationInputs.evaluatorDescription = evaluatorDescription; + return deserializedEvaluatorGenerationInputs; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJob.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJob.java new file mode 100644 index 000000000000..79f7bd26a96f --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJob.java @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Evaluator Generation Job resource — a long-running job that generates rubric-based evaluator definitions from source + * materials. On success, the result is the persisted EvaluatorVersion. + */ +@Fluent +public final class EvaluatorGenerationJob implements JsonSerializable { + + /* + * Server-assigned unique identifier. + */ + @Generated + private String id; + + /* + * Caller-supplied inputs. + */ + @Generated + private EvaluatorGenerationInputs inputs; + + /* + * Result produced on success. + */ + @Generated + private EvaluatorVersion result; + + /* + * Current lifecycle status. + */ + @Generated + private JobStatus status; + + /* + * Error details — populated only on failure. + */ + @Generated + private ApiError error; + + /* + * The timestamp when the job was created, represented in Unix time (seconds since January 1, 1970). + */ + @Generated + private long createdAt; + + /* + * The timestamp when the job finished, represented in Unix time (seconds since January 1, 1970). + */ + @Generated + private Long finishedAt; + + /* + * Token consumption summary. Populated when the job reaches a terminal state. + */ + @Generated + private EvaluatorGenerationTokenUsage usage; + + /** + * Creates an instance of EvaluatorGenerationJob class. + */ + @Generated + public EvaluatorGenerationJob() { + } + + /** + * Get the id property: Server-assigned unique identifier. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the inputs property: Caller-supplied inputs. + * + * @return the inputs value. + */ + @Generated + public EvaluatorGenerationInputs getInputs() { + return this.inputs; + } + + /** + * Set the inputs property: Caller-supplied inputs. + * + * @param inputs the inputs value to set. + * @return the EvaluatorGenerationJob object itself. + */ + @Generated + public EvaluatorGenerationJob setInputs(EvaluatorGenerationInputs inputs) { + this.inputs = inputs; + return this; + } + + /** + * Get the result property: Result produced on success. + * + * @return the result value. + */ + @Generated + public EvaluatorVersion getResult() { + return this.result; + } + + /** + * Get the status property: Current lifecycle status. + * + * @return the status value. + */ + @Generated + public JobStatus getStatus() { + return this.status; + } + + /** + * Get the error property: Error details — populated only on failure. + * + * @return the error value. + */ + @Generated + public ApiError getError() { + return this.error; + } + + /** + * Get the createdAt property: The timestamp when the job was created, represented in Unix time (seconds since + * January 1, 1970). + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the finishedAt property: The timestamp when the job finished, represented in Unix time (seconds since January + * 1, 1970). + * + * @return the finishedAt value. + */ + @Generated + public OffsetDateTime getFinishedAt() { + if (this.finishedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.finishedAt), ZoneOffset.UTC); + } + + /** + * Get the usage property: Token consumption summary. Populated when the job reaches a terminal state. + * + * @return the usage value. + */ + @Generated + public EvaluatorGenerationTokenUsage getUsage() { + return this.usage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("inputs", this.inputs); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatorGenerationJob from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatorGenerationJob if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EvaluatorGenerationJob. + */ + @Generated + public static EvaluatorGenerationJob fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EvaluatorGenerationJob deserializedEvaluatorGenerationJob = new EvaluatorGenerationJob(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedEvaluatorGenerationJob.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedEvaluatorGenerationJob.status = JobStatus.fromString(reader.getString()); + } else if ("created_at".equals(fieldName)) { + deserializedEvaluatorGenerationJob.createdAt = reader.getLong(); + } else if ("inputs".equals(fieldName)) { + deserializedEvaluatorGenerationJob.inputs = EvaluatorGenerationInputs.fromJson(reader); + } else if ("result".equals(fieldName)) { + deserializedEvaluatorGenerationJob.result = EvaluatorVersion.fromJson(reader); + } else if ("error".equals(fieldName)) { + deserializedEvaluatorGenerationJob.error = ApiError.fromJson(reader); + } else if ("finished_at".equals(fieldName)) { + deserializedEvaluatorGenerationJob.finishedAt = reader.getNullable(JsonReader::getLong); + } else if ("usage".equals(fieldName)) { + deserializedEvaluatorGenerationJob.usage = EvaluatorGenerationTokenUsage.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedEvaluatorGenerationJob; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParam.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSource.java similarity index 55% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParam.java rename to sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSource.java index 31a9126d1247..e777f2b081a7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ApplyPatchOperationParam.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSource.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.projects.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,33 +12,32 @@ import java.io.IOException; /** - * Apply patch operation - * - * One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool. + * The base source model for evaluator generation jobs. Polymorphic over `type`. */ @Immutable -public class ApplyPatchOperationParam implements JsonSerializable { +public class EvaluatorGenerationJobSource implements JsonSerializable { /* - * The type property. + * The type of source. */ @Generated - private ApplyPatchOperationParamType type = ApplyPatchOperationParamType.fromString("ApplyPatchOperationParam"); + private EvaluatorGenerationJobSourceType type + = EvaluatorGenerationJobSourceType.fromString("EvaluatorGenerationJobSource"); /** - * Creates an instance of ApplyPatchOperationParam class. + * Creates an instance of EvaluatorGenerationJobSource class. */ @Generated - public ApplyPatchOperationParam() { + public EvaluatorGenerationJobSource() { } /** - * Get the type property: The type property. + * Get the type property: The type of source. * * @return the type value. */ @Generated - public ApplyPatchOperationParamType getType() { + public EvaluatorGenerationJobSourceType getType() { return this.type; } @@ -54,15 +53,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ApplyPatchOperationParam from the JsonReader. + * Reads an instance of EvaluatorGenerationJobSource from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ApplyPatchOperationParam 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 ApplyPatchOperationParam. + * @return An instance of EvaluatorGenerationJobSource 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 EvaluatorGenerationJobSource. */ @Generated - public static ApplyPatchOperationParam fromJson(JsonReader jsonReader) throws IOException { + public static EvaluatorGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -79,12 +78,14 @@ public static ApplyPatchOperationParam fromJson(JsonReader jsonReader) throws IO } } // Use the discriminator value to determine which subtype should be deserialized. - if ("create_file".equals(discriminatorValue)) { - return ApplyPatchCreateFileOperationParam.fromJson(readerToUse.reset()); - } else if ("delete_file".equals(discriminatorValue)) { - return ApplyPatchDeleteFileOperationParam.fromJson(readerToUse.reset()); - } else if ("update_file".equals(discriminatorValue)) { - return ApplyPatchUpdateFileOperationParam.fromJson(readerToUse.reset()); + if ("prompt".equals(discriminatorValue)) { + return PromptEvaluatorGenerationJobSource.fromJson(readerToUse.reset()); + } else if ("agent".equals(discriminatorValue)) { + return AgentEvaluatorGenerationJobSource.fromJson(readerToUse.reset()); + } else if ("traces".equals(discriminatorValue)) { + return TracesEvaluatorGenerationJobSource.fromJson(readerToUse.reset()); + } else if ("dataset".equals(discriminatorValue)) { + return DatasetEvaluatorGenerationJobSource.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -93,20 +94,20 @@ public static ApplyPatchOperationParam fromJson(JsonReader jsonReader) throws IO } @Generated - static ApplyPatchOperationParam fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static EvaluatorGenerationJobSource fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ApplyPatchOperationParam deserializedApplyPatchOperationParam = new ApplyPatchOperationParam(); + EvaluatorGenerationJobSource deserializedEvaluatorGenerationJobSource = new EvaluatorGenerationJobSource(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedApplyPatchOperationParam.type - = ApplyPatchOperationParamType.fromString(reader.getString()); + deserializedEvaluatorGenerationJobSource.type + = EvaluatorGenerationJobSourceType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedApplyPatchOperationParam; + return deserializedEvaluatorGenerationJobSource; }); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSourceType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSourceType.java new file mode 100644 index 000000000000..b49a6f230215 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSourceType.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported source types for evaluator generation jobs. + */ +public final class EvaluatorGenerationJobSourceType extends ExpandableStringEnum { + + /** + * Prompt source — inline text provided by the user. + */ + @Generated + public static final EvaluatorGenerationJobSourceType PROMPT = fromString("prompt"); + + /** + * Agent source — references an agent to fetch instructions and metadata from. + */ + @Generated + public static final EvaluatorGenerationJobSourceType AGENT = fromString("agent"); + + /** + * Traces source — conversation traces from Application Insights. + */ + @Generated + public static final EvaluatorGenerationJobSourceType TRACES = fromString("traces"); + + /** + * Dataset source — reference to a dataset. + */ + @Generated + public static final EvaluatorGenerationJobSourceType DATASET = fromString("dataset"); + + /** + * Creates a new instance of EvaluatorGenerationJobSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public EvaluatorGenerationJobSourceType() { + } + + /** + * Creates or finds a EvaluatorGenerationJobSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding EvaluatorGenerationJobSourceType. + */ + @Generated + public static EvaluatorGenerationJobSourceType fromString(String name) { + return fromString(name, EvaluatorGenerationJobSourceType.class); + } + + /** + * Gets known EvaluatorGenerationJobSourceType values. + * + * @return known EvaluatorGenerationJobSourceType values. + */ + @Generated + public static Collection values() { + return values(EvaluatorGenerationJobSourceType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationTokenUsage.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationTokenUsage.java new file mode 100644 index 000000000000..1b797124a860 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorGenerationTokenUsage.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Token consumption summary for an evaluator generation job. Populated when the job reaches a terminal state. + */ +@Immutable +public final class EvaluatorGenerationTokenUsage implements JsonSerializable { + + /* + * Number of input (prompt) tokens consumed. + */ + @Generated + private final long inputTokens; + + /* + * Number of output (completion) tokens generated. + */ + @Generated + private final long outputTokens; + + /* + * Total tokens consumed (input + output). + */ + @Generated + private final long totalTokens; + + /** + * Creates an instance of EvaluatorGenerationTokenUsage class. + * + * @param inputTokens the inputTokens value to set. + * @param outputTokens the outputTokens value to set. + * @param totalTokens the totalTokens value to set. + */ + @Generated + private EvaluatorGenerationTokenUsage(long inputTokens, long outputTokens, long totalTokens) { + this.inputTokens = inputTokens; + this.outputTokens = outputTokens; + this.totalTokens = totalTokens; + } + + /** + * Get the inputTokens property: Number of input (prompt) tokens consumed. + * + * @return the inputTokens value. + */ + @Generated + public long getInputTokens() { + return this.inputTokens; + } + + /** + * Get the outputTokens property: Number of output (completion) tokens generated. + * + * @return the outputTokens value. + */ + @Generated + public long getOutputTokens() { + return this.outputTokens; + } + + /** + * Get the totalTokens property: Total tokens consumed (input + output). + * + * @return the totalTokens value. + */ + @Generated + public long getTotalTokens() { + return this.totalTokens; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("input_tokens", this.inputTokens); + jsonWriter.writeLongField("output_tokens", this.outputTokens); + jsonWriter.writeLongField("total_tokens", this.totalTokens); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EvaluatorGenerationTokenUsage from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EvaluatorGenerationTokenUsage if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the EvaluatorGenerationTokenUsage. + */ + @Generated + public static EvaluatorGenerationTokenUsage fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + long inputTokens = 0L; + long outputTokens = 0L; + long totalTokens = 0L; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("input_tokens".equals(fieldName)) { + inputTokens = reader.getLong(); + } else if ("output_tokens".equals(fieldName)) { + outputTokens = reader.getLong(); + } else if ("total_tokens".equals(fieldName)) { + totalTokens = reader.getLong(); + } else { + reader.skipChildren(); + } + } + return new EvaluatorGenerationTokenUsage(inputTokens, outputTokens, totalTokens); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorVersion.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorVersion.java index 025fb0f18566..678deb89fc14 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorVersion.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/EvaluatorVersion.java @@ -335,6 +335,7 @@ public static EvaluatorVersion fromJson(JsonReader jsonReader) throws IOExceptio String version = null; String displayName = null; Map metadata = null; + EvaluatorGenerationArtifacts generationArtifacts = null; String id = null; String description = null; Map tags = null; @@ -363,6 +364,8 @@ public static EvaluatorVersion fromJson(JsonReader jsonReader) throws IOExceptio displayName = reader.getString(); } else if ("metadata".equals(fieldName)) { metadata = reader.readMap(reader1 -> reader1.getString()); + } else if ("generation_artifacts".equals(fieldName)) { + generationArtifacts = EvaluatorGenerationArtifacts.fromJson(reader); } else if ("id".equals(fieldName)) { id = reader.getString(); } else if ("description".equals(fieldName)) { @@ -381,10 +384,30 @@ public static EvaluatorVersion fromJson(JsonReader jsonReader) throws IOExceptio deserializedEvaluatorVersion.version = version; deserializedEvaluatorVersion.displayName = displayName; deserializedEvaluatorVersion.metadata = metadata; + deserializedEvaluatorVersion.generationArtifacts = generationArtifacts; deserializedEvaluatorVersion.id = id; deserializedEvaluatorVersion.description = description; deserializedEvaluatorVersion.tags = tags; return deserializedEvaluatorVersion; }); } + + /* + * Provenance artifacts from the generation pipeline. Read-only; present only on evaluator versions created via an + * EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry Dataset. + */ + @Generated + private EvaluatorGenerationArtifacts generationArtifacts; + + /** + * Get the generationArtifacts property: Provenance artifacts from the generation pipeline. Read-only; present only + * on evaluator versions created via an EvaluatorGenerationJob. Each artifact resolves to a versioned Foundry + * Dataset. + * + * @return the generationArtifacts value. + */ + @Generated + public EvaluatorGenerationArtifacts getGenerationArtifacts() { + return this.generationArtifacts; + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FileDataGenerationJobOutput.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FileDataGenerationJobOutput.java new file mode 100644 index 000000000000..40657f9017d9 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FileDataGenerationJobOutput.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +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; + +/** + * Azure OpenAI file output for a data generation job. + */ +@Immutable +public final class FileDataGenerationJobOutput extends DataGenerationJobOutput { + + /* + * The type of the output. + */ + @Generated + private DataGenerationJobOutputType type = DataGenerationJobOutputType.FILE; + + /* + * The id of the output Azure OpenAI file. + */ + @Generated + private String id; + + /* + * The filename of the output Azure OpenAI file. + */ + @Generated + private String filename; + + /** + * Creates an instance of FileDataGenerationJobOutput class. + */ + @Generated + private FileDataGenerationJobOutput() { + } + + /** + * Get the type property: The type of the output. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobOutputType getType() { + return this.type; + } + + /** + * Get the id property: The id of the output Azure OpenAI file. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the filename property: The filename of the output Azure OpenAI file. + * + * @return the filename value. + */ + @Generated + public String getFilename() { + return this.filename; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileDataGenerationJobOutput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileDataGenerationJobOutput if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileDataGenerationJobOutput. + */ + @Generated + public static FileDataGenerationJobOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FileDataGenerationJobOutput deserializedFileDataGenerationJobOutput = new FileDataGenerationJobOutput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedFileDataGenerationJobOutput.id = reader.getString(); + } else if ("filename".equals(fieldName)) { + deserializedFileDataGenerationJobOutput.filename = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFileDataGenerationJobOutput.type + = DataGenerationJobOutputType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedFileDataGenerationJobOutput; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FileDataGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FileDataGenerationJobSource.java new file mode 100644 index 000000000000..f11d9c33ac42 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FileDataGenerationJobSource.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * File source for data generation jobs — Azure OpenAI file input. + */ +@Fluent +public final class FileDataGenerationJobSource extends DataGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private DataGenerationJobSourceType type = DataGenerationJobSourceType.FILE; + + /* + * Input Azure Open AI file id used for data generation. + */ + @Generated + private final String id; + + /** + * Creates an instance of FileDataGenerationJobSource class. + * + * @param id the id value to set. + */ + @Generated + public FileDataGenerationJobSource(String id) { + this.id = id; + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the id property: Input Azure Open AI file id used for data generation. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public FileDataGenerationJobSource setDescription(String description) { + super.setDescription(description); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", getDescription()); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FileDataGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FileDataGenerationJobSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FileDataGenerationJobSource. + */ + @Generated + public static FileDataGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String description = null; + String id = null; + DataGenerationJobSourceType type = DataGenerationJobSourceType.FILE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobSourceType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + FileDataGenerationJobSource deserializedFileDataGenerationJobSource = new FileDataGenerationJobSource(id); + deserializedFileDataGenerationJobSource.setDescription(description); + deserializedFileDataGenerationJobSource.type = type; + return deserializedFileDataGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java index c7115b27daec..78b225e0fa57 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java @@ -33,6 +33,11 @@ public enum FoundryFeaturesOptInKeys { */ MEMORY_STORES_V1_PREVIEW("MemoryStores=V1Preview"), + /** + * Enum value Routines=V1Preview. + */ + ROUTINES_V1_PREVIEW("Routines=V1Preview"), + /** * Enum value Toolboxes=V1Preview. */ @@ -41,7 +46,22 @@ public enum FoundryFeaturesOptInKeys { /** * Enum value Skills=V1Preview. */ - SKILLS_V1_PREVIEW("Skills=V1Preview"); + SKILLS_V1_PREVIEW("Skills=V1Preview"), + + /** + * Enum value DataGenerationJobs=V1Preview. + */ + DATA_GENERATION_JOBS_V1_PREVIEW("DataGenerationJobs=V1Preview"), + + /** + * Enum value Models=V1Preview. + */ + MODELS_V1_PREVIEW("Models=V1Preview"), + + /** + * Enum value AgentsOptimization=V1Preview. + */ + AGENTS_OPTIMIZATION_V1_PREVIEW("AgentsOptimization=V1Preview"); /** * The actual serialized value for a FoundryFeaturesOptInKeys instance. diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileCategory.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileCategory.java new file mode 100644 index 000000000000..6c2a934cc4b2 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileCategory.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The artifact profile category. + */ +public final class FoundryModelArtifactProfileCategory + extends ExpandableStringEnum { + + /** + * Data only artifacts. + */ + @Generated + public static final FoundryModelArtifactProfileCategory DATA_ONLY = fromString("DataOnly"); + + /** + * Runtime dependent artifacts. + */ + @Generated + public static final FoundryModelArtifactProfileCategory RUNTIME_DEPENDENT = fromString("RuntimeDependent"); + + /** + * Unknown category. + */ + @Generated + public static final FoundryModelArtifactProfileCategory UNKNOWN = fromString("Unknown"); + + /** + * Creates a new instance of FoundryModelArtifactProfileCategory value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FoundryModelArtifactProfileCategory() { + } + + /** + * Creates or finds a FoundryModelArtifactProfileCategory from its string representation. + * + * @param name a name to look for. + * @return the corresponding FoundryModelArtifactProfileCategory. + */ + @Generated + public static FoundryModelArtifactProfileCategory fromString(String name) { + return fromString(name, FoundryModelArtifactProfileCategory.class); + } + + /** + * Gets known FoundryModelArtifactProfileCategory values. + * + * @return known FoundryModelArtifactProfileCategory values. + */ + @Generated + public static Collection values() { + return values(FoundryModelArtifactProfileCategory.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileSignal.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileSignal.java new file mode 100644 index 000000000000..01b80bd68b49 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileSignal.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Signals detected in the model artifact. + */ +public final class FoundryModelArtifactProfileSignal extends ExpandableStringEnum { + + /** + * Pickle deserialization detected. + */ + @Generated + public static final FoundryModelArtifactProfileSignal PICKLE_DESERIALIZATION = fromString("PickleDeserialization"); + + /** + * Custom Python code detected. + */ + @Generated + public static final FoundryModelArtifactProfileSignal CUSTOM_PYTHON_CODE = fromString("CustomPythonCode"); + + /** + * Dynamic operations detected. + */ + @Generated + public static final FoundryModelArtifactProfileSignal DYNAMIC_OPS = fromString("DynamicOps"); + + /** + * Native binary code detected. + */ + @Generated + public static final FoundryModelArtifactProfileSignal NATIVE_BINARY = fromString("NativeBinary"); + + /** + * Unknown format detected. + */ + @Generated + public static final FoundryModelArtifactProfileSignal UNKNOWN_FORMAT = fromString("UnknownFormat"); + + /** + * Creates a new instance of FoundryModelArtifactProfileSignal value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FoundryModelArtifactProfileSignal() { + } + + /** + * Creates or finds a FoundryModelArtifactProfileSignal from its string representation. + * + * @param name a name to look for. + * @return the corresponding FoundryModelArtifactProfileSignal. + */ + @Generated + public static FoundryModelArtifactProfileSignal fromString(String name) { + return fromString(name, FoundryModelArtifactProfileSignal.class); + } + + /** + * Gets known FoundryModelArtifactProfileSignal values. + * + * @return known FoundryModelArtifactProfileSignal values. + */ + @Generated + public static Collection values() { + return values(FoundryModelArtifactProfileSignal.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelSourceType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelSourceType.java new file mode 100644 index 000000000000..c79bef767a14 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelSourceType.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.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The source type of the model. + */ +public final class FoundryModelSourceType extends ExpandableStringEnum { + + /** + * Model was uploaded locally. + */ + @Generated + public static final FoundryModelSourceType LOCAL_UPLOAD = fromString("LocalUpload"); + + /** + * Model was produced by a training job. + */ + @Generated + public static final FoundryModelSourceType TRAINING_JOB = fromString("TrainingJob"); + + /** + * Creates a new instance of FoundryModelSourceType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FoundryModelSourceType() { + } + + /** + * Creates or finds a FoundryModelSourceType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FoundryModelSourceType. + */ + @Generated + public static FoundryModelSourceType fromString(String name) { + return fromString(name, FoundryModelSourceType.class); + } + + /** + * Gets known FoundryModelSourceType values. + * + * @return known FoundryModelSourceType values. + */ + @Generated + public static Collection values() { + return values(FoundryModelSourceType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWarning.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWarning.java new file mode 100644 index 000000000000..5c0b04039d1e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWarning.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A warning associated with a model. + */ +@Immutable +public final class FoundryModelWarning implements JsonSerializable { + + /* + * The warning code. + */ + @Generated + private FoundryModelWarningCode code; + + /* + * The warning message. + */ + @Generated + private String message; + + /** + * Creates an instance of FoundryModelWarning class. + */ + @Generated + private FoundryModelWarning() { + } + + /** + * Get the code property: The warning code. + * + * @return the code value. + */ + @Generated + public FoundryModelWarningCode getCode() { + return this.code; + } + + /** + * Get the message property: The warning message. + * + * @return the message value. + */ + @Generated + public String getMessage() { + return this.message; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("code", this.code == null ? null : this.code.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FoundryModelWarning from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FoundryModelWarning 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 FoundryModelWarning. + */ + @Generated + public static FoundryModelWarning fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FoundryModelWarning deserializedFoundryModelWarning = new FoundryModelWarning(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("code".equals(fieldName)) { + deserializedFoundryModelWarning.code = FoundryModelWarningCode.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedFoundryModelWarning.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedFoundryModelWarning; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWarningCode.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWarningCode.java new file mode 100644 index 000000000000..b9aa173abd32 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWarningCode.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.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Warning code for model artifacts. + */ +public final class FoundryModelWarningCode extends ExpandableStringEnum { + + /** + * Runtime dependent artifact warning. + */ + @Generated + public static final FoundryModelWarningCode RUNTIME_DEPENDENT_ARTIFACT = fromString("RuntimeDependentArtifact"); + + /** + * Unclassified artifact warning. + */ + @Generated + public static final FoundryModelWarningCode UNCLASSIFIED_ARTIFACT = fromString("UnclassifiedArtifact"); + + /** + * Creates a new instance of FoundryModelWarningCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FoundryModelWarningCode() { + } + + /** + * Creates or finds a FoundryModelWarningCode from its string representation. + * + * @param name a name to look for. + * @return the corresponding FoundryModelWarningCode. + */ + @Generated + public static FoundryModelWarningCode fromString(String name) { + return fromString(name, FoundryModelWarningCode.class); + } + + /** + * Gets known FoundryModelWarningCode values. + * + * @return known FoundryModelWarningCode values. + */ + @Generated + public static Collection values() { + return values(FoundryModelWarningCode.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWeightType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWeightType.java new file mode 100644 index 000000000000..d22653d4cc96 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/FoundryModelWeightType.java @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The weight type of the model. + */ +public final class FoundryModelWeightType extends ExpandableStringEnum { + + /** + * Full weight model. + */ + @Generated + public static final FoundryModelWeightType FULL_WEIGHT = fromString("FullWeight"); + + /** + * LoRA adapter weights. + */ + @Generated + public static final FoundryModelWeightType LO_RA = fromString("LoRA"); + + /** + * Draft model weights. + */ + @Generated + public static final FoundryModelWeightType DRAFT_MODEL = fromString("DraftModel"); + + /** + * Creates a new instance of FoundryModelWeightType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public FoundryModelWeightType() { + } + + /** + * Creates or finds a FoundryModelWeightType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FoundryModelWeightType. + */ + @Generated + public static FoundryModelWeightType fromString(String name) { + return fromString(name, FoundryModelWeightType.class); + } + + /** + * Gets known FoundryModelWeightType values. + * + * @return known FoundryModelWeightType values. + */ + @Generated + public static Collection values() { + return values(FoundryModelWeightType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GitHubIssueEvent.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GitHubIssueEvent.java new file mode 100644 index 000000000000..0833cc634234 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GitHubIssueEvent.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.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Known GitHub issue events that can fire a routine. + */ +public final class GitHubIssueEvent extends ExpandableStringEnum { + + /** + * The routine fires when a GitHub issue is opened. + */ + @Generated + public static final GitHubIssueEvent OPENED = fromString("opened"); + + /** + * The routine fires when a GitHub issue is closed. + */ + @Generated + public static final GitHubIssueEvent CLOSED = fromString("closed"); + + /** + * Creates a new instance of GitHubIssueEvent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public GitHubIssueEvent() { + } + + /** + * Creates or finds a GitHubIssueEvent from its string representation. + * + * @param name a name to look for. + * @return the corresponding GitHubIssueEvent. + */ + @Generated + public static GitHubIssueEvent fromString(String name) { + return fromString(name, GitHubIssueEvent.class); + } + + /** + * Gets known GitHubIssueEvent values. + * + * @return known GitHubIssueEvent values. + */ + @Generated + public static Collection values() { + return values(GitHubIssueEvent.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GitHubIssueRoutineTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GitHubIssueRoutineTrigger.java new file mode 100644 index 000000000000..333b5277a6a6 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GitHubIssueRoutineTrigger.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +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; + +/** + * A GitHub issue routine trigger. + */ +@Immutable +public final class GitHubIssueRoutineTrigger extends RoutineTrigger { + + /* + * The trigger type. + */ + @Generated + private RoutineTriggerType type = RoutineTriggerType.GITHUB_ISSUE; + + /* + * The workspace connection identifier that resolves the GitHub configuration for the trigger. + */ + @Generated + private final String connectionId; + + /* + * The GitHub owner or organization that scopes which issues can fire the trigger. + */ + @Generated + private final String owner; + + /* + * The GitHub repository filter that scopes which issues can fire the trigger. + */ + @Generated + private final String repository; + + /* + * The GitHub issue event that fires the routine. + */ + @Generated + private final GitHubIssueEvent issueEvent; + + /** + * Creates an instance of GitHubIssueRoutineTrigger class. + * + * @param connectionId the connectionId value to set. + * @param owner the owner value to set. + * @param repository the repository value to set. + * @param issueEvent the issueEvent value to set. + */ + @Generated + public GitHubIssueRoutineTrigger(String connectionId, String owner, String repository, + GitHubIssueEvent issueEvent) { + this.connectionId = connectionId; + this.owner = owner; + this.repository = repository; + this.issueEvent = issueEvent; + } + + /** + * Get the type property: The trigger type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineTriggerType getType() { + return this.type; + } + + /** + * Get the connectionId property: The workspace connection identifier that resolves the GitHub configuration for the + * trigger. + * + * @return the connectionId value. + */ + @Generated + public String getConnectionId() { + return this.connectionId; + } + + /** + * Get the owner property: The GitHub owner or organization that scopes which issues can fire the trigger. + * + * @return the owner value. + */ + @Generated + public String getOwner() { + return this.owner; + } + + /** + * Get the repository property: The GitHub repository filter that scopes which issues can fire the trigger. + * + * @return the repository value. + */ + @Generated + public String getRepository() { + return this.repository; + } + + /** + * Get the issueEvent property: The GitHub issue event that fires the routine. + * + * @return the issueEvent value. + */ + @Generated + public GitHubIssueEvent getIssueEvent() { + return this.issueEvent; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("connection_id", this.connectionId); + jsonWriter.writeStringField("owner", this.owner); + jsonWriter.writeStringField("repository", this.repository); + jsonWriter.writeStringField("issue_event", this.issueEvent == null ? null : this.issueEvent.toString()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GitHubIssueRoutineTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GitHubIssueRoutineTrigger if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GitHubIssueRoutineTrigger. + */ + @Generated + public static GitHubIssueRoutineTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String connectionId = null; + String owner = null; + String repository = null; + GitHubIssueEvent issueEvent = null; + RoutineTriggerType type = RoutineTriggerType.GITHUB_ISSUE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("connection_id".equals(fieldName)) { + connectionId = reader.getString(); + } else if ("owner".equals(fieldName)) { + owner = reader.getString(); + } else if ("repository".equals(fieldName)) { + repository = reader.getString(); + } else if ("issue_event".equals(fieldName)) { + issueEvent = GitHubIssueEvent.fromString(reader.getString()); + } else if ("type".equals(fieldName)) { + type = RoutineTriggerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + GitHubIssueRoutineTrigger deserializedGitHubIssueRoutineTrigger + = new GitHubIssueRoutineTrigger(connectionId, owner, repository, issueEvent); + deserializedGitHubIssueRoutineTrigger.type = type; + return deserializedGitHubIssueRoutineTrigger; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GraderAzureAIEvaluator.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GraderAzureAIEvaluator.java new file mode 100644 index 000000000000..738addff1130 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/GraderAzureAIEvaluator.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * Grader Azure AI Evaluator definition for foundry evaluators. + */ +@Fluent +public final class GraderAzureAIEvaluator implements JsonSerializable { + + /* + * The object type, which is always `azure_ai_evaluator`. + */ + @Generated + private final String type = "azure_ai_evaluator"; + + /* + * The name of the grader. + */ + @Generated + private final String name; + + /* + * The name of the evaluator. + */ + @Generated + private final String evaluatorName; + + /* + * The version of the evaluator. Latest version if not specified. + */ + @Generated + private String evaluatorVersion; + + /* + * The initialization parameters for the evaluation. Must support structured outputs. + */ + @Generated + private Map initializationParameters; + + /* + * The model to use for the evaluation. Must support structured outputs. + */ + @Generated + private Map dataMapping; + + /** + * Creates an instance of GraderAzureAIEvaluator class. + * + * @param name the name value to set. + * @param evaluatorName the evaluatorName value to set. + */ + @Generated + public GraderAzureAIEvaluator(String name, String evaluatorName) { + this.name = name; + this.evaluatorName = evaluatorName; + } + + /** + * Get the type property: The object type, which is always `azure_ai_evaluator`. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the name property: The name of the grader. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the evaluatorName property: The name of the evaluator. + * + * @return the evaluatorName value. + */ + @Generated + public String getEvaluatorName() { + return this.evaluatorName; + } + + /** + * Get the evaluatorVersion property: The version of the evaluator. Latest version if not specified. + * + * @return the evaluatorVersion value. + */ + @Generated + public String getEvaluatorVersion() { + return this.evaluatorVersion; + } + + /** + * Set the evaluatorVersion property: The version of the evaluator. Latest version if not specified. + * + * @param evaluatorVersion the evaluatorVersion value to set. + * @return the GraderAzureAIEvaluator object itself. + */ + @Generated + public GraderAzureAIEvaluator setEvaluatorVersion(String evaluatorVersion) { + this.evaluatorVersion = evaluatorVersion; + return this; + } + + /** + * Get the initializationParameters property: The initialization parameters for the evaluation. Must support + * structured outputs. + * + * @return the initializationParameters value. + */ + @Generated + public Map getInitializationParameters() { + return this.initializationParameters; + } + + /** + * Get the dataMapping property: The model to use for the evaluation. Must support structured outputs. + * + * @return the dataMapping value. + */ + @Generated + public Map getDataMapping() { + return this.dataMapping; + } + + /** + * Set the dataMapping property: The model to use for the evaluation. Must support structured outputs. + * + * @param dataMapping the dataMapping value to set. + * @return the GraderAzureAIEvaluator object itself. + */ + @Generated + public GraderAzureAIEvaluator setDataMapping(Map dataMapping) { + this.dataMapping = dataMapping; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("evaluator_name", this.evaluatorName); + jsonWriter.writeStringField("evaluator_version", this.evaluatorVersion); + jsonWriter.writeMapField("initialization_parameters", this.initializationParameters, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeMapField("data_mapping", this.dataMapping, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraderAzureAIEvaluator from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraderAzureAIEvaluator if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraderAzureAIEvaluator. + */ + @Generated + public static GraderAzureAIEvaluator fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String evaluatorName = null; + String evaluatorVersion = null; + Map initializationParameters = null; + Map dataMapping = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("evaluator_name".equals(fieldName)) { + evaluatorName = reader.getString(); + } else if ("evaluator_version".equals(fieldName)) { + evaluatorVersion = reader.getString(); + } else if ("initialization_parameters".equals(fieldName)) { + initializationParameters = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("data_mapping".equals(fieldName)) { + dataMapping = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + GraderAzureAIEvaluator deserializedGraderAzureAIEvaluator = new GraderAzureAIEvaluator(name, evaluatorName); + deserializedGraderAzureAIEvaluator.evaluatorVersion = evaluatorVersion; + deserializedGraderAzureAIEvaluator.initializationParameters = initializationParameters; + deserializedGraderAzureAIEvaluator.dataMapping = dataMapping; + return deserializedGraderAzureAIEvaluator; + }); + } + + /** + * Set the initializationParameters property: The initialization parameters for the evaluation. Must support + * structured outputs. + * + * @param initializationParameters the initializationParameters value to set. + * @return the GraderAzureAIEvaluator object itself. + */ + @Generated + public GraderAzureAIEvaluator setInitializationParameters(Map initializationParameters) { + this.initializationParameters = initializationParameters; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiDispatchPayload.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiDispatchPayload.java new file mode 100644 index 000000000000..668a5a90400c --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiDispatchPayload.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A manual payload used to test an invocations API routine dispatch. + */ +@Immutable +public final class InvokeAgentInvocationsApiDispatchPayload extends RoutineDispatchPayload { + + /* + * The manual dispatch payload type. + */ + @Generated + private RoutineDispatchPayloadType type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API; + + /* + * The JSON value sent as the complete downstream invocations input. The value is passed through as-is and can be an + * object, string, number, boolean, array, or null. + */ + @Generated + private final BinaryData input; + + /** + * Get the type property: The manual dispatch payload type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineDispatchPayloadType getType() { + return this.type; + } + + /** + * Get the input property: The JSON value sent as the complete downstream invocations input. The value is passed + * through as-is and can be an object, string, number, boolean, array, or null. + * + * @return the input value. + */ + @Generated + public BinaryData getInput() { + return this.input; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFieldName("input"); + this.input.writeTo(jsonWriter); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InvokeAgentInvocationsApiDispatchPayload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InvokeAgentInvocationsApiDispatchPayload if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InvokeAgentInvocationsApiDispatchPayload. + */ + @Generated + public static InvokeAgentInvocationsApiDispatchPayload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BinaryData input = null; + RoutineDispatchPayloadType type = RoutineDispatchPayloadType.INVOKE_AGENT_INVOCATIONS_API; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("input".equals(fieldName)) { + input = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("type".equals(fieldName)) { + type = RoutineDispatchPayloadType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + InvokeAgentInvocationsApiDispatchPayload deserializedInvokeAgentInvocationsApiDispatchPayload + = new InvokeAgentInvocationsApiDispatchPayload(input); + deserializedInvokeAgentInvocationsApiDispatchPayload.type = type; + return deserializedInvokeAgentInvocationsApiDispatchPayload; + }); + } + + /** + * Creates an instance of InvokeAgentInvocationsApiDispatchPayload class. + * + * @param input the input value to set. + */ + @Generated + public InvokeAgentInvocationsApiDispatchPayload(BinaryData input) { + this.input = input; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiRoutineAction.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiRoutineAction.java new file mode 100644 index 000000000000..3caa41ed2066 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiRoutineAction.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dispatches a routine through the raw invocations API. Exactly one of agent_name or agent_endpoint_id must be + * provided. + */ +@Fluent +public final class InvokeAgentInvocationsApiRoutineAction extends RoutineAction { + + /* + * The action type. + */ + @Generated + private RoutineActionType type = RoutineActionType.INVOKE_AGENT_INVOCATIONS_API; + + /* + * Legacy endpoint-scoped agent identifier for routine dispatch. + */ + @Generated + private String agentEndpointId; + + /* + * An optional existing hosted-agent session identifier to continue during the downstream dispatch. + */ + @Generated + private String sessionId; + + /** + * Get the type property: The action type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineActionType getType() { + return this.type; + } + + /** + * Get the agentEndpointId property: Legacy endpoint-scoped agent identifier for routine dispatch. + * + * @return the agentEndpointId value. + */ + @Generated + public String getAgentEndpointId() { + return this.agentEndpointId; + } + + /** + * Get the sessionId property: An optional existing hosted-agent session identifier to continue during the + * downstream dispatch. + * + * @return the sessionId value. + */ + @Generated + public String getSessionId() { + return this.sessionId; + } + + /** + * Set the sessionId property: An optional existing hosted-agent session identifier to continue during the + * downstream dispatch. + * + * @param sessionId the sessionId value to set. + * @return the InvokeAgentInvocationsApiRoutineAction object itself. + */ + @Generated + public InvokeAgentInvocationsApiRoutineAction setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_endpoint_id", this.agentEndpointId); + if (this.input != null) { + jsonWriter.writeFieldName("input"); + this.input.writeTo(jsonWriter); + } + jsonWriter.writeStringField("session_id", this.sessionId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InvokeAgentInvocationsApiRoutineAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InvokeAgentInvocationsApiRoutineAction 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 InvokeAgentInvocationsApiRoutineAction. + */ + @Generated + public static InvokeAgentInvocationsApiRoutineAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InvokeAgentInvocationsApiRoutineAction deserializedInvokeAgentInvocationsApiRoutineAction + = new InvokeAgentInvocationsApiRoutineAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedInvokeAgentInvocationsApiRoutineAction.type + = RoutineActionType.fromString(reader.getString()); + } else if ("agent_name".equals(fieldName)) { + deserializedInvokeAgentInvocationsApiRoutineAction.agentName = reader.getString(); + } else if ("agent_endpoint_id".equals(fieldName)) { + deserializedInvokeAgentInvocationsApiRoutineAction.agentEndpointId = reader.getString(); + } else if ("input".equals(fieldName)) { + deserializedInvokeAgentInvocationsApiRoutineAction.input + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("session_id".equals(fieldName)) { + deserializedInvokeAgentInvocationsApiRoutineAction.sessionId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedInvokeAgentInvocationsApiRoutineAction; + }); + } + + /* + * The project-scoped agent name for routine dispatch. + */ + @Generated + private String agentName; + + /* + * Static JSON value sent as the complete downstream input when the routine fires. The value is passed through + * as-is; no templating is applied. + */ + @Generated + private BinaryData input; + + /** + * Creates an instance of InvokeAgentInvocationsApiRoutineAction class. + */ + @Generated + public InvokeAgentInvocationsApiRoutineAction() { + } + + /** + * Get the agentName property: The project-scoped agent name for routine dispatch. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Set the agentName property: The project-scoped agent name for routine dispatch. + * + * @param agentName the agentName value to set. + * @return the InvokeAgentInvocationsApiRoutineAction object itself. + */ + @Generated + public InvokeAgentInvocationsApiRoutineAction setAgentName(String agentName) { + this.agentName = agentName; + return this; + } + + /** + * Set the agentEndpointId property: Legacy endpoint-scoped agent identifier for routine dispatch. + * + * @param agentEndpointId the agentEndpointId value to set. + * @return the InvokeAgentInvocationsApiRoutineAction object itself. + */ + @Generated + public InvokeAgentInvocationsApiRoutineAction setAgentEndpointId(String agentEndpointId) { + this.agentEndpointId = agentEndpointId; + return this; + } + + /** + * Get the input property: Static JSON value sent as the complete downstream input when the routine fires. The value + * is passed through as-is; no templating is applied. + * + * @return the input value. + */ + @Generated + public BinaryData getInput() { + return this.input; + } + + /** + * Set the input property: Static JSON value sent as the complete downstream input when the routine fires. The value + * is passed through as-is; no templating is applied. + * + * @param input the input value to set. + * @return the InvokeAgentInvocationsApiRoutineAction object itself. + */ + @Generated + public InvokeAgentInvocationsApiRoutineAction setInput(BinaryData input) { + this.input = input; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiDispatchPayload.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiDispatchPayload.java new file mode 100644 index 000000000000..672514681647 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiDispatchPayload.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A manual payload used to test a responses API routine dispatch. + */ +@Immutable +public final class InvokeAgentResponsesApiDispatchPayload extends RoutineDispatchPayload { + + /* + * The manual dispatch payload type. + */ + @Generated + private RoutineDispatchPayloadType type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API; + + /* + * The JSON value sent as the complete downstream responses input. The value is passed through as-is and can be an + * object, string, number, boolean, array, or null. + */ + @Generated + private final BinaryData input; + + /** + * Get the type property: The manual dispatch payload type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineDispatchPayloadType getType() { + return this.type; + } + + /** + * Get the input property: The JSON value sent as the complete downstream responses input. The value is passed + * through as-is and can be an object, string, number, boolean, array, or null. + * + * @return the input value. + */ + @Generated + public BinaryData getInput() { + return this.input; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeFieldName("input"); + this.input.writeTo(jsonWriter); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InvokeAgentResponsesApiDispatchPayload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InvokeAgentResponsesApiDispatchPayload if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the InvokeAgentResponsesApiDispatchPayload. + */ + @Generated + public static InvokeAgentResponsesApiDispatchPayload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BinaryData input = null; + RoutineDispatchPayloadType type = RoutineDispatchPayloadType.INVOKE_AGENT_RESPONSES_API; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("input".equals(fieldName)) { + input = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("type".equals(fieldName)) { + type = RoutineDispatchPayloadType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + InvokeAgentResponsesApiDispatchPayload deserializedInvokeAgentResponsesApiDispatchPayload + = new InvokeAgentResponsesApiDispatchPayload(input); + deserializedInvokeAgentResponsesApiDispatchPayload.type = type; + return deserializedInvokeAgentResponsesApiDispatchPayload; + }); + } + + /** + * Creates an instance of InvokeAgentResponsesApiDispatchPayload class. + * + * @param input the input value to set. + */ + @Generated + public InvokeAgentResponsesApiDispatchPayload(BinaryData input) { + this.input = input; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiRoutineAction.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiRoutineAction.java new file mode 100644 index 000000000000..3d5307ee76fb --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiRoutineAction.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Dispatches a routine through the responses API. Exactly one of agent_name or agent_endpoint_id must be provided. + */ +@Fluent +public final class InvokeAgentResponsesApiRoutineAction extends RoutineAction { + + /* + * The action type. + */ + @Generated + private RoutineActionType type = RoutineActionType.INVOKE_AGENT_RESPONSES_API; + + /* + * The project-scoped agent name for routine dispatch. + */ + @Generated + private String agentName; + + /* + * Legacy endpoint-scoped agent identifier for routine dispatch. + */ + @Generated + private String agentEndpointId; + + /** + * Creates an instance of InvokeAgentResponsesApiRoutineAction class. + */ + @Generated + public InvokeAgentResponsesApiRoutineAction() { + } + + /** + * Get the type property: The action type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineActionType getType() { + return this.type; + } + + /** + * Get the agentName property: The project-scoped agent name for routine dispatch. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Set the agentName property: The project-scoped agent name for routine dispatch. + * + * @param agentName the agentName value to set. + * @return the InvokeAgentResponsesApiRoutineAction object itself. + */ + @Generated + public InvokeAgentResponsesApiRoutineAction setAgentName(String agentName) { + this.agentName = agentName; + return this; + } + + /** + * Get the agentEndpointId property: Legacy endpoint-scoped agent identifier for routine dispatch. + * + * @return the agentEndpointId value. + */ + @Generated + public String getAgentEndpointId() { + return this.agentEndpointId; + } + + /** + * Set the agentEndpointId property: Legacy endpoint-scoped agent identifier for routine dispatch. + * + * @param agentEndpointId the agentEndpointId value to set. + * @return the InvokeAgentResponsesApiRoutineAction object itself. + */ + @Generated + public InvokeAgentResponsesApiRoutineAction setAgentEndpointId(String agentEndpointId) { + this.agentEndpointId = agentEndpointId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_endpoint_id", this.agentEndpointId); + if (this.input != null) { + jsonWriter.writeFieldName("input"); + this.input.writeTo(jsonWriter); + } + jsonWriter.writeStringField("conversation", this.conversation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InvokeAgentResponsesApiRoutineAction from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of InvokeAgentResponsesApiRoutineAction 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 InvokeAgentResponsesApiRoutineAction. + */ + @Generated + public static InvokeAgentResponsesApiRoutineAction fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + InvokeAgentResponsesApiRoutineAction deserializedInvokeAgentResponsesApiRoutineAction + = new InvokeAgentResponsesApiRoutineAction(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedInvokeAgentResponsesApiRoutineAction.type + = RoutineActionType.fromString(reader.getString()); + } else if ("agent_name".equals(fieldName)) { + deserializedInvokeAgentResponsesApiRoutineAction.agentName = reader.getString(); + } else if ("agent_endpoint_id".equals(fieldName)) { + deserializedInvokeAgentResponsesApiRoutineAction.agentEndpointId = reader.getString(); + } else if ("input".equals(fieldName)) { + deserializedInvokeAgentResponsesApiRoutineAction.input + = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + } else if ("conversation".equals(fieldName)) { + deserializedInvokeAgentResponsesApiRoutineAction.conversation = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedInvokeAgentResponsesApiRoutineAction; + }); + } + + /* + * Static JSON value sent as the complete downstream input when the routine fires. The value is passed through + * as-is; no templating is applied. + */ + @Generated + private BinaryData input; + + /* + * An optional existing conversation identifier to continue during the downstream dispatch. + */ + @Generated + private String conversation; + + /** + * Get the input property: Static JSON value sent as the complete downstream input when the routine fires. The value + * is passed through as-is; no templating is applied. + * + * @return the input value. + */ + @Generated + public BinaryData getInput() { + return this.input; + } + + /** + * Set the input property: Static JSON value sent as the complete downstream input when the routine fires. The value + * is passed through as-is; no templating is applied. + * + * @param input the input value to set. + * @return the InvokeAgentResponsesApiRoutineAction object itself. + */ + @Generated + public InvokeAgentResponsesApiRoutineAction setInput(BinaryData input) { + this.input = input; + return this; + } + + /** + * Get the conversation property: An optional existing conversation identifier to continue during the downstream + * dispatch. + * + * @return the conversation value. + */ + @Generated + public String getConversation() { + return this.conversation; + } + + /** + * Set the conversation property: An optional existing conversation identifier to continue during the downstream + * dispatch. + * + * @param conversation the conversation value to set. + * @return the InvokeAgentResponsesApiRoutineAction object itself. + */ + @Generated + public InvokeAgentResponsesApiRoutineAction setConversation(String conversation) { + this.conversation = conversation; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/JobStatus.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/JobStatus.java new file mode 100644 index 000000000000..693abcf60e1a --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/JobStatus.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Extensible status values shared by Foundry jobs. + */ +public final class JobStatus extends ExpandableStringEnum { + + /** + * Job is waiting to start. + */ + @Generated + public static final JobStatus QUEUED = fromString("queued"); + + /** + * Job is actively processing. + */ + @Generated + public static final JobStatus IN_PROGRESS = fromString("in_progress"); + + /** + * Job completed successfully. + */ + @Generated + public static final JobStatus SUCCEEDED = fromString("succeeded"); + + /** + * Job failed. + */ + @Generated + public static final JobStatus FAILED = fromString("failed"); + + /** + * Job was cancelled by the caller. + */ + @Generated + public static final JobStatus CANCELLED = fromString("cancelled"); + + /** + * Creates a new instance of JobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public JobStatus() { + } + + /** + * Creates or finds a JobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding JobStatus. + */ + @Generated + public static JobStatus fromString(String name) { + return fromString(name, JobStatus.class); + } + + /** + * Gets known JobStatus values. + * + * @return known JobStatus values. + */ + @Generated + public static Collection values() { + return values(JobStatus.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/LoraConfig.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/LoraConfig.java new file mode 100644 index 000000000000..b0bfb53285ac --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/LoraConfig.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.util.List; + +/** + * Adapter-specific metadata for LoRA models. Drives serving engine configuration at deployment time. + */ +@Fluent +public final class LoraConfig implements JsonSerializable { + + /* + * LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + */ + @Generated + private Integer rank; + + /* + * LoRA scaling factor (α). Positive integer; typically 2× the rank. + */ + @Generated + private Integer alpha; + + /* + * Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from adapter_config.json if omitted. + */ + @Generated + private List targetModules; + + /* + * Dropout rate used during training. Informational — not used at serving time. + */ + @Generated + private Double dropout; + + /** + * Creates an instance of LoraConfig class. + */ + @Generated + public LoraConfig() { + } + + /** + * Get the rank property: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + * + * @return the rank value. + */ + @Generated + public Integer getRank() { + return this.rank; + } + + /** + * Set the rank property: LoRA rank (r). Positive integer. Common values: 8, 16, 32, 64. + * + * @param rank the rank value to set. + * @return the LoraConfig object itself. + */ + @Generated + public LoraConfig setRank(Integer rank) { + this.rank = rank; + return this; + } + + /** + * Get the alpha property: LoRA scaling factor (α). Positive integer; typically 2× the rank. + * + * @return the alpha value. + */ + @Generated + public Integer getAlpha() { + return this.alpha; + } + + /** + * Set the alpha property: LoRA scaling factor (α). Positive integer; typically 2× the rank. + * + * @param alpha the alpha value to set. + * @return the LoraConfig object itself. + */ + @Generated + public LoraConfig setAlpha(Integer alpha) { + this.alpha = alpha; + return this; + } + + /** + * Get the targetModules property: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + * adapter_config.json if omitted. + * + * @return the targetModules value. + */ + @Generated + public List getTargetModules() { + return this.targetModules; + } + + /** + * Set the targetModules property: Model layers modified by the adapter (e.g., q_proj, v_proj). Auto-detected from + * adapter_config.json if omitted. + * + * @param targetModules the targetModules value to set. + * @return the LoraConfig object itself. + */ + @Generated + public LoraConfig setTargetModules(List targetModules) { + this.targetModules = targetModules; + return this; + } + + /** + * Get the dropout property: Dropout rate used during training. Informational — not used at serving time. + * + * @return the dropout value. + */ + @Generated + public Double getDropout() { + return this.dropout; + } + + /** + * Set the dropout property: Dropout rate used during training. Informational — not used at serving time. + * + * @param dropout the dropout value to set. + * @return the LoraConfig object itself. + */ + @Generated + public LoraConfig setDropout(Double dropout) { + this.dropout = dropout; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("rank", this.rank); + jsonWriter.writeNumberField("alpha", this.alpha); + jsonWriter.writeArrayField("targetModules", this.targetModules, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("dropout", this.dropout); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of LoraConfig from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of LoraConfig 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 LoraConfig. + */ + @Generated + public static LoraConfig fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + LoraConfig deserializedLoraConfig = new LoraConfig(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("rank".equals(fieldName)) { + deserializedLoraConfig.rank = reader.getNullable(JsonReader::getInt); + } else if ("alpha".equals(fieldName)) { + deserializedLoraConfig.alpha = reader.getNullable(JsonReader::getInt); + } else if ("targetModules".equals(fieldName)) { + List targetModules = reader.readArray(reader1 -> reader1.getString()); + deserializedLoraConfig.targetModules = targetModules; + } else if ("dropout".equals(fieldName)) { + deserializedLoraConfig.dropout = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + return deserializedLoraConfig; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ReasoningTextContent.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelCredentialInput.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ReasoningTextContent.java rename to sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelCredentialInput.java index 45245ed77f88..68991924c657 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ReasoningTextContent.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelCredentialInput.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.projects.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,53 +12,35 @@ import java.io.IOException; /** - * Reasoning text - * - * Reasoning text from the model. + * Request to fetch credentials for a model asset. */ @Immutable -public final class ReasoningTextContent implements JsonSerializable { +public final class ModelCredentialInput implements JsonSerializable { /* - * The type of the reasoning text. Always `reasoning_text`. + * Blob URI of the model asset to fetch credentials for. */ @Generated - private final String type = "reasoning_text"; - - /* - * The reasoning text from the model. - */ - @Generated - private final String text; - - /** - * Creates an instance of ReasoningTextContent class. - * - * @param text the text value to set. - */ - @Generated - public ReasoningTextContent(String text) { - this.text = text; - } + private final String blobUrl; /** - * Get the type property: The type of the reasoning text. Always `reasoning_text`. + * Creates an instance of ModelCredentialInput class. * - * @return the type value. + * @param blobUrl the blobUrl value to set. */ @Generated - public String getType() { - return this.type; + public ModelCredentialInput(String blobUrl) { + this.blobUrl = blobUrl; } /** - * Get the text property: The reasoning text from the model. + * Get the blobUrl property: Blob URI of the model asset to fetch credentials for. * - * @return the text value. + * @return the blobUrl value. */ @Generated - public String getText() { - return this.text; + public String getBlobUrl() { + return this.blobUrl; } /** @@ -68,34 +50,33 @@ public String getText() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("text", this.text); + jsonWriter.writeStringField("blobUri", this.blobUrl); return jsonWriter.writeEndObject(); } /** - * Reads an instance of ReasoningTextContent from the JsonReader. + * Reads an instance of ModelCredentialInput from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ReasoningTextContent if the JsonReader was pointing to an instance of it, or null if it + * @return An instance of ModelCredentialInput if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ReasoningTextContent. + * @throws IOException If an error occurs while reading the ModelCredentialInput. */ @Generated - public static ReasoningTextContent fromJson(JsonReader jsonReader) throws IOException { + public static ModelCredentialInput fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String text = null; + String blobUrl = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("text".equals(fieldName)) { - text = reader.getString(); + if ("blobUri".equals(fieldName)) { + blobUrl = reader.getString(); } else { reader.skipChildren(); } } - return new ReasoningTextContent(text); + return new ModelCredentialInput(blobUrl); }); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelPendingUploadInput.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelPendingUploadInput.java new file mode 100644 index 000000000000..563d7ffc8cc6 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelPendingUploadInput.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; + +/** + * Represents a request for a pending upload of a model version. + */ +@Fluent +public final class ModelPendingUploadInput implements JsonSerializable { + + /* + * If PendingUploadId is not provided, a random GUID will be used. + */ + @Generated + private String pendingUploadId; + + /* + * Azure Storage Account connection name to use for generating temporary SAS token + */ + @Generated + private String connectionName; + + /* + * The type of pending upload. Only TemporaryBlobReference is supported for models. + */ + @Generated + private final PendingUploadType pendingUploadType = PendingUploadType.TEMPORARY_BLOB_REFERENCE; + + /** + * Creates an instance of ModelPendingUploadInput class. + */ + @Generated + public ModelPendingUploadInput() { + } + + /** + * Get the pendingUploadId property: If PendingUploadId is not provided, a random GUID will be used. + * + * @return the pendingUploadId value. + */ + @Generated + public String getPendingUploadId() { + return this.pendingUploadId; + } + + /** + * Set the pendingUploadId property: If PendingUploadId is not provided, a random GUID will be used. + * + * @param pendingUploadId the pendingUploadId value to set. + * @return the ModelPendingUploadInput object itself. + */ + @Generated + public ModelPendingUploadInput setPendingUploadId(String pendingUploadId) { + this.pendingUploadId = pendingUploadId; + return this; + } + + /** + * Get the connectionName property: Azure Storage Account connection name to use for generating temporary SAS token. + * + * @return the connectionName value. + */ + @Generated + public String getConnectionName() { + return this.connectionName; + } + + /** + * Set the connectionName property: Azure Storage Account connection name to use for generating temporary SAS token. + * + * @param connectionName the connectionName value to set. + * @return the ModelPendingUploadInput object itself. + */ + @Generated + public ModelPendingUploadInput setConnectionName(String connectionName) { + this.connectionName = connectionName; + return this; + } + + /** + * Get the pendingUploadType property: The type of pending upload. Only TemporaryBlobReference is supported for + * models. + * + * @return the pendingUploadType value. + */ + @Generated + public PendingUploadType getPendingUploadType() { + return this.pendingUploadType; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("pendingUploadType", + this.pendingUploadType == null ? null : this.pendingUploadType.toString()); + jsonWriter.writeStringField("pendingUploadId", this.pendingUploadId); + jsonWriter.writeStringField("connectionName", this.connectionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelPendingUploadInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelPendingUploadInput if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModelPendingUploadInput. + */ + @Generated + public static ModelPendingUploadInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelPendingUploadInput deserializedModelPendingUploadInput = new ModelPendingUploadInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("pendingUploadId".equals(fieldName)) { + deserializedModelPendingUploadInput.pendingUploadId = reader.getString(); + } else if ("connectionName".equals(fieldName)) { + deserializedModelPendingUploadInput.connectionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedModelPendingUploadInput; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelPendingUploadResult.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelPendingUploadResult.java new file mode 100644 index 000000000000..5fad4bd0ef94 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelPendingUploadResult.java @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Represents the response for a model pending upload request. + */ +@Immutable +public final class ModelPendingUploadResult implements JsonSerializable { + + /* + * Container-level read, write, list SAS. + */ + @Generated + private final BlobReference blobReference; + + /* + * ID for this upload request. + */ + @Generated + private final String pendingUploadId; + + /* + * Version of asset to be created if user did not specify version when initially creating upload + */ + @Generated + private String version; + + /* + * The type of pending upload. Only TemporaryBlobReference is supported for models. + */ + @Generated + private final PendingUploadType pendingUploadType = PendingUploadType.TEMPORARY_BLOB_REFERENCE; + + /** + * Creates an instance of ModelPendingUploadResult class. + * + * @param blobReference the blobReference value to set. + * @param pendingUploadId the pendingUploadId value to set. + */ + @Generated + private ModelPendingUploadResult(BlobReference blobReference, String pendingUploadId) { + this.blobReference = blobReference; + this.pendingUploadId = pendingUploadId; + } + + /** + * Get the blobReference property: Container-level read, write, list SAS. + * + * @return the blobReference value. + */ + @Generated + public BlobReference getBlobReference() { + return this.blobReference; + } + + /** + * Get the pendingUploadId property: ID for this upload request. + * + * @return the pendingUploadId value. + */ + @Generated + public String getPendingUploadId() { + return this.pendingUploadId; + } + + /** + * Get the version property: Version of asset to be created if user did not specify version when initially creating + * upload. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the pendingUploadType property: The type of pending upload. Only TemporaryBlobReference is supported for + * models. + * + * @return the pendingUploadType value. + */ + @Generated + public PendingUploadType getPendingUploadType() { + return this.pendingUploadType; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("blobReference", this.blobReference); + jsonWriter.writeStringField("pendingUploadId", this.pendingUploadId); + jsonWriter.writeStringField("pendingUploadType", + this.pendingUploadType == null ? null : this.pendingUploadType.toString()); + jsonWriter.writeStringField("version", this.version); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelPendingUploadResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelPendingUploadResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModelPendingUploadResult. + */ + @Generated + public static ModelPendingUploadResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobReference blobReference = null; + String pendingUploadId = null; + String version = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("blobReference".equals(fieldName)) { + blobReference = BlobReference.fromJson(reader); + } else if ("pendingUploadId".equals(fieldName)) { + pendingUploadId = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else { + reader.skipChildren(); + } + } + ModelPendingUploadResult deserializedModelPendingUploadResult + = new ModelPendingUploadResult(blobReference, pendingUploadId); + deserializedModelPendingUploadResult.version = version; + return deserializedModelPendingUploadResult; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSamplingParams.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSamplingParams.java index 4127ae67535e..1f426da2f357 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSamplingParams.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSamplingParams.java @@ -3,8 +3,8 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.projects.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.JsonSerializable; import com.azure.json.JsonToken; @@ -14,76 +14,60 @@ /** * Represents a set of parameters used to control the sampling behavior of a language model during text generation. */ -@Immutable +@Fluent public final class ModelSamplingParams implements JsonSerializable { /* - * The temperature parameter for sampling. + * The temperature parameter for sampling. Defaults to 1.0. */ @Generated - private final double temperature; + private Double temperature; /* - * The top-p parameter for nucleus sampling. + * The top-p parameter for nucleus sampling. Defaults to 1.0. */ @Generated - private final double topP; + private Double topP; /* - * The random seed for reproducibility. + * The random seed for reproducibility. Defaults to 42. */ @Generated - private final int seed; + private Integer seed; /* * The maximum number of tokens allowed in the completion. */ @Generated - private final int maxCompletionTokens; + private Integer maxCompletionTokens; /** - * Creates an instance of ModelSamplingParams class. - * - * @param temperature the temperature value to set. - * @param topP the topP value to set. - * @param seed the seed value to set. - * @param maxCompletionTokens the maxCompletionTokens value to set. - */ - @Generated - public ModelSamplingParams(double temperature, double topP, int seed, int maxCompletionTokens) { - this.temperature = temperature; - this.topP = topP; - this.seed = seed; - this.maxCompletionTokens = maxCompletionTokens; - } - - /** - * Get the temperature property: The temperature parameter for sampling. + * Get the temperature property: The temperature parameter for sampling. Defaults to 1.0. * * @return the temperature value. */ @Generated - public double getTemperature() { + public Double getTemperature() { return this.temperature; } /** - * Get the topP property: The top-p parameter for nucleus sampling. + * Get the topP property: The top-p parameter for nucleus sampling. Defaults to 1.0. * * @return the topP value. */ @Generated - public double getTopP() { + public Double getTopP() { return this.topP; } /** - * Get the seed property: The random seed for reproducibility. + * Get the seed property: The random seed for reproducibility. Defaults to 42. * * @return the seed value. */ @Generated - public int getSeed() { + public Integer getSeed() { return this.seed; } @@ -93,7 +77,7 @@ public int getSeed() { * @return the maxCompletionTokens value. */ @Generated - public int getMaxCompletionTokens() { + public Integer getMaxCompletionTokens() { return this.maxCompletionTokens; } @@ -104,10 +88,10 @@ public int getMaxCompletionTokens() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeDoubleField("temperature", this.temperature); - jsonWriter.writeDoubleField("top_p", this.topP); - jsonWriter.writeIntField("seed", this.seed); - jsonWriter.writeIntField("max_completion_tokens", this.maxCompletionTokens); + jsonWriter.writeNumberField("temperature", this.temperature); + jsonWriter.writeNumberField("top_p", this.topP); + jsonWriter.writeNumberField("seed", this.seed); + jsonWriter.writeNumberField("max_completion_tokens", this.maxCompletionTokens); return jsonWriter.writeEndObject(); } @@ -117,32 +101,98 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ModelSamplingParams if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ModelSamplingParams. */ @Generated public static ModelSamplingParams fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - double temperature = 0.0; - double topP = 0.0; - int seed = 0; - int maxCompletionTokens = 0; + ModelSamplingParams deserializedModelSamplingParams = new ModelSamplingParams(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("temperature".equals(fieldName)) { - temperature = reader.getDouble(); + deserializedModelSamplingParams.temperature = reader.getNullable(JsonReader::getDouble); } else if ("top_p".equals(fieldName)) { - topP = reader.getDouble(); + deserializedModelSamplingParams.topP = reader.getNullable(JsonReader::getDouble); } else if ("seed".equals(fieldName)) { - seed = reader.getInt(); + deserializedModelSamplingParams.seed = reader.getNullable(JsonReader::getInt); } else if ("max_completion_tokens".equals(fieldName)) { - maxCompletionTokens = reader.getInt(); + deserializedModelSamplingParams.maxCompletionTokens = reader.getNullable(JsonReader::getInt); } else { reader.skipChildren(); } } - return new ModelSamplingParams(temperature, topP, seed, maxCompletionTokens); + return deserializedModelSamplingParams; }); } + + /** + * Creates an instance of ModelSamplingParams class. + */ + @Generated + public ModelSamplingParams() { + } + + /** + * Creates an instance of ModelSamplingParams class. + * + * @param temperature the temperature value to set. + * @param topP the topP value to set. + * @param seed the seed value to set. + * @param maxCompletionTokens the maxCompletionTokens value to set. + */ + public ModelSamplingParams(double temperature, double topP, int seed, int maxCompletionTokens) { + this.temperature = temperature; + this.topP = topP; + this.seed = seed; + this.maxCompletionTokens = maxCompletionTokens; + } + + /** + * Set the temperature property: The temperature parameter for sampling. Defaults to 1.0. + * + * @param temperature the temperature value to set. + * @return the ModelSamplingParams object itself. + */ + @Generated + public ModelSamplingParams setTemperature(Double temperature) { + this.temperature = temperature; + return this; + } + + /** + * Set the topP property: The top-p parameter for nucleus sampling. Defaults to 1.0. + * + * @param topP the topP value to set. + * @return the ModelSamplingParams object itself. + */ + @Generated + public ModelSamplingParams setTopP(Double topP) { + this.topP = topP; + return this; + } + + /** + * Set the seed property: The random seed for reproducibility. Defaults to 42. + * + * @param seed the seed value to set. + * @return the ModelSamplingParams object itself. + */ + @Generated + public ModelSamplingParams setSeed(Integer seed) { + this.seed = seed; + return this; + } + + /** + * Set the maxCompletionTokens property: The maximum number of tokens allowed in the completion. + * + * @param maxCompletionTokens the maxCompletionTokens value to set. + * @return the ModelSamplingParams object itself. + */ + @Generated + public ModelSamplingParams setMaxCompletionTokens(Integer maxCompletionTokens) { + this.maxCompletionTokens = maxCompletionTokens; + return this; + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSourceData.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSourceData.java new file mode 100644 index 000000000000..9e1c7725aea2 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelSourceData.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; + +/** + * Source information for the model. + */ +@Fluent +public final class ModelSourceData implements JsonSerializable { + + /* + * The source type of the model + */ + @Generated + private FoundryModelSourceType sourceType; + + /* + * The job ID that produced this model + */ + @Generated + private String jobId; + + /** + * Creates an instance of ModelSourceData class. + */ + @Generated + public ModelSourceData() { + } + + /** + * Get the sourceType property: The source type of the model. + * + * @return the sourceType value. + */ + @Generated + public FoundryModelSourceType getSourceType() { + return this.sourceType; + } + + /** + * Set the sourceType property: The source type of the model. + * + * @param sourceType the sourceType value to set. + * @return the ModelSourceData object itself. + */ + @Generated + public ModelSourceData setSourceType(FoundryModelSourceType sourceType) { + this.sourceType = sourceType; + return this; + } + + /** + * Get the jobId property: The job ID that produced this model. + * + * @return the jobId value. + */ + @Generated + public String getJobId() { + return this.jobId; + } + + /** + * Set the jobId property: The job ID that produced this model. + * + * @param jobId the jobId value to set. + * @return the ModelSourceData object itself. + */ + @Generated + public ModelSourceData setJobId(String jobId) { + this.jobId = jobId; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceType", this.sourceType == null ? null : this.sourceType.toString()); + jsonWriter.writeStringField("jobId", this.jobId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelSourceData from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelSourceData 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 ModelSourceData. + */ + @Generated + public static ModelSourceData fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ModelSourceData deserializedModelSourceData = new ModelSourceData(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("sourceType".equals(fieldName)) { + deserializedModelSourceData.sourceType = FoundryModelSourceType.fromString(reader.getString()); + } else if ("jobId".equals(fieldName)) { + deserializedModelSourceData.jobId = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedModelSourceData; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelVersion.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelVersion.java new file mode 100644 index 000000000000..f152b1b39b6e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ModelVersion.java @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.util.List; +import java.util.Map; + +/** + * Model Version Definition. + */ +@Fluent +public final class ModelVersion implements JsonSerializable { + + /* + * System related metadata + */ + @Generated + private SystemDataV3 systemData; + + /* + * The weight type of the model + */ + @Generated + private FoundryModelWeightType weightType; + + /* + * Base model asset ID + */ + @Generated + private String baseModel; + + /* + * The source of the model + */ + @Generated + private ModelSourceData source; + + /* + * Adapter-specific configuration. Required when weight_type is lora; ignored otherwise. May be auto-populated from + * adapter_config.json when present in the uploaded files — user-provided values take precedence over auto-detected + * values. + */ + @Generated + private LoraConfig loraConfig; + + /* + * The artifact profile of the model + */ + @Generated + private ArtifactProfile artifactProfile; + + /* + * Service-computed advisory warnings derived from the artifact profile. + */ + @Generated + private List warnings; + + /* + * Asset ID, a unique identifier for the asset + */ + @Generated + private String id; + + /* + * The name of the resource + */ + @Generated + private String name; + + /* + * The version of the resource + */ + @Generated + private String version; + + /* + * The asset description text. + */ + @Generated + private String description; + + /* + * Tag dictionary. Tags can be added, removed, and updated. + */ + @Generated + private Map tags; + + /** + * Creates an instance of ModelVersion class. + * + * @param blobUrl the blobUrl value to set. + */ + @Generated + public ModelVersion(String blobUrl) { + this.blobUrl = blobUrl; + } + + /** + * Get the systemData property: System related metadata. + * + * @return the systemData value. + */ + @Generated + public SystemDataV3 getSystemData() { + return this.systemData; + } + + /** + * Get the weightType property: The weight type of the model. + * + * @return the weightType value. + */ + @Generated + public FoundryModelWeightType getWeightType() { + return this.weightType; + } + + /** + * Set the weightType property: The weight type of the model. + * + * @param weightType the weightType value to set. + * @return the ModelVersion object itself. + */ + @Generated + public ModelVersion setWeightType(FoundryModelWeightType weightType) { + this.weightType = weightType; + return this; + } + + /** + * Get the baseModel property: Base model asset ID. + * + * @return the baseModel value. + */ + @Generated + public String getBaseModel() { + return this.baseModel; + } + + /** + * Set the baseModel property: Base model asset ID. + * + * @param baseModel the baseModel value to set. + * @return the ModelVersion object itself. + */ + @Generated + public ModelVersion setBaseModel(String baseModel) { + this.baseModel = baseModel; + return this; + } + + /** + * Get the source property: The source of the model. + * + * @return the source value. + */ + @Generated + public ModelSourceData getSource() { + return this.source; + } + + /** + * Set the source property: The source of the model. + * + * @param source the source value to set. + * @return the ModelVersion object itself. + */ + @Generated + public ModelVersion setSource(ModelSourceData source) { + this.source = source; + return this; + } + + /** + * Get the loraConfig property: Adapter-specific configuration. Required when weight_type is lora; ignored + * otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided + * values take precedence over auto-detected values. + * + * @return the loraConfig value. + */ + @Generated + public LoraConfig getLoraConfig() { + return this.loraConfig; + } + + /** + * Set the loraConfig property: Adapter-specific configuration. Required when weight_type is lora; ignored + * otherwise. May be auto-populated from adapter_config.json when present in the uploaded files — user-provided + * values take precedence over auto-detected values. + * + * @param loraConfig the loraConfig value to set. + * @return the ModelVersion object itself. + */ + @Generated + public ModelVersion setLoraConfig(LoraConfig loraConfig) { + this.loraConfig = loraConfig; + return this; + } + + /** + * Get the artifactProfile property: The artifact profile of the model. + * + * @return the artifactProfile value. + */ + @Generated + public ArtifactProfile getArtifactProfile() { + return this.artifactProfile; + } + + /** + * Get the warnings property: Service-computed advisory warnings derived from the artifact profile. + * + * @return the warnings value. + */ + @Generated + public List getWarnings() { + return this.warnings; + } + + /** + * Get the id property: Asset ID, a unique identifier for the asset. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: The version of the resource. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the description property: The asset description text. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The asset description text. + * + * @param description the description value to set. + * @return the ModelVersion object itself. + */ + @Generated + public ModelVersion setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @return the tags value. + */ + @Generated + public Map getTags() { + return this.tags; + } + + /** + * Set the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @param tags the tags value to set. + * @return the ModelVersion object itself. + */ + @Generated + public ModelVersion setTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("blobUri", this.blobUrl); + jsonWriter.writeStringField("weightType", this.weightType == null ? null : this.weightType.toString()); + jsonWriter.writeStringField("baseModel", this.baseModel); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("loraConfig", this.loraConfig); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ModelVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ModelVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ModelVersion. + */ + @Generated + public static ModelVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String blobUrl = null; + String name = null; + String version = null; + SystemDataV3 systemData = null; + FoundryModelWeightType weightType = null; + String baseModel = null; + ModelSourceData source = null; + LoraConfig loraConfig = null; + ArtifactProfile artifactProfile = null; + List warnings = null; + String id = null; + String description = null; + Map tags = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("blobUri".equals(fieldName)) { + blobUrl = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else if ("systemData".equals(fieldName)) { + systemData = SystemDataV3.fromJson(reader); + } else if ("weightType".equals(fieldName)) { + weightType = FoundryModelWeightType.fromString(reader.getString()); + } else if ("baseModel".equals(fieldName)) { + baseModel = reader.getString(); + } else if ("source".equals(fieldName)) { + source = ModelSourceData.fromJson(reader); + } else if ("loraConfig".equals(fieldName)) { + loraConfig = LoraConfig.fromJson(reader); + } else if ("artifactProfile".equals(fieldName)) { + artifactProfile = ArtifactProfile.fromJson(reader); + } else if ("warnings".equals(fieldName)) { + warnings = reader.readArray(reader1 -> FoundryModelWarning.fromJson(reader1)); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("tags".equals(fieldName)) { + tags = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + ModelVersion deserializedModelVersion = new ModelVersion(blobUrl); + deserializedModelVersion.name = name; + deserializedModelVersion.version = version; + deserializedModelVersion.systemData = systemData; + deserializedModelVersion.weightType = weightType; + deserializedModelVersion.baseModel = baseModel; + deserializedModelVersion.source = source; + deserializedModelVersion.loraConfig = loraConfig; + deserializedModelVersion.artifactProfile = artifactProfile; + deserializedModelVersion.warnings = warnings; + deserializedModelVersion.id = id; + deserializedModelVersion.description = description; + deserializedModelVersion.tags = tags; + return deserializedModelVersion; + }); + } + + /* + * URI of the model artifact in blob storage + */ + @Generated + private final String blobUrl; + + /** + * Get the blobUrl property: URI of the model artifact in blob storage. + * + * @return the blobUrl value. + */ + @Generated + public String getBlobUrl() { + return this.blobUrl; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/OneTimeTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/OneTimeTrigger.java index 806b11ebd824..51b52cdea0f7 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/OneTimeTrigger.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/OneTimeTrigger.java @@ -32,7 +32,7 @@ public final class OneTimeTrigger extends Trigger { private final OffsetDateTime triggerAt; /* - * Time zone for the one-time trigger. + * Time zone for the one-time trigger. Defaults to `UTC`. */ @Generated private String timeZone; @@ -59,7 +59,7 @@ public OffsetDateTime getTriggerAt() { } /** - * Get the timeZone property: Time zone for the one-time trigger. + * Get the timeZone property: Time zone for the one-time trigger. Defaults to `UTC`. * * @return the timeZone value. */ @@ -129,7 +129,7 @@ public OneTimeTrigger(OffsetDateTime triggerAt) { } /** - * Set the timeZone property: Time zone for the one-time trigger. + * Set the timeZone property: Time zone for the one-time trigger. Defaults to `UTC`. * * @param timeZone the timeZone value to set. * @return the OneTimeTrigger object itself. diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PendingUploadRequest.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PendingUploadRequest.java index dc7bdf306b69..ded462e50e7e 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PendingUploadRequest.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PendingUploadRequest.java @@ -30,7 +30,7 @@ public final class PendingUploadRequest implements JsonSerializable values() { return values(PendingUploadType.class); } + + /** + * Temporary blob reference. + */ + @Generated + public static final PendingUploadType TEMPORARY_BLOB_REFERENCE = fromString("TemporaryBlobReference"); + + /** + * Deprecated: the service never read this value and silently ignored it. Use TemporaryBlobReference instead. + */ + @Generated + public static final PendingUploadType BLOB_REFERENCE = fromString("BlobReference"); } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PromptDataGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PromptDataGenerationJobSource.java new file mode 100644 index 000000000000..f1c9e15d3a79 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PromptDataGenerationJobSource.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Prompt source for data generation jobs — inline text provided by the user. + */ +@Fluent +public final class PromptDataGenerationJobSource extends DataGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private DataGenerationJobSourceType type = DataGenerationJobSourceType.PROMPT; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * Inline prompt text (e.g., agent description, policy text, supplementary context). + */ + @Generated + private final String prompt; + + /** + * Creates an instance of PromptDataGenerationJobSource class. + * + * @param prompt the prompt value to set. + */ + @Generated + public PromptDataGenerationJobSource(String prompt) { + this.prompt = prompt; + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the PromptDataGenerationJobSource object itself. + */ + @Generated + public PromptDataGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the prompt property: Inline prompt text (e.g., agent description, policy text, supplementary context). + * + * @return the prompt value. + */ + @Generated + public String getPrompt() { + return this.prompt; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prompt", this.prompt); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PromptDataGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PromptDataGenerationJobSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PromptDataGenerationJobSource. + */ + @Generated + public static PromptDataGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String prompt = null; + DataGenerationJobSourceType type = DataGenerationJobSourceType.PROMPT; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("prompt".equals(fieldName)) { + prompt = reader.getString(); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + PromptDataGenerationJobSource deserializedPromptDataGenerationJobSource + = new PromptDataGenerationJobSource(prompt); + deserializedPromptDataGenerationJobSource.type = type; + deserializedPromptDataGenerationJobSource.description = description; + return deserializedPromptDataGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PromptEvaluatorGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PromptEvaluatorGenerationJobSource.java new file mode 100644 index 000000000000..d31c637c8cae --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/PromptEvaluatorGenerationJobSource.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Prompt source for evaluator generation jobs — inline text provided by the user. + */ +@Fluent +public final class PromptEvaluatorGenerationJobSource extends EvaluatorGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.PROMPT; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * Inline prompt text (e.g., agent description, policy text, supplementary context). + */ + @Generated + private final String prompt; + + /** + * Creates an instance of PromptEvaluatorGenerationJobSource class. + * + * @param prompt the prompt value to set. + */ + @Generated + public PromptEvaluatorGenerationJobSource(String prompt) { + this.prompt = prompt; + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public EvaluatorGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the PromptEvaluatorGenerationJobSource object itself. + */ + @Generated + public PromptEvaluatorGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the prompt property: Inline prompt text (e.g., agent description, policy text, supplementary context). + * + * @return the prompt value. + */ + @Generated + public String getPrompt() { + return this.prompt; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("prompt", this.prompt); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PromptEvaluatorGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PromptEvaluatorGenerationJobSource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PromptEvaluatorGenerationJobSource. + */ + @Generated + public static PromptEvaluatorGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String prompt = null; + EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.PROMPT; + String description = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("prompt".equals(fieldName)) { + prompt = reader.getString(); + } else if ("type".equals(fieldName)) { + type = EvaluatorGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else { + reader.skipChildren(); + } + } + PromptEvaluatorGenerationJobSource deserializedPromptEvaluatorGenerationJobSource + = new PromptEvaluatorGenerationJobSource(prompt); + deserializedPromptEvaluatorGenerationJobSource.type = type; + deserializedPromptEvaluatorGenerationJobSource.description = description; + return deserializedPromptEvaluatorGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java index f0537df8649c..1847525919b9 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java @@ -39,7 +39,7 @@ public final class RecurrenceTrigger extends Trigger { private OffsetDateTime endTime; /* - * Time zone for the recurrence schedule. + * Time zone for the recurrence schedule. Defaults to `UTC`. */ @Generated private TimeZone timeZone; @@ -88,7 +88,7 @@ public OffsetDateTime getEndTime() { } /** - * Get the timeZone property: Time zone for the recurrence schedule. + * Get the timeZone property: Time zone for the recurrence schedule. Defaults to `UTC`. * * @return the timeZone value. */ @@ -219,7 +219,7 @@ public RecurrenceTrigger setEndTime(OffsetDateTime endTime) { } /** - * Set the timeZone property: Time zone for the recurrence schedule. + * Set the timeZone property: Time zone for the recurrence schedule. Defaults to `UTC`. * * @param timeZone the timeZone value to set. * @return the RecurrenceTrigger object itself. diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RedTeam.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RedTeam.java index 6f4c47c64c8a..737b75fbdd90 100644 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RedTeam.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RedTeam.java @@ -44,8 +44,8 @@ public final class RedTeam implements JsonSerializable { private List attackStrategies; /* - * Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation - * result. + * Simulation-only or Simulation + Evaluation. If `true` the scan outputs conversation not evaluation result. The + * service defaults to `false` if a value is not specified by the caller. */ @Generated private Boolean simulationOnly; @@ -86,16 +86,6 @@ public final class RedTeam implements JsonSerializable { @Generated private final TargetConfig target; - /** - * Creates an instance of RedTeam class. - * - * @param target the target value to set. - */ - @Generated - public RedTeam(TargetConfig target) { - this.target = target; - } - /** * Get the name property: Identifier of the red team run. * @@ -173,8 +163,8 @@ public RedTeam setAttackStrategies(List attackStrategies) { } /** - * Get the simulationOnly property: Simulation-only or Simulation + Evaluation. Default false, if true the scan - * outputs conversation not evaluation result. + * Get the simulationOnly property: Simulation-only or Simulation + Evaluation. If `true` the scan outputs + * conversation not evaluation result. The service defaults to `false` if a value is not specified by the caller. * * @return the simulationOnly value. */ @@ -184,8 +174,8 @@ public Boolean isSimulationOnly() { } /** - * Set the simulationOnly property: Simulation-only or Simulation + Evaluation. Default false, if true the scan - * outputs conversation not evaluation result. + * Set the simulationOnly property: Simulation-only or Simulation + Evaluation. If `true` the scan outputs + * conversation not evaluation result. The service defaults to `false` if a value is not specified by the caller. * * @param simulationOnly the simulationOnly value to set. * @return the RedTeam object itself. @@ -395,4 +385,14 @@ public static RedTeam fromJson(JsonReader jsonReader) throws IOException { return deserializedRedTeam; }); } + + /** + * Creates an instance of RedTeam class. + * + * @param target the target value to set. + */ + @Generated + public RedTeam(TargetConfig target) { + this.target = target; + } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Routine.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Routine.java new file mode 100644 index 000000000000..15b15aac5444 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Routine.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; +import java.util.Map; + +/** + * A routine definition returned by the service. + */ +@Immutable +public final class Routine implements JsonSerializable { + + /* + * The routine name. + */ + @Generated + private String name; + + /* + * A human-readable description of the routine. + */ + @Generated + private String description; + + /* + * Whether the routine is enabled. + */ + @Generated + private final boolean enabled; + + /* + * The triggers configured for the routine. + */ + @Generated + private Map triggers; + + /* + * The action executed when the routine fires. + */ + @Generated + private RoutineAction action; + + /* + * The time when the routine was created. + */ + @Generated + private Long createdAt; + + /* + * The time when the routine was last updated. + */ + @Generated + private Long updatedAt; + + /** + * Get the name property: The routine name. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the description property: A human-readable description of the routine. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the enabled property: Whether the routine is enabled. + * + * @return the enabled value. + */ + @Generated + public boolean isEnabled() { + return this.enabled; + } + + /** + * Get the triggers property: The triggers configured for the routine. + * + * @return the triggers value. + */ + @Generated + public Map getTriggers() { + return this.triggers; + } + + /** + * Get the action property: The action executed when the routine fires. + * + * @return the action value. + */ + @Generated + public RoutineAction getAction() { + return this.action; + } + + /** + * Get the createdAt property: The time when the routine was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + if (this.createdAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the updatedAt property: The time when the routine was last updated. + * + * @return the updatedAt value. + */ + @Generated + public OffsetDateTime getUpdatedAt() { + if (this.updatedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.updatedAt), ZoneOffset.UTC); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("triggers", this.triggers, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("action", this.action); + jsonWriter.writeNumberField("created_at", this.createdAt); + jsonWriter.writeNumberField("updated_at", this.updatedAt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Routine from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Routine if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Routine. + */ + @Generated + public static Routine fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + boolean enabled = false; + String name = null; + String description = null; + Map triggers = null; + RoutineAction action = null; + Long createdAt = null; + Long updatedAt = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("enabled".equals(fieldName)) { + enabled = reader.getBoolean(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("triggers".equals(fieldName)) { + triggers = reader.readMap(reader1 -> RoutineTrigger.fromJson(reader1)); + } else if ("action".equals(fieldName)) { + action = RoutineAction.fromJson(reader); + } else if ("created_at".equals(fieldName)) { + createdAt = reader.getNullable(JsonReader::getLong); + } else if ("updated_at".equals(fieldName)) { + updatedAt = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + Routine deserializedRoutine = new Routine(enabled); + deserializedRoutine.name = name; + deserializedRoutine.description = description; + deserializedRoutine.triggers = triggers; + deserializedRoutine.action = action; + deserializedRoutine.createdAt = createdAt; + deserializedRoutine.updatedAt = updatedAt; + return deserializedRoutine; + }); + } + + /** + * Creates an instance of Routine class. + * + * @param enabled the enabled value to set. + */ + @Generated + private Routine(boolean enabled) { + this.enabled = enabled; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContent.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineAction.java similarity index 62% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContent.java rename to sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineAction.java index 42956286e62c..8e3bddb13df7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/InputContent.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineAction.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.projects.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,31 +12,31 @@ import java.io.IOException; /** - * The InputContent model. + * Base model for a routine action. */ @Immutable -public class InputContent implements JsonSerializable { +public class RoutineAction implements JsonSerializable { /* - * The type property. + * The action type. */ @Generated - private InputContentType type = InputContentType.fromString("InputContent"); + private RoutineActionType type = RoutineActionType.fromString("RoutineAction"); /** - * Creates an instance of InputContent class. + * Creates an instance of RoutineAction class. */ @Generated - public InputContent() { + public RoutineAction() { } /** - * Get the type property: The type property. + * Get the type property: The action type. * * @return the type value. */ @Generated - public InputContentType getType() { + public RoutineActionType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of InputContent from the JsonReader. + * Reads an instance of RoutineAction from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of InputContent if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of RoutineAction 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 InputContent. + * @throws IOException If an error occurs while reading the RoutineAction. */ @Generated - public static InputContent fromJson(JsonReader jsonReader) throws IOException { + public static RoutineAction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,12 +77,10 @@ public static InputContent fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("input_text".equals(discriminatorValue)) { - return InputContentInputTextContent.fromJson(readerToUse.reset()); - } else if ("input_image".equals(discriminatorValue)) { - return InputContentInputImageContent.fromJson(readerToUse.reset()); - } else if ("input_file".equals(discriminatorValue)) { - return InputContentInputFileContent.fromJson(readerToUse.reset()); + if ("invoke_agent_responses_api".equals(discriminatorValue)) { + return InvokeAgentResponsesApiRoutineAction.fromJson(readerToUse.reset()); + } else if ("invoke_agent_invocations_api".equals(discriminatorValue)) { + return InvokeAgentInvocationsApiRoutineAction.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -91,19 +89,19 @@ public static InputContent fromJson(JsonReader jsonReader) throws IOException { } @Generated - static InputContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static RoutineAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - InputContent deserializedInputContent = new InputContent(); + RoutineAction deserializedRoutineAction = new RoutineAction(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedInputContent.type = InputContentType.fromString(reader.getString()); + deserializedRoutineAction.type = RoutineActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedInputContent; + return deserializedRoutineAction; }); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineActionType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineActionType.java new file mode 100644 index 000000000000..3e80340f127d --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineActionType.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.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The discriminator values supported for routine actions. + */ +public final class RoutineActionType extends ExpandableStringEnum { + + /** + * Dispatches through the responses API. + */ + @Generated + public static final RoutineActionType INVOKE_AGENT_RESPONSES_API = fromString("invoke_agent_responses_api"); + + /** + * Dispatches through the raw invocations API. + */ + @Generated + public static final RoutineActionType INVOKE_AGENT_INVOCATIONS_API = fromString("invoke_agent_invocations_api"); + + /** + * Creates a new instance of RoutineActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RoutineActionType() { + } + + /** + * Creates or finds a RoutineActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutineActionType. + */ + @Generated + public static RoutineActionType fromString(String name) { + return fromString(name, RoutineActionType.class); + } + + /** + * Gets known RoutineActionType values. + * + * @return known RoutineActionType values. + */ + @Generated + public static Collection values() { + return values(RoutineActionType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineAttemptSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineAttemptSource.java new file mode 100644 index 000000000000..37c42a477abb --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineAttemptSource.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Known source paths that can produce a routine run. + */ +public final class RoutineAttemptSource extends ExpandableStringEnum { + + /** + * A dispatch fired from an event delivery. + */ + @Generated + public static final RoutineAttemptSource EVENT_FIRE = fromString("event_fire"); + + /** + * A dispatch executed synchronously by a direct request. + */ + @Generated + public static final RoutineAttemptSource MANUAL_DISPATCH = fromString("manual_dispatch"); + + /** + * A dispatch executed asynchronously from the dispatch queue. + */ + @Generated + public static final RoutineAttemptSource QUEUED_DISPATCH = fromString("queued_dispatch"); + + /** + * A dispatch fired from a schedule delivery. + */ + @Generated + public static final RoutineAttemptSource SCHEDULE_DELIVERY = fromString("schedule_delivery"); + + /** + * A dispatch fired from a timer delivery. + */ + @Generated + public static final RoutineAttemptSource TIMER_DELIVERY = fromString("timer_delivery"); + + /** + * Creates a new instance of RoutineAttemptSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RoutineAttemptSource() { + } + + /** + * Creates or finds a RoutineAttemptSource from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutineAttemptSource. + */ + @Generated + public static RoutineAttemptSource fromString(String name) { + return fromString(name, RoutineAttemptSource.class); + } + + /** + * Gets known RoutineAttemptSource values. + * + * @return known RoutineAttemptSource values. + */ + @Generated + public static Collection values() { + return values(RoutineAttemptSource.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineDispatchPayload.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineDispatchPayload.java new file mode 100644 index 000000000000..9175dc374bfc --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineDispatchPayload.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base model for a manual dispatch payload. + */ +@Immutable +public class RoutineDispatchPayload implements JsonSerializable { + + /* + * The manual dispatch payload type. + */ + @Generated + private RoutineDispatchPayloadType type = RoutineDispatchPayloadType.fromString("RoutineDispatchPayload"); + + /** + * Creates an instance of RoutineDispatchPayload class. + */ + @Generated + public RoutineDispatchPayload() { + } + + /** + * Get the type property: The manual dispatch payload type. + * + * @return the type value. + */ + @Generated + public RoutineDispatchPayloadType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutineDispatchPayload from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutineDispatchPayload 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 RoutineDispatchPayload. + */ + @Generated + public static RoutineDispatchPayload fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + // Prepare for reading + readerToUse.nextToken(); + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("type".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("invoke_agent_responses_api".equals(discriminatorValue)) { + return InvokeAgentResponsesApiDispatchPayload.fromJson(readerToUse.reset()); + } else if ("invoke_agent_invocations_api".equals(discriminatorValue)) { + return InvokeAgentInvocationsApiDispatchPayload.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + @Generated + static RoutineDispatchPayload fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutineDispatchPayload deserializedRoutineDispatchPayload = new RoutineDispatchPayload(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedRoutineDispatchPayload.type = RoutineDispatchPayloadType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedRoutineDispatchPayload; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineDispatchPayloadType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineDispatchPayloadType.java new file mode 100644 index 000000000000..eac29c462542 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineDispatchPayloadType.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The discriminator values supported for manual routine dispatch payloads. + */ +public final class RoutineDispatchPayloadType extends ExpandableStringEnum { + + /** + * A manual payload for a responses API routine dispatch. + */ + @Generated + public static final RoutineDispatchPayloadType INVOKE_AGENT_RESPONSES_API + = fromString("invoke_agent_responses_api"); + + /** + * A manual payload for an invocations API routine dispatch. + */ + @Generated + public static final RoutineDispatchPayloadType INVOKE_AGENT_INVOCATIONS_API + = fromString("invoke_agent_invocations_api"); + + /** + * Creates a new instance of RoutineDispatchPayloadType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RoutineDispatchPayloadType() { + } + + /** + * Creates or finds a RoutineDispatchPayloadType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutineDispatchPayloadType. + */ + @Generated + public static RoutineDispatchPayloadType fromString(String name) { + return fromString(name, RoutineDispatchPayloadType.class); + } + + /** + * Gets known RoutineDispatchPayloadType values. + * + * @return known RoutineDispatchPayloadType values. + */ + @Generated + public static Collection values() { + return values(RoutineDispatchPayloadType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineRun.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineRun.java new file mode 100644 index 000000000000..3c9700fa6789 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineRun.java @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * A single routine run returned from the run history API. + */ +@Immutable +public final class RoutineRun implements JsonSerializable { + + /* + * The unique run identifier for the routine attempt. + */ + @Generated + private String id; + + /* + * The run status. + */ + @Generated + private String status; + + /* + * The AgentExtensions lifecycle phase for the routine attempt. + */ + @Generated + private RoutineRunPhase phase; + + /* + * The trigger type that produced the routine attempt. + */ + @Generated + private RoutineTriggerType triggerType; + + /* + * The source path that created the routine attempt. + */ + @Generated + private RoutineAttemptSource attemptSource; + + /* + * The action type dispatched for the routine attempt. + */ + @Generated + private RoutineActionType actionType; + + /* + * The logical trigger time recorded for the routine attempt. + */ + @Generated + private Long triggeredAt; + + /* + * The time when the underlying run started. + */ + @Generated + private Long startedAt; + + /* + * The time when the underlying run reached a terminal state. + */ + @Generated + private Long endedAt; + + /* + * The dispatch identifier associated with the routine attempt. + */ + @Generated + private String dispatchId; + + /* + * The downstream action correlation identifier, when available. + */ + @Generated + private String actionCorrelationId; + + /* + * The downstream response or invocation identifier, when available. + */ + @Generated + private String responseId; + + /* + * The workspace task identifier linked to the routine attempt, when available. + */ + @Generated + private String taskId; + + /* + * The fully qualified error type captured for a failed attempt, when available. + */ + @Generated + private String errorType; + + /* + * The truncated failure message captured for a failed attempt, when available. + */ + @Generated + private String errorMessage; + + /** + * Get the id property: The unique run identifier for the routine attempt. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the status property: The run status. + * + * @return the status value. + */ + @Generated + public String getStatus() { + return this.status; + } + + /** + * Get the phase property: The AgentExtensions lifecycle phase for the routine attempt. + * + * @return the phase value. + */ + @Generated + public RoutineRunPhase getPhase() { + return this.phase; + } + + /** + * Get the triggerType property: The trigger type that produced the routine attempt. + * + * @return the triggerType value. + */ + @Generated + public RoutineTriggerType getTriggerType() { + return this.triggerType; + } + + /** + * Get the attemptSource property: The source path that created the routine attempt. + * + * @return the attemptSource value. + */ + @Generated + public RoutineAttemptSource getAttemptSource() { + return this.attemptSource; + } + + /** + * Get the actionType property: The action type dispatched for the routine attempt. + * + * @return the actionType value. + */ + @Generated + public RoutineActionType getActionType() { + return this.actionType; + } + + /** + * Get the triggeredAt property: The logical trigger time recorded for the routine attempt. + * + * @return the triggeredAt value. + */ + @Generated + public OffsetDateTime getTriggeredAt() { + if (this.triggeredAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.triggeredAt), ZoneOffset.UTC); + } + + /** + * Get the startedAt property: The time when the underlying run started. + * + * @return the startedAt value. + */ + @Generated + public OffsetDateTime getStartedAt() { + if (this.startedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.startedAt), ZoneOffset.UTC); + } + + /** + * Get the endedAt property: The time when the underlying run reached a terminal state. + * + * @return the endedAt value. + */ + @Generated + public OffsetDateTime getEndedAt() { + if (this.endedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.endedAt), ZoneOffset.UTC); + } + + /** + * Get the dispatchId property: The dispatch identifier associated with the routine attempt. + * + * @return the dispatchId value. + */ + @Generated + public String getDispatchId() { + return this.dispatchId; + } + + /** + * Get the actionCorrelationId property: The downstream action correlation identifier, when available. + * + * @return the actionCorrelationId value. + */ + @Generated + public String getActionCorrelationId() { + return this.actionCorrelationId; + } + + /** + * Get the responseId property: The downstream response or invocation identifier, when available. + * + * @return the responseId value. + */ + @Generated + public String getResponseId() { + return this.responseId; + } + + /** + * Get the taskId property: The workspace task identifier linked to the routine attempt, when available. + * + * @return the taskId value. + */ + @Generated + public String getTaskId() { + return this.taskId; + } + + /** + * Get the errorType property: The fully qualified error type captured for a failed attempt, when available. + * + * @return the errorType value. + */ + @Generated + public String getErrorType() { + return this.errorType; + } + + /** + * Get the errorMessage property: The truncated failure message captured for a failed attempt, when available. + * + * @return the errorMessage value. + */ + @Generated + public String getErrorMessage() { + return this.errorMessage; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("phase", this.phase == null ? null : this.phase.toString()); + jsonWriter.writeStringField("trigger_type", this.triggerType == null ? null : this.triggerType.toString()); + jsonWriter.writeStringField("trigger_name", this.triggerName); + jsonWriter.writeStringField("attempt_source", + this.attemptSource == null ? null : this.attemptSource.toString()); + jsonWriter.writeStringField("action_type", this.actionType == null ? null : this.actionType.toString()); + jsonWriter.writeStringField("agent_id", this.agentId); + jsonWriter.writeStringField("agent_endpoint_id", this.agentEndpointId); + jsonWriter.writeStringField("conversation_id", this.conversationId); + jsonWriter.writeStringField("session_id", this.sessionId); + jsonWriter.writeNumberField("triggered_at", this.triggeredAt); + jsonWriter.writeNumberField("scheduled_fire_at", this.scheduledFireAt); + jsonWriter.writeNumberField("started_at", this.startedAt); + jsonWriter.writeNumberField("ended_at", this.endedAt); + jsonWriter.writeStringField("dispatch_id", this.dispatchId); + jsonWriter.writeStringField("action_correlation_id", this.actionCorrelationId); + jsonWriter.writeStringField("response_id", this.responseId); + jsonWriter.writeStringField("task_id", this.taskId); + jsonWriter.writeNumberField("error_status_code", this.errorStatusCode); + jsonWriter.writeStringField("error_type", this.errorType); + jsonWriter.writeStringField("error_message", this.errorMessage); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RoutineRun from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RoutineRun if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RoutineRun. + */ + @Generated + public static RoutineRun fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RoutineRun deserializedRoutineRun = new RoutineRun(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + deserializedRoutineRun.id = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedRoutineRun.status = reader.getString(); + } else if ("phase".equals(fieldName)) { + deserializedRoutineRun.phase = RoutineRunPhase.fromString(reader.getString()); + } else if ("trigger_type".equals(fieldName)) { + deserializedRoutineRun.triggerType = RoutineTriggerType.fromString(reader.getString()); + } else if ("trigger_name".equals(fieldName)) { + deserializedRoutineRun.triggerName = reader.getString(); + } else if ("attempt_source".equals(fieldName)) { + deserializedRoutineRun.attemptSource = RoutineAttemptSource.fromString(reader.getString()); + } else if ("action_type".equals(fieldName)) { + deserializedRoutineRun.actionType = RoutineActionType.fromString(reader.getString()); + } else if ("agent_id".equals(fieldName)) { + deserializedRoutineRun.agentId = reader.getString(); + } else if ("agent_endpoint_id".equals(fieldName)) { + deserializedRoutineRun.agentEndpointId = reader.getString(); + } else if ("conversation_id".equals(fieldName)) { + deserializedRoutineRun.conversationId = reader.getString(); + } else if ("session_id".equals(fieldName)) { + deserializedRoutineRun.sessionId = reader.getString(); + } else if ("triggered_at".equals(fieldName)) { + deserializedRoutineRun.triggeredAt = reader.getNullable(JsonReader::getLong); + } else if ("scheduled_fire_at".equals(fieldName)) { + deserializedRoutineRun.scheduledFireAt = reader.getNullable(JsonReader::getLong); + } else if ("started_at".equals(fieldName)) { + deserializedRoutineRun.startedAt = reader.getNullable(JsonReader::getLong); + } else if ("ended_at".equals(fieldName)) { + deserializedRoutineRun.endedAt = reader.getNullable(JsonReader::getLong); + } else if ("dispatch_id".equals(fieldName)) { + deserializedRoutineRun.dispatchId = reader.getString(); + } else if ("action_correlation_id".equals(fieldName)) { + deserializedRoutineRun.actionCorrelationId = reader.getString(); + } else if ("response_id".equals(fieldName)) { + deserializedRoutineRun.responseId = reader.getString(); + } else if ("task_id".equals(fieldName)) { + deserializedRoutineRun.taskId = reader.getString(); + } else if ("error_status_code".equals(fieldName)) { + deserializedRoutineRun.errorStatusCode = reader.getNullable(JsonReader::getInt); + } else if ("error_type".equals(fieldName)) { + deserializedRoutineRun.errorType = reader.getString(); + } else if ("error_message".equals(fieldName)) { + deserializedRoutineRun.errorMessage = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedRoutineRun; + }); + } + + /* + * The configured trigger name that produced the routine attempt. + */ + @Generated + private String triggerName; + + /* + * The project-scoped agent identifier recorded for the routine attempt. + */ + @Generated + private String agentId; + + /* + * The legacy endpoint-scoped agent identifier recorded for the routine attempt. + */ + @Generated + private String agentEndpointId; + + /* + * The conversation identifier used by a responses API dispatch. + */ + @Generated + private String conversationId; + + /* + * The hosted-agent session identifier used by an invocations API dispatch. + */ + @Generated + private String sessionId; + + /* + * The scheduled fire time recorded for timer and schedule deliveries. + */ + @Generated + private Long scheduledFireAt; + + /* + * The downstream error status code captured for a failed attempt, when available. + */ + @Generated + private Integer errorStatusCode; + + /** + * Creates an instance of RoutineRun class. + */ + @Generated + private RoutineRun() { + } + + /** + * Get the triggerName property: The configured trigger name that produced the routine attempt. + * + * @return the triggerName value. + */ + @Generated + public String getTriggerName() { + return this.triggerName; + } + + /** + * Get the agentId property: The project-scoped agent identifier recorded for the routine attempt. + * + * @return the agentId value. + */ + @Generated + public String getAgentId() { + return this.agentId; + } + + /** + * Get the agentEndpointId property: The legacy endpoint-scoped agent identifier recorded for the routine attempt. + * + * @return the agentEndpointId value. + */ + @Generated + public String getAgentEndpointId() { + return this.agentEndpointId; + } + + /** + * Get the conversationId property: The conversation identifier used by a responses API dispatch. + * + * @return the conversationId value. + */ + @Generated + public String getConversationId() { + return this.conversationId; + } + + /** + * Get the sessionId property: The hosted-agent session identifier used by an invocations API dispatch. + * + * @return the sessionId value. + */ + @Generated + public String getSessionId() { + return this.sessionId; + } + + /** + * Get the scheduledFireAt property: The scheduled fire time recorded for timer and schedule deliveries. + * + * @return the scheduledFireAt value. + */ + @Generated + public OffsetDateTime getScheduledFireAt() { + if (this.scheduledFireAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.scheduledFireAt), ZoneOffset.UTC); + } + + /** + * Get the errorStatusCode property: The downstream error status code captured for a failed attempt, when available. + * + * @return the errorStatusCode value. + */ + @Generated + public Integer getErrorStatusCode() { + return this.errorStatusCode; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineRunPhase.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineRunPhase.java new file mode 100644 index 000000000000..95992c6379a2 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineRunPhase.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Known lifecycle phases recorded for a routine run. + */ +public final class RoutineRunPhase extends ExpandableStringEnum { + + /** + * The run is queued for dispatch. + */ + @Generated + public static final RoutineRunPhase QUEUED = fromString("queued"); + + /** + * The run is currently being dispatched. + */ + @Generated + public static final RoutineRunPhase DISPATCHING = fromString("dispatching"); + + /** + * The run finished successfully. + */ + @Generated + public static final RoutineRunPhase COMPLETED = fromString("completed"); + + /** + * The run finished with an error. + */ + @Generated + public static final RoutineRunPhase FAILED = fromString("failed"); + + /** + * Creates a new instance of RoutineRunPhase value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RoutineRunPhase() { + } + + /** + * Creates or finds a RoutineRunPhase from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutineRunPhase. + */ + @Generated + public static RoutineRunPhase fromString(String name) { + return fromString(name, RoutineRunPhase.class); + } + + /** + * Gets known RoutineRunPhase values. + * + * @return known RoutineRunPhase values. + */ + @Generated + public static Collection values() { + return values(RoutineRunPhase.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/Annotation.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineTrigger.java similarity index 60% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/Annotation.java rename to sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineTrigger.java index c976428380e8..9077eb6c1804 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/Annotation.java +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineTrigger.java @@ -1,7 +1,7 @@ // 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.implementation.models; +package com.azure.ai.projects.models; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; @@ -12,31 +12,31 @@ import java.io.IOException; /** - * An annotation that applies to a span of output text. + * Base model for a routine trigger. */ @Immutable -public class Annotation implements JsonSerializable { +public class RoutineTrigger implements JsonSerializable { /* - * The type property. + * The trigger type. */ @Generated - private AnnotationType type = AnnotationType.fromString("Annotation"); + private RoutineTriggerType type = RoutineTriggerType.fromString("RoutineTrigger"); /** - * Creates an instance of Annotation class. + * Creates an instance of RoutineTrigger class. */ @Generated - public Annotation() { + public RoutineTrigger() { } /** - * Get the type property: The type property. + * Get the type property: The trigger type. * * @return the type value. */ @Generated - public AnnotationType getType() { + public RoutineTriggerType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of Annotation from the JsonReader. + * Reads an instance of RoutineTrigger from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of Annotation 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 Annotation. + * @return An instance of RoutineTrigger 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 RoutineTrigger. */ @Generated - public static Annotation fromJson(JsonReader jsonReader) throws IOException { + public static RoutineTrigger fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,14 +77,14 @@ public static Annotation fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("file_citation".equals(discriminatorValue)) { - return FileCitationBody.fromJson(readerToUse.reset()); - } else if ("url_citation".equals(discriminatorValue)) { - return UrlCitationBody.fromJson(readerToUse.reset()); - } else if ("container_file_citation".equals(discriminatorValue)) { - return ContainerFileCitationBody.fromJson(readerToUse.reset()); - } else if ("file_path".equals(discriminatorValue)) { - return FilePath.fromJson(readerToUse.reset()); + if ("schedule".equals(discriminatorValue)) { + return ScheduleRoutineTrigger.fromJson(readerToUse.reset()); + } else if ("timer".equals(discriminatorValue)) { + return TimerRoutineTrigger.fromJson(readerToUse.reset()); + } else if ("github_issue".equals(discriminatorValue)) { + return GitHubIssueRoutineTrigger.fromJson(readerToUse.reset()); + } else if ("custom".equals(discriminatorValue)) { + return CustomRoutineTrigger.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -93,19 +93,19 @@ public static Annotation fromJson(JsonReader jsonReader) throws IOException { } @Generated - static Annotation fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static RoutineTrigger fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - Annotation deserializedAnnotation = new Annotation(); + RoutineTrigger deserializedRoutineTrigger = new RoutineTrigger(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedAnnotation.type = AnnotationType.fromString(reader.getString()); + deserializedRoutineTrigger.type = RoutineTriggerType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedAnnotation; + return deserializedRoutineTrigger; }); } } diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineTriggerType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineTriggerType.java new file mode 100644 index 000000000000..ae976b285c4c --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RoutineTriggerType.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The discriminator values supported for routine triggers. + */ +public final class RoutineTriggerType extends ExpandableStringEnum { + + /** + * A recurring cron-based trigger. + */ + @Generated + public static final RoutineTriggerType SCHEDULE = fromString("schedule"); + + /** + * A one-shot timer trigger. + */ + @Generated + public static final RoutineTriggerType TIMER = fromString("timer"); + + /** + * Creates a new instance of RoutineTriggerType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public RoutineTriggerType() { + } + + /** + * Creates or finds a RoutineTriggerType from its string representation. + * + * @param name a name to look for. + * @return the corresponding RoutineTriggerType. + */ + @Generated + public static RoutineTriggerType fromString(String name) { + return fromString(name, RoutineTriggerType.class); + } + + /** + * Gets known RoutineTriggerType values. + * + * @return known RoutineTriggerType values. + */ + @Generated + public static Collection values() { + return values(RoutineTriggerType.class); + } + + /** + * A custom event trigger. + */ + @Generated + public static final RoutineTriggerType CUSTOM = fromString("custom"); + + /** + * A GitHub issue trigger. + */ + @Generated + public static final RoutineTriggerType GITHUB_ISSUE = fromString("github_issue"); +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RubricBasedEvaluatorDefinition.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RubricBasedEvaluatorDefinition.java new file mode 100644 index 000000000000..34b69051a41f --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/RubricBasedEvaluatorDefinition.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * Rubric-based evaluator definition — stores dimensions produced by the generate API. Used for both quality and safety + * evaluators. + */ +@Fluent +public final class RubricBasedEvaluatorDefinition extends EvaluatorDefinition { + + /* + * The type of evaluator definition + */ + @Generated + private EvaluatorDefinitionType type = EvaluatorDefinitionType.RUBRIC; + + /* + * The set of dimensions — the scoring blueprint used by the LLM judge. Quality evaluators include a non-editable + * residual dimension with id 'general_quality' (always_applicable: true); safety evaluators include + * 'general_policy_compliance'. Both use the same Dimension structure. + */ + @Generated + private final List dimensions; + + /* + * Pass/fail threshold for the aggregate rubric score, on the same normalized 0.0-1.0 scale as the emitted `score`. + * When the runtime weighted average meets or exceeds this value, the result is `pass`. Defaults to 0.5 (equivalent + * to a raw 1-5 weighted average of 3.0). The 'any dimension scored 1 → fail' rule still applies regardless of this + * threshold. + */ + @Generated + private Double passThreshold; + + /** + * Creates an instance of RubricBasedEvaluatorDefinition class. + * + * @param dimensions the dimensions value to set. + */ + @Generated + public RubricBasedEvaluatorDefinition(List dimensions) { + this.dimensions = dimensions; + } + + /** + * Get the type property: The type of evaluator definition. + * + * @return the type value. + */ + @Generated + @Override + public EvaluatorDefinitionType getType() { + return this.type; + } + + /** + * Get the dimensions property: The set of dimensions — the scoring blueprint used by the LLM judge. Quality + * evaluators include a non-editable residual dimension with id 'general_quality' (always_applicable: true); safety + * evaluators include 'general_policy_compliance'. Both use the same Dimension structure. + * + * @return the dimensions value. + */ + @Generated + public List getDimensions() { + return this.dimensions; + } + + /** + * Get the passThreshold property: Pass/fail threshold for the aggregate rubric score, on the same normalized + * 0.0-1.0 scale as the emitted `score`. When the runtime weighted average meets or exceeds this value, the result + * is `pass`. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension scored 1 → fail' + * rule still applies regardless of this threshold. + * + * @return the passThreshold value. + */ + @Generated + public Double getPassThreshold() { + return this.passThreshold; + } + + /** + * Set the passThreshold property: Pass/fail threshold for the aggregate rubric score, on the same normalized + * 0.0-1.0 scale as the emitted `score`. When the runtime weighted average meets or exceeds this value, the result + * is `pass`. Defaults to 0.5 (equivalent to a raw 1-5 weighted average of 3.0). The 'any dimension scored 1 → fail' + * rule still applies regardless of this threshold. + * + * @param passThreshold the passThreshold value to set. + * @return the RubricBasedEvaluatorDefinition object itself. + */ + @Generated + public RubricBasedEvaluatorDefinition setPassThreshold(Double passThreshold) { + this.passThreshold = passThreshold; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RubricBasedEvaluatorDefinition setInitParameters(Map initParameters) { + super.setInitParameters(initParameters); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RubricBasedEvaluatorDefinition setDataSchema(Map dataSchema) { + super.setDataSchema(dataSchema); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public RubricBasedEvaluatorDefinition setMetrics(Map metrics) { + super.setMetrics(metrics); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("init_parameters", getInitParameters(), (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeMapField("data_schema", getDataSchema(), (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeMapField("metrics", getMetrics(), (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("dimensions", this.dimensions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeNumberField("pass_threshold", this.passThreshold); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RubricBasedEvaluatorDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RubricBasedEvaluatorDefinition if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RubricBasedEvaluatorDefinition. + */ + @Generated + public static RubricBasedEvaluatorDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + Map initParameters = null; + Map dataSchema = null; + Map metrics = null; + List dimensions = null; + EvaluatorDefinitionType type = EvaluatorDefinitionType.RUBRIC; + Double passThreshold = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("init_parameters".equals(fieldName)) { + initParameters = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("data_schema".equals(fieldName)) { + dataSchema = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("metrics".equals(fieldName)) { + metrics = reader.readMap(reader1 -> EvaluatorMetric.fromJson(reader1)); + } else if ("dimensions".equals(fieldName)) { + dimensions = reader.readArray(reader1 -> Dimension.fromJson(reader1)); + } else if ("type".equals(fieldName)) { + type = EvaluatorDefinitionType.fromString(reader.getString()); + } else if ("pass_threshold".equals(fieldName)) { + passThreshold = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + RubricBasedEvaluatorDefinition deserializedRubricBasedEvaluatorDefinition + = new RubricBasedEvaluatorDefinition(dimensions); + deserializedRubricBasedEvaluatorDefinition.setInitParameters(initParameters); + deserializedRubricBasedEvaluatorDefinition.setDataSchema(dataSchema); + deserializedRubricBasedEvaluatorDefinition.setMetrics(metrics); + deserializedRubricBasedEvaluatorDefinition.type = type; + deserializedRubricBasedEvaluatorDefinition.passThreshold = passThreshold; + return deserializedRubricBasedEvaluatorDefinition; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ScheduleRoutineTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ScheduleRoutineTrigger.java new file mode 100644 index 000000000000..49b9207b5c82 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ScheduleRoutineTrigger.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +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; + +/** + * A recurring cron-based routine trigger. + */ +@Immutable +public final class ScheduleRoutineTrigger extends RoutineTrigger { + + /* + * The trigger type. + */ + @Generated + private RoutineTriggerType type = RoutineTriggerType.SCHEDULE; + + /* + * A 5-field cron expression. The service enforces a minimum interval of five minutes by default. + */ + @Generated + private final String cronExpression; + + /* + * An IANA or Windows time zone identifier for the schedule. + */ + @Generated + private final String timeZone; + + /** + * Creates an instance of ScheduleRoutineTrigger class. + * + * @param cronExpression the cronExpression value to set. + * @param timeZone the timeZone value to set. + */ + @Generated + public ScheduleRoutineTrigger(String cronExpression, String timeZone) { + this.cronExpression = cronExpression; + this.timeZone = timeZone; + } + + /** + * Get the type property: The trigger type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineTriggerType getType() { + return this.type; + } + + /** + * Get the cronExpression property: A 5-field cron expression. The service enforces a minimum interval of five + * minutes by default. + * + * @return the cronExpression value. + */ + @Generated + public String getCronExpression() { + return this.cronExpression; + } + + /** + * Get the timeZone property: An IANA or Windows time zone identifier for the schedule. + * + * @return the timeZone value. + */ + @Generated + public String getTimeZone() { + return this.timeZone; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("cron_expression", this.cronExpression); + jsonWriter.writeStringField("time_zone", this.timeZone); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ScheduleRoutineTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ScheduleRoutineTrigger if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ScheduleRoutineTrigger. + */ + @Generated + public static ScheduleRoutineTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String cronExpression = null; + String timeZone = null; + RoutineTriggerType type = RoutineTriggerType.SCHEDULE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("cron_expression".equals(fieldName)) { + cronExpression = reader.getString(); + } else if ("time_zone".equals(fieldName)) { + timeZone = reader.getString(); + } else if ("type".equals(fieldName)) { + type = RoutineTriggerType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ScheduleRoutineTrigger deserializedScheduleRoutineTrigger + = new ScheduleRoutineTrigger(cronExpression, timeZone); + deserializedScheduleRoutineTrigger.type = type; + return deserializedScheduleRoutineTrigger; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SimpleQnADataGenerationJobOptions.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SimpleQnADataGenerationJobOptions.java new file mode 100644 index 000000000000..a402185b034d --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SimpleQnADataGenerationJobOptions.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The options for a data generation job with SimpleQnA type. + */ +@Fluent +public final class SimpleQnADataGenerationJobOptions extends DataGenerationJobOptions { + + /* + * The data generation job type. + */ + @Generated + private DataGenerationJobType type = DataGenerationJobType.SIMPLE_QNA; + + /* + * The question types to generate. Used only for fine-tuning scenarios. + */ + @Generated + private List questionTypes; + + /** + * Creates an instance of SimpleQnADataGenerationJobOptions class. + * + * @param maxSamples the maxSamples value to set. + */ + @Generated + public SimpleQnADataGenerationJobOptions(int maxSamples) { + super(maxSamples); + } + + /** + * Get the type property: The data generation job type. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobType getType() { + return this.type; + } + + /** + * Get the questionTypes property: The question types to generate. Used only for fine-tuning scenarios. + * + * @return the questionTypes value. + */ + @Generated + public List getQuestionTypes() { + return this.questionTypes; + } + + /** + * Set the questionTypes property: The question types to generate. Used only for fine-tuning scenarios. + * + * @param questionTypes the questionTypes value to set. + * @return the SimpleQnADataGenerationJobOptions object itself. + */ + @Generated + public SimpleQnADataGenerationJobOptions setQuestionTypes(List questionTypes) { + this.questionTypes = questionTypes; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SimpleQnADataGenerationJobOptions setTrainSplit(Double trainSplit) { + super.setTrainSplit(trainSplit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public SimpleQnADataGenerationJobOptions setModelOptions(DataGenerationModelOptions modelOptions) { + super.setModelOptions(modelOptions); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("max_samples", getMaxSamples()); + jsonWriter.writeNumberField("train_split", getTrainSplit()); + jsonWriter.writeJsonField("model_options", getModelOptions()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("question_types", this.questionTypes, + (writer, element) -> writer.writeString(element == null ? null : element.toString())); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SimpleQnADataGenerationJobOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SimpleQnADataGenerationJobOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SimpleQnADataGenerationJobOptions. + */ + @Generated + public static SimpleQnADataGenerationJobOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int maxSamples = 0; + Double trainSplit = null; + DataGenerationModelOptions modelOptions = null; + DataGenerationJobType type = DataGenerationJobType.SIMPLE_QNA; + List questionTypes = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_samples".equals(fieldName)) { + maxSamples = reader.getInt(); + } else if ("train_split".equals(fieldName)) { + trainSplit = reader.getNullable(JsonReader::getDouble); + } else if ("model_options".equals(fieldName)) { + modelOptions = DataGenerationModelOptions.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobType.fromString(reader.getString()); + } else if ("question_types".equals(fieldName)) { + questionTypes + = reader.readArray(reader1 -> SimpleQnAFineTuningQuestionType.fromString(reader1.getString())); + } else { + reader.skipChildren(); + } + } + SimpleQnADataGenerationJobOptions deserializedSimpleQnADataGenerationJobOptions + = new SimpleQnADataGenerationJobOptions(maxSamples); + deserializedSimpleQnADataGenerationJobOptions.setTrainSplit(trainSplit); + deserializedSimpleQnADataGenerationJobOptions.setModelOptions(modelOptions); + deserializedSimpleQnADataGenerationJobOptions.type = type; + deserializedSimpleQnADataGenerationJobOptions.questionTypes = questionTypes; + return deserializedSimpleQnADataGenerationJobOptions; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SimpleQnAFineTuningQuestionType.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SimpleQnAFineTuningQuestionType.java new file mode 100644 index 000000000000..94515e5dd17e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SimpleQnAFineTuningQuestionType.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.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The supported question types for SimpleQnA data generation jobs used for fine-tuning scenarios. + */ +public final class SimpleQnAFineTuningQuestionType extends ExpandableStringEnum { + + /** + * Short answer question type. + */ + @Generated + public static final SimpleQnAFineTuningQuestionType SHORT_ANSWER = fromString("short_answer"); + + /** + * Long answer question type. + */ + @Generated + public static final SimpleQnAFineTuningQuestionType LONG_ANSWER = fromString("long_answer"); + + /** + * Creates a new instance of SimpleQnAFineTuningQuestionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public SimpleQnAFineTuningQuestionType() { + } + + /** + * Creates or finds a SimpleQnAFineTuningQuestionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding SimpleQnAFineTuningQuestionType. + */ + @Generated + public static SimpleQnAFineTuningQuestionType fromString(String name) { + return fromString(name, SimpleQnAFineTuningQuestionType.class); + } + + /** + * Gets known SimpleQnAFineTuningQuestionType values. + * + * @return known SimpleQnAFineTuningQuestionType values. + */ + @Generated + public static Collection values() { + return values(SimpleQnAFineTuningQuestionType.class); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Skill.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Skill.java new file mode 100644 index 000000000000..f4bd545e0151 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/Skill.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * A skill resource. + */ +@Immutable +public final class Skill implements JsonSerializable { + + /* + * The unique identifier of the skill. + */ + @Generated + private final String id; + + /* + * The unique name of the skill. + */ + @Generated + private final String name; + + /* + * A human-readable description of the skill. + */ + @Generated + private final String description; + + /* + * The Unix timestamp (seconds) when the skill was created. + */ + @Generated + private final long createdAt; + + /* + * The default version for the skill. Can be changed via updateSkill. + */ + @Generated + private final String defaultVersion; + + /* + * The latest version for the skill. + */ + @Generated + private final String latestVersion; + + /** + * Creates an instance of Skill class. + * + * @param id the id value to set. + * @param name the name value to set. + * @param description the description value to set. + * @param createdAt the createdAt value to set. + * @param defaultVersion the defaultVersion value to set. + * @param latestVersion the latestVersion value to set. + */ + @Generated + private Skill(String id, String name, String description, OffsetDateTime createdAt, String defaultVersion, + String latestVersion) { + this.id = id; + this.name = name; + this.description = description; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + this.defaultVersion = defaultVersion; + this.latestVersion = latestVersion; + } + + /** + * Get the id property: The unique identifier of the skill. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the name property: The unique name of the skill. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the description property: A human-readable description of the skill. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the createdAt property: The Unix timestamp (seconds) when the skill was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the defaultVersion property: The default version for the skill. Can be changed via updateSkill. + * + * @return the defaultVersion value. + */ + @Generated + public String getDefaultVersion() { + return this.defaultVersion; + } + + /** + * Get the latestVersion property: The latest version for the skill. + * + * @return the latestVersion value. + */ + @Generated + public String getLatestVersion() { + return this.latestVersion; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeLongField("created_at", this.createdAt); + jsonWriter.writeStringField("default_version", this.defaultVersion); + jsonWriter.writeStringField("latest_version", this.latestVersion); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Skill from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Skill if the JsonReader was pointing to an instance of it, or null if it was pointing to + * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the Skill. + */ + @Generated + public static Skill fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String name = null; + String description = null; + OffsetDateTime createdAt = null; + String defaultVersion = null; + String latestVersion = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("created_at".equals(fieldName)) { + createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("default_version".equals(fieldName)) { + defaultVersion = reader.getString(); + } else if ("latest_version".equals(fieldName)) { + latestVersion = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new Skill(id, name, description, createdAt, defaultVersion, latestVersion); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillDetails.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillDetails.java deleted file mode 100644 index dd93ccb5d611..000000000000 --- a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillDetails.java +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.projects.models; - -import com.azure.core.annotation.Generated; -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.Map; - -/** - * A skill object. - */ -@Immutable -public final class SkillDetails implements JsonSerializable { - - /* - * The unique identifier of the skill. - */ - @Generated - private final String skillId; - - /* - * Whether the skill was created from a zip blob package. - */ - @Generated - private final boolean blobPresent; - - /* - * The unique name of the skill. - */ - @Generated - private final String name; - - /* - * A human-readable description of the skill. - */ - @Generated - private String description; - - /* - * Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. - * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - */ - @Generated - private Map metadata; - - /** - * Creates an instance of SkillDetails class. - * - * @param skillId the skillId value to set. - * @param blobPresent the blobPresent value to set. - * @param name the name value to set. - */ - @Generated - private SkillDetails(String skillId, boolean blobPresent, String name) { - this.skillId = skillId; - this.blobPresent = blobPresent; - this.name = name; - } - - /** - * Get the skillId property: The unique identifier of the skill. - * - * @return the skillId value. - */ - @Generated - public String getSkillId() { - return this.skillId; - } - - /** - * Get the blobPresent property: Whether the skill was created from a zip blob package. - * - * @return the blobPresent value. - */ - @Generated - public boolean isBlobPresent() { - return this.blobPresent; - } - - /** - * Get the name property: The unique name of the skill. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Get the description property: A human-readable description of the skill. - * - * @return the description value. - */ - @Generated - public String getDescription() { - return this.description; - } - - /** - * Get the metadata property: Set of 16 key-value pairs that can be attached to an object. This can be - * useful for storing additional information about the object in a structured - * format, and querying for objects via API or the dashboard. - * - * Keys are strings with a maximum length of 64 characters. Values are strings - * with a maximum length of 512 characters. - * - * @return the metadata value. - */ - @Generated - public Map getMetadata() { - return this.metadata; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("skill_id", this.skillId); - jsonWriter.writeBooleanField("has_blob", this.blobPresent); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("description", this.description); - jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SkillDetails from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SkillDetails if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the SkillDetails. - */ - @Generated - public static SkillDetails fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String skillId = null; - boolean blobPresent = false; - String name = null; - String description = null; - Map metadata = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("skill_id".equals(fieldName)) { - skillId = reader.getString(); - } else if ("has_blob".equals(fieldName)) { - blobPresent = reader.getBoolean(); - } else if ("name".equals(fieldName)) { - name = reader.getString(); - } else if ("description".equals(fieldName)) { - description = reader.getString(); - } else if ("metadata".equals(fieldName)) { - metadata = reader.readMap(reader1 -> reader1.getString()); - } else { - reader.skipChildren(); - } - } - SkillDetails deserializedSkillDetails = new SkillDetails(skillId, blobPresent, name); - deserializedSkillDetails.description = description; - deserializedSkillDetails.metadata = metadata; - return deserializedSkillDetails; - }); - } -} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillFileDetails.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillFileDetails.java new file mode 100644 index 000000000000..dcedfce08add --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillFileDetails.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; + +/** + * A file in an HTTP request, response, or multipart payload. + * + * A file in an HTTP request, response, or multipart payload. + * + * Files have a special meaning that the HTTP library understands. When the body of an HTTP request, response, + * or multipart payload is _effectively_ an instance of `TypeSpec.Http.File` or any type that extends it, the + * operation is treated as a file upload or download. + * + * When using file bodies, the fields of the file model are defined to come from particular locations by default: + * + * - `contentType`: The `Content-Type` header of the request, response, or multipart payload (CANNOT be overridden or + * changed). + * - `contents`: The body of the request, response, or multipart payload (CANNOT be overridden or changed). + * - `filename`: The `filename` parameter value of the `Content-Disposition` header of the response or multipart payload + * (MAY be overridden or changed). + * + * A File may be used as a normal structured JSON object in a request or response, if the request specifies an explicit + * `Content-Type` header. In this case, the entire File model is serialized as if it were any other model. In a JSON + * payload, + * it will have a structure like: + * + * ``` + * { + * "contentType": <string?>, + * "filename": <string?>, + * "contents": <string, base64> + * } + * ``` + * + * The `contentType` _within_ the file defines what media types the data inside the file can be, but if the + * specification + * defines a `Content-Type` for the payload as HTTP metadata, that `Content-Type` metadata defines _how the file is + * serialized_. See the examples below for more information. + * + * NOTE: The `filename` and `contentType` fields are optional. Furthermore, the default location of `filename` + * (`Content-Disposition: <disposition>; filename=<filename>`) is only valid in HTTP responses and multipart + * payloads. If + * you wish to send the `filename` in a request, you must use HTTP metadata decorators to describe the location of the + * `filename` field. You can combine the metadata decorators with `@visibility` to control when the `filename` + * location + * is overridden, as shown in the examples below. + */ +@Fluent +public final class SkillFileDetails { + + /* + * The content of the file. + */ + @Generated + private final BinaryData content; + + /* + * The filename of the file. + */ + @Generated + private String filename; + + /* + * The content-type of the file. + */ + @Generated + private String contentType = "application/octet-stream"; + + /** + * Creates an instance of SkillFileDetails class. + * + * @param content the content value to set. + */ + @Generated + public SkillFileDetails(BinaryData content) { + this.content = content; + } + + /** + * Get the content property: The content of the file. + * + * @return the content value. + */ + @Generated + public BinaryData getContent() { + return this.content; + } + + /** + * Get the filename property: The filename of the file. + * + * @return the filename value. + */ + @Generated + public String getFilename() { + return this.filename; + } + + /** + * Set the filename property: The filename of the file. + * + * @param filename the filename value to set. + * @return the SkillFileDetails object itself. + */ + @Generated + public SkillFileDetails setFilename(String filename) { + this.filename = filename; + return this; + } + + /** + * Get the contentType property: The content-type of the file. + * + * @return the contentType value. + */ + @Generated + public String getContentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content-type of the file. + * + * @param contentType the contentType value to set. + * @return the SkillFileDetails object itself. + */ + @Generated + public SkillFileDetails setContentType(String contentType) { + this.contentType = contentType; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillInlineContent.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillInlineContent.java new file mode 100644 index 000000000000..7cc0096938eb --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillInlineContent.java @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.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; +import java.util.List; +import java.util.Map; + +/** + * Inline content for defining a simple skill without uploading files. Follows the agentskills.io SKILL.md + * specification. + */ +@Fluent +public final class SkillInlineContent implements JsonSerializable { + + /* + * A human-readable description of what the skill does and when to use it. + */ + @Generated + private final String description; + + /* + * The skill instructions in markdown format. This is the body content of the SKILL.md file. + */ + @Generated + private final String instructions; + + /* + * License name or reference to a bundled license file. + */ + @Generated + private String license; + + /* + * Environment requirements or compatibility notes for the skill. + */ + @Generated + private String compatibility; + + /* + * Arbitrary key-value metadata for additional properties. + */ + @Generated + private Map metadata; + + /* + * List of pre-approved tools the skill may use. Experimental. + */ + @Generated + private List allowedTools; + + /** + * Creates an instance of SkillInlineContent class. + * + * @param description the description value to set. + * @param instructions the instructions value to set. + */ + @Generated + public SkillInlineContent(String description, String instructions) { + this.description = description; + this.instructions = instructions; + } + + /** + * Get the description property: A human-readable description of what the skill does and when to use it. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the instructions property: The skill instructions in markdown format. This is the body content of the + * SKILL.md file. + * + * @return the instructions value. + */ + @Generated + public String getInstructions() { + return this.instructions; + } + + /** + * Get the license property: License name or reference to a bundled license file. + * + * @return the license value. + */ + @Generated + public String getLicense() { + return this.license; + } + + /** + * Set the license property: License name or reference to a bundled license file. + * + * @param license the license value to set. + * @return the SkillInlineContent object itself. + */ + @Generated + public SkillInlineContent setLicense(String license) { + this.license = license; + return this; + } + + /** + * Get the compatibility property: Environment requirements or compatibility notes for the skill. + * + * @return the compatibility value. + */ + @Generated + public String getCompatibility() { + return this.compatibility; + } + + /** + * Set the compatibility property: Environment requirements or compatibility notes for the skill. + * + * @param compatibility the compatibility value to set. + * @return the SkillInlineContent object itself. + */ + @Generated + public SkillInlineContent setCompatibility(String compatibility) { + this.compatibility = compatibility; + return this; + } + + /** + * Get the metadata property: Arbitrary key-value metadata for additional properties. + * + * @return the metadata value. + */ + @Generated + public Map getMetadata() { + return this.metadata; + } + + /** + * Set the metadata property: Arbitrary key-value metadata for additional properties. + * + * @param metadata the metadata value to set. + * @return the SkillInlineContent object itself. + */ + @Generated + public SkillInlineContent setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the allowedTools property: List of pre-approved tools the skill may use. Experimental. + * + * @return the allowedTools value. + */ + @Generated + public List getAllowedTools() { + return this.allowedTools; + } + + /** + * Set the allowedTools property: List of pre-approved tools the skill may use. Experimental. + * + * @param allowedTools the allowedTools value to set. + * @return the SkillInlineContent object itself. + */ + @Generated + public SkillInlineContent setAllowedTools(List allowedTools) { + this.allowedTools = allowedTools; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("instructions", this.instructions); + jsonWriter.writeStringField("license", this.license); + jsonWriter.writeStringField("compatibility", this.compatibility); + jsonWriter.writeMapField("metadata", this.metadata, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("allowed_tools", this.allowedTools, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkillInlineContent from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkillInlineContent if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SkillInlineContent. + */ + @Generated + public static SkillInlineContent fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String description = null; + String instructions = null; + String license = null; + String compatibility = null; + Map metadata = null; + List allowedTools = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("instructions".equals(fieldName)) { + instructions = reader.getString(); + } else if ("license".equals(fieldName)) { + license = reader.getString(); + } else if ("compatibility".equals(fieldName)) { + compatibility = reader.getString(); + } else if ("metadata".equals(fieldName)) { + metadata = reader.readMap(reader1 -> reader1.getString()); + } else if ("allowed_tools".equals(fieldName)) { + allowedTools = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + SkillInlineContent deserializedSkillInlineContent = new SkillInlineContent(description, instructions); + deserializedSkillInlineContent.license = license; + deserializedSkillInlineContent.compatibility = compatibility; + deserializedSkillInlineContent.metadata = metadata; + deserializedSkillInlineContent.allowedTools = allowedTools; + return deserializedSkillInlineContent; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillVersion.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillVersion.java new file mode 100644 index 000000000000..db2def4af3b8 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SkillVersion.java @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * A specific version of a skill. + */ +@Immutable +public final class SkillVersion implements JsonSerializable { + + /* + * The unique identifier of the skill version. + */ + @Generated + private final String id; + + /* + * The identifier of the parent skill. + */ + @Generated + private final String skillId; + + /* + * The name of the skill version. + */ + @Generated + private final String name; + + /* + * The version identifier. Skill versions are immutable. + */ + @Generated + private final String version; + + /* + * A human-readable description of the skill version. + */ + @Generated + private final String description; + + /* + * The Unix timestamp (seconds) when the skill version was created. + */ + @Generated + private final long createdAt; + + /** + * Creates an instance of SkillVersion class. + * + * @param id the id value to set. + * @param skillId the skillId value to set. + * @param name the name value to set. + * @param version the version value to set. + * @param description the description value to set. + * @param createdAt the createdAt value to set. + */ + @Generated + private SkillVersion(String id, String skillId, String name, String version, String description, + OffsetDateTime createdAt) { + this.id = id; + this.skillId = skillId; + this.name = name; + this.version = version; + this.description = description; + if (createdAt == null) { + this.createdAt = 0L; + } else { + this.createdAt = createdAt.toEpochSecond(); + } + } + + /** + * Get the id property: The unique identifier of the skill version. + * + * @return the id value. + */ + @Generated + public String getId() { + return this.id; + } + + /** + * Get the skillId property: The identifier of the parent skill. + * + * @return the skillId value. + */ + @Generated + public String getSkillId() { + return this.skillId; + } + + /** + * Get the name property: The name of the skill version. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the version property: The version identifier. Skill versions are immutable. + * + * @return the version value. + */ + @Generated + public String getVersion() { + return this.version; + } + + /** + * Get the description property: A human-readable description of the skill version. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Get the createdAt property: The Unix timestamp (seconds) when the skill version was created. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("skill_id", this.skillId); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("version", this.version); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeLongField("created_at", this.createdAt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SkillVersion from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SkillVersion if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the SkillVersion. + */ + @Generated + public static SkillVersion fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String id = null; + String skillId = null; + String name = null; + String version = null; + String description = null; + OffsetDateTime createdAt = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("skill_id".equals(fieldName)) { + skillId = reader.getString(); + } else if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("version".equals(fieldName)) { + version = reader.getString(); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("created_at".equals(fieldName)) { + createdAt = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else { + reader.skipChildren(); + } + } + return new SkillVersion(id, skillId, name, version, description, createdAt); + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SystemDataV3.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SystemDataV3.java new file mode 100644 index 000000000000..5ae87ab33724 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/SystemDataV3.java @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * System metadata for a resource. + */ +@Immutable +public final class SystemDataV3 implements JsonSerializable { + + /* + * Timestamp of resource creation + */ + @Generated + private Long createdAt; + + /* + * Identity that created the resource + */ + @Generated + private String createdBy; + + /* + * Type of identity that created the resource + */ + @Generated + private String createdByType; + + /* + * Timestamp of last resource modification + */ + @Generated + private Long lastModifiedAt; + + /** + * Creates an instance of SystemDataV3 class. + */ + @Generated + private SystemDataV3() { + } + + /** + * Get the createdAt property: Timestamp of resource creation. + * + * @return the createdAt value. + */ + @Generated + public OffsetDateTime getCreatedAt() { + if (this.createdAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.createdAt), ZoneOffset.UTC); + } + + /** + * Get the createdBy property: Identity that created the resource. + * + * @return the createdBy value. + */ + @Generated + public String getCreatedBy() { + return this.createdBy; + } + + /** + * Get the createdByType property: Type of identity that created the resource. + * + * @return the createdByType value. + */ + @Generated + public String getCreatedByType() { + return this.createdByType; + } + + /** + * Get the lastModifiedAt property: Timestamp of last resource modification. + * + * @return the lastModifiedAt value. + */ + @Generated + public OffsetDateTime getLastModifiedAt() { + if (this.lastModifiedAt == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.lastModifiedAt), ZoneOffset.UTC); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("createdAt", this.createdAt); + jsonWriter.writeStringField("createdBy", this.createdBy); + jsonWriter.writeStringField("createdByType", this.createdByType); + jsonWriter.writeNumberField("lastModifiedAt", this.lastModifiedAt); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SystemDataV3 from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SystemDataV3 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 SystemDataV3. + */ + @Generated + public static SystemDataV3 fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SystemDataV3 deserializedSystemDataV3 = new SystemDataV3(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("createdAt".equals(fieldName)) { + deserializedSystemDataV3.createdAt = reader.getNullable(JsonReader::getLong); + } else if ("createdBy".equals(fieldName)) { + deserializedSystemDataV3.createdBy = reader.getString(); + } else if ("createdByType".equals(fieldName)) { + deserializedSystemDataV3.createdByType = reader.getString(); + } else if ("lastModifiedAt".equals(fieldName)) { + deserializedSystemDataV3.lastModifiedAt = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + return deserializedSystemDataV3; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TestingCriterionAzureAIEvaluator.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TestingCriterionAzureAIEvaluator.java new file mode 100644 index 000000000000..6a82354d1e28 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TestingCriterionAzureAIEvaluator.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.Map; + +/** + * AzureAIEvaluatorGrader + * + * An Azure AI Evaluator grader used as testing criterion in evaluations. + */ +@Fluent +public final class TestingCriterionAzureAIEvaluator implements JsonSerializable { + + /* + * The object type, which is always `azure_ai_evaluator`. + */ + @Generated + private final String type = "azure_ai_evaluator"; + + /* + * The name of the grader. + */ + @Generated + private final String name; + + /* + * The name of the evaluator. + */ + @Generated + private final String evaluatorName; + + /* + * The version of the evaluator. Latest version if not specified. + */ + @Generated + private String evaluatorVersion; + + /* + * The initialization parameters for the evaluation. Must support structured outputs. + */ + @Generated + private Map initializationParameters; + + /* + * The model to use for the evaluation. Must support structured outputs. + */ + @Generated + private Map dataMapping; + + /** + * Creates an instance of TestingCriterionAzureAIEvaluator class. + * + * @param name the name value to set. + * @param evaluatorName the evaluatorName value to set. + */ + @Generated + public TestingCriterionAzureAIEvaluator(String name, String evaluatorName) { + this.name = name; + this.evaluatorName = evaluatorName; + } + + /** + * Get the type property: The object type, which is always `azure_ai_evaluator`. + * + * @return the type value. + */ + @Generated + public String getType() { + return this.type; + } + + /** + * Get the name property: The name of the grader. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the evaluatorName property: The name of the evaluator. + * + * @return the evaluatorName value. + */ + @Generated + public String getEvaluatorName() { + return this.evaluatorName; + } + + /** + * Get the evaluatorVersion property: The version of the evaluator. Latest version if not specified. + * + * @return the evaluatorVersion value. + */ + @Generated + public String getEvaluatorVersion() { + return this.evaluatorVersion; + } + + /** + * Set the evaluatorVersion property: The version of the evaluator. Latest version if not specified. + * + * @param evaluatorVersion the evaluatorVersion value to set. + * @return the TestingCriterionAzureAIEvaluator object itself. + */ + @Generated + public TestingCriterionAzureAIEvaluator setEvaluatorVersion(String evaluatorVersion) { + this.evaluatorVersion = evaluatorVersion; + return this; + } + + /** + * Get the initializationParameters property: The initialization parameters for the evaluation. Must support + * structured outputs. + * + * @return the initializationParameters value. + */ + @Generated + public Map getInitializationParameters() { + return this.initializationParameters; + } + + /** + * Get the dataMapping property: The model to use for the evaluation. Must support structured outputs. + * + * @return the dataMapping value. + */ + @Generated + public Map getDataMapping() { + return this.dataMapping; + } + + /** + * Set the dataMapping property: The model to use for the evaluation. Must support structured outputs. + * + * @param dataMapping the dataMapping value to set. + * @return the TestingCriterionAzureAIEvaluator object itself. + */ + @Generated + public TestingCriterionAzureAIEvaluator setDataMapping(Map dataMapping) { + this.dataMapping = dataMapping; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("evaluator_name", this.evaluatorName); + jsonWriter.writeStringField("evaluator_version", this.evaluatorVersion); + jsonWriter.writeMapField("initialization_parameters", this.initializationParameters, (writer, element) -> { + if (element == null) { + writer.writeNull(); + } else { + element.writeTo(writer); + } + }); + jsonWriter.writeMapField("data_mapping", this.dataMapping, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TestingCriterionAzureAIEvaluator from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TestingCriterionAzureAIEvaluator if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TestingCriterionAzureAIEvaluator. + */ + @Generated + public static TestingCriterionAzureAIEvaluator fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + String evaluatorName = null; + String evaluatorVersion = null; + Map initializationParameters = null; + Map dataMapping = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("name".equals(fieldName)) { + name = reader.getString(); + } else if ("evaluator_name".equals(fieldName)) { + evaluatorName = reader.getString(); + } else if ("evaluator_version".equals(fieldName)) { + evaluatorVersion = reader.getString(); + } else if ("initialization_parameters".equals(fieldName)) { + initializationParameters = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + } else if ("data_mapping".equals(fieldName)) { + dataMapping = reader.readMap(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + TestingCriterionAzureAIEvaluator deserializedTestingCriterionAzureAIEvaluator + = new TestingCriterionAzureAIEvaluator(name, evaluatorName); + deserializedTestingCriterionAzureAIEvaluator.evaluatorVersion = evaluatorVersion; + deserializedTestingCriterionAzureAIEvaluator.initializationParameters = initializationParameters; + deserializedTestingCriterionAzureAIEvaluator.dataMapping = dataMapping; + return deserializedTestingCriterionAzureAIEvaluator; + }); + } + + /** + * Set the initializationParameters property: The initialization parameters for the evaluation. Must support + * structured outputs. + * + * @param initializationParameters the initializationParameters value to set. + * @return the TestingCriterionAzureAIEvaluator object itself. + */ + @Generated + public TestingCriterionAzureAIEvaluator + setInitializationParameters(Map initializationParameters) { + this.initializationParameters = initializationParameters; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TimerRoutineTrigger.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TimerRoutineTrigger.java new file mode 100644 index 000000000000..a19011197929 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TimerRoutineTrigger.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; + +/** + * A one-shot timer routine trigger. + */ +@Fluent +public final class TimerRoutineTrigger extends RoutineTrigger { + + /* + * The trigger type. + */ + @Generated + private RoutineTriggerType type = RoutineTriggerType.TIMER; + + /* + * The UTC date and time at which the timer fires. + */ + @Generated + private OffsetDateTime at; + + /** + * Get the type property: The trigger type. + * + * @return the type value. + */ + @Generated + @Override + public RoutineTriggerType getType() { + return this.type; + } + + /** + * Get the at property: The UTC date and time at which the timer fires. + * + * @return the at value. + */ + @Generated + public OffsetDateTime getAt() { + return this.at; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("at", + this.at == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.at)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TimerRoutineTrigger from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TimerRoutineTrigger 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 TimerRoutineTrigger. + */ + @Generated + public static TimerRoutineTrigger fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TimerRoutineTrigger deserializedTimerRoutineTrigger = new TimerRoutineTrigger(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedTimerRoutineTrigger.type = RoutineTriggerType.fromString(reader.getString()); + } else if ("at".equals(fieldName)) { + deserializedTimerRoutineTrigger.at = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + return deserializedTimerRoutineTrigger; + }); + } + + /** + * Creates an instance of TimerRoutineTrigger class. + */ + @Generated + public TimerRoutineTrigger() { + } + + /** + * Set the at property: The UTC date and time at which the timer fires. + * + * @param at the at value to set. + * @return the TimerRoutineTrigger object itself. + */ + @Generated + public TimerRoutineTrigger setAt(OffsetDateTime at) { + this.at = at; + return this; + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ToolUseFineTuningDataGenerationJobOptions.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ToolUseFineTuningDataGenerationJobOptions.java new file mode 100644 index 000000000000..cb3ba51894f4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/ToolUseFineTuningDataGenerationJobOptions.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The options for a data generation job with ToolUse type. Used only for fine-tuning scenarios. + */ +@Fluent +public final class ToolUseFineTuningDataGenerationJobOptions extends DataGenerationJobOptions { + + /* + * The data generation job type. + */ + @Generated + private DataGenerationJobType type = DataGenerationJobType.TOOL_USE; + + /** + * Creates an instance of ToolUseFineTuningDataGenerationJobOptions class. + * + * @param maxSamples the maxSamples value to set. + */ + @Generated + public ToolUseFineTuningDataGenerationJobOptions(int maxSamples) { + super(maxSamples); + } + + /** + * Get the type property: The data generation job type. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public ToolUseFineTuningDataGenerationJobOptions setTrainSplit(Double trainSplit) { + super.setTrainSplit(trainSplit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public ToolUseFineTuningDataGenerationJobOptions setModelOptions(DataGenerationModelOptions modelOptions) { + super.setModelOptions(modelOptions); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("max_samples", getMaxSamples()); + jsonWriter.writeNumberField("train_split", getTrainSplit()); + jsonWriter.writeJsonField("model_options", getModelOptions()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ToolUseFineTuningDataGenerationJobOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ToolUseFineTuningDataGenerationJobOptions if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ToolUseFineTuningDataGenerationJobOptions. + */ + @Generated + public static ToolUseFineTuningDataGenerationJobOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int maxSamples = 0; + Double trainSplit = null; + DataGenerationModelOptions modelOptions = null; + DataGenerationJobType type = DataGenerationJobType.TOOL_USE; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_samples".equals(fieldName)) { + maxSamples = reader.getInt(); + } else if ("train_split".equals(fieldName)) { + trainSplit = reader.getNullable(JsonReader::getDouble); + } else if ("model_options".equals(fieldName)) { + modelOptions = DataGenerationModelOptions.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + ToolUseFineTuningDataGenerationJobOptions deserializedToolUseFineTuningDataGenerationJobOptions + = new ToolUseFineTuningDataGenerationJobOptions(maxSamples); + deserializedToolUseFineTuningDataGenerationJobOptions.setTrainSplit(trainSplit); + deserializedToolUseFineTuningDataGenerationJobOptions.setModelOptions(modelOptions); + deserializedToolUseFineTuningDataGenerationJobOptions.type = type; + return deserializedToolUseFineTuningDataGenerationJobOptions; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobOptions.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobOptions.java new file mode 100644 index 000000000000..8c8ee0845c3f --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobOptions.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The options for a data generation job with Traces type. + */ +@Fluent +public final class TracesDataGenerationJobOptions extends DataGenerationJobOptions { + + /* + * The data generation job type. + */ + @Generated + private DataGenerationJobType type = DataGenerationJobType.TRACES; + + /** + * Creates an instance of TracesDataGenerationJobOptions class. + * + * @param maxSamples the maxSamples value to set. + */ + @Generated + public TracesDataGenerationJobOptions(int maxSamples) { + super(maxSamples); + } + + /** + * Get the type property: The data generation job type. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobType getType() { + return this.type; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public TracesDataGenerationJobOptions setTrainSplit(Double trainSplit) { + super.setTrainSplit(trainSplit); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public TracesDataGenerationJobOptions setModelOptions(DataGenerationModelOptions modelOptions) { + super.setModelOptions(modelOptions); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("max_samples", getMaxSamples()); + jsonWriter.writeNumberField("train_split", getTrainSplit()); + jsonWriter.writeJsonField("model_options", getModelOptions()); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TracesDataGenerationJobOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TracesDataGenerationJobOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TracesDataGenerationJobOptions. + */ + @Generated + public static TracesDataGenerationJobOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int maxSamples = 0; + Double trainSplit = null; + DataGenerationModelOptions modelOptions = null; + DataGenerationJobType type = DataGenerationJobType.TRACES; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("max_samples".equals(fieldName)) { + maxSamples = reader.getInt(); + } else if ("train_split".equals(fieldName)) { + trainSplit = reader.getNullable(JsonReader::getDouble); + } else if ("model_options".equals(fieldName)) { + modelOptions = DataGenerationModelOptions.fromJson(reader); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + TracesDataGenerationJobOptions deserializedTracesDataGenerationJobOptions + = new TracesDataGenerationJobOptions(maxSamples); + deserializedTracesDataGenerationJobOptions.setTrainSplit(trainSplit); + deserializedTracesDataGenerationJobOptions.setModelOptions(modelOptions); + deserializedTracesDataGenerationJobOptions.type = type; + return deserializedTracesDataGenerationJobOptions; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobSource.java new file mode 100644 index 000000000000..da899e605bab --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobSource.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Traces source for data generation jobs — conversation traces from Application Insights. + */ +@Fluent +public final class TracesDataGenerationJobSource extends DataGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private DataGenerationJobSourceType type = DataGenerationJobSourceType.TRACES; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * The unique agent ID used to filter traces. Provide either `agent_id` or `agent_name` — at least one is required. + */ + @Generated + private String agentId; + + /* + * The agent name to fetch traces for. Provide either `agent_id` or `agent_name` — at least one is required. + */ + @Generated + private String agentName; + + /* + * The agent version. If not specified, traces for ALL versions of the agent are included within the time window. + */ + @Generated + private String agentVersion; + + /* + * Start of the time window (Unix timestamp in seconds) for fetching traces. + */ + @Generated + private final long startTime; + + /* + * End of the time window (Unix timestamp in seconds). Defaults to current time. + */ + @Generated + private Long endTime; + + /** + * Creates an instance of TracesDataGenerationJobSource class. + * + * @param startTime the startTime value to set. + */ + @Generated + public TracesDataGenerationJobSource(OffsetDateTime startTime) { + if (startTime == null) { + this.startTime = 0L; + } else { + this.startTime = startTime.toEpochSecond(); + } + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public DataGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the TracesDataGenerationJobSource object itself. + */ + @Generated + public TracesDataGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the agentId property: The unique agent ID used to filter traces. Provide either `agent_id` or `agent_name` — + * at least one is required. + * + * @return the agentId value. + */ + @Generated + public String getAgentId() { + return this.agentId; + } + + /** + * Set the agentId property: The unique agent ID used to filter traces. Provide either `agent_id` or `agent_name` — + * at least one is required. + * + * @param agentId the agentId value to set. + * @return the TracesDataGenerationJobSource object itself. + */ + @Generated + public TracesDataGenerationJobSource setAgentId(String agentId) { + this.agentId = agentId; + return this; + } + + /** + * Get the agentName property: The agent name to fetch traces for. Provide either `agent_id` or `agent_name` — at + * least one is required. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Set the agentName property: The agent name to fetch traces for. Provide either `agent_id` or `agent_name` — at + * least one is required. + * + * @param agentName the agentName value to set. + * @return the TracesDataGenerationJobSource object itself. + */ + @Generated + public TracesDataGenerationJobSource setAgentName(String agentName) { + this.agentName = agentName; + return this; + } + + /** + * Get the agentVersion property: The agent version. If not specified, traces for ALL versions of the agent are + * included within the time window. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. If not specified, traces for ALL versions of the agent are + * included within the time window. + * + * @param agentVersion the agentVersion value to set. + * @return the TracesDataGenerationJobSource object itself. + */ + @Generated + public TracesDataGenerationJobSource setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the startTime property: Start of the time window (Unix timestamp in seconds) for fetching traces. + * + * @return the startTime value. + */ + @Generated + public OffsetDateTime getStartTime() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.startTime), ZoneOffset.UTC); + } + + /** + * Get the endTime property: End of the time window (Unix timestamp in seconds). Defaults to current time. + * + * @return the endTime value. + */ + @Generated + public OffsetDateTime getEndTime() { + if (this.endTime == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.endTime), ZoneOffset.UTC); + } + + /** + * Set the endTime property: End of the time window (Unix timestamp in seconds). Defaults to current time. + * + * @param endTime the endTime value to set. + * @return the TracesDataGenerationJobSource object itself. + */ + @Generated + public TracesDataGenerationJobSource setEndTime(OffsetDateTime endTime) { + if (endTime == null) { + this.endTime = null; + } else { + this.endTime = endTime.toEpochSecond(); + } + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("start_time", this.startTime); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("agent_id", this.agentId); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + jsonWriter.writeNumberField("end_time", this.endTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TracesDataGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TracesDataGenerationJobSource if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TracesDataGenerationJobSource. + */ + @Generated + public static TracesDataGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime startTime = null; + DataGenerationJobSourceType type = DataGenerationJobSourceType.TRACES; + String description = null; + String agentId = null; + String agentName = null; + String agentVersion = null; + Long endTime = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("start_time".equals(fieldName)) { + startTime = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("type".equals(fieldName)) { + type = DataGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("agent_id".equals(fieldName)) { + agentId = reader.getString(); + } else if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else if ("end_time".equals(fieldName)) { + endTime = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + TracesDataGenerationJobSource deserializedTracesDataGenerationJobSource + = new TracesDataGenerationJobSource(startTime); + deserializedTracesDataGenerationJobSource.type = type; + deserializedTracesDataGenerationJobSource.description = description; + deserializedTracesDataGenerationJobSource.agentId = agentId; + deserializedTracesDataGenerationJobSource.agentName = agentName; + deserializedTracesDataGenerationJobSource.agentVersion = agentVersion; + deserializedTracesDataGenerationJobSource.endTime = endTime; + return deserializedTracesDataGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesEvaluatorGenerationJobSource.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesEvaluatorGenerationJobSource.java new file mode 100644 index 000000000000..3f87ca619d6e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/TracesEvaluatorGenerationJobSource.java @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneOffset; + +/** + * Traces source for evaluator generation jobs — conversation traces from Application Insights. + */ +@Fluent +public final class TracesEvaluatorGenerationJobSource extends EvaluatorGenerationJobSource { + + /* + * The type of source. + */ + @Generated + private EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.TRACES; + + /* + * Optional description of what this source represents — helps the pipeline interpret its content (e.g., 'Company + * refund policy document' or 'Describes the agent's core capabilities'). + */ + @Generated + private String description; + + /* + * The unique agent ID used to filter traces. Provide either `agent_id` or `agent_name` — at least one is required. + */ + @Generated + private String agentId; + + /* + * The agent name to fetch traces for. Provide either `agent_id` or `agent_name` — at least one is required. + */ + @Generated + private String agentName; + + /* + * The agent version. If not specified, traces for ALL versions of the agent are included within the time window. + */ + @Generated + private String agentVersion; + + /* + * Start of the time window (Unix timestamp in seconds) for fetching traces. + */ + @Generated + private final long startTime; + + /* + * End of the time window (Unix timestamp in seconds). Defaults to current time. + */ + @Generated + private Long endTime; + + /** + * Creates an instance of TracesEvaluatorGenerationJobSource class. + * + * @param startTime the startTime value to set. + */ + @Generated + public TracesEvaluatorGenerationJobSource(OffsetDateTime startTime) { + if (startTime == null) { + this.startTime = 0L; + } else { + this.startTime = startTime.toEpochSecond(); + } + } + + /** + * Get the type property: The type of source. + * + * @return the type value. + */ + @Generated + @Override + public EvaluatorGenerationJobSourceType getType() { + return this.type; + } + + /** + * Get the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of what this source represents — helps the pipeline interpret + * its content (e.g., 'Company refund policy document' or 'Describes the agent's core capabilities'). + * + * @param description the description value to set. + * @return the TracesEvaluatorGenerationJobSource object itself. + */ + @Generated + public TracesEvaluatorGenerationJobSource setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the agentId property: The unique agent ID used to filter traces. Provide either `agent_id` or `agent_name` — + * at least one is required. + * + * @return the agentId value. + */ + @Generated + public String getAgentId() { + return this.agentId; + } + + /** + * Set the agentId property: The unique agent ID used to filter traces. Provide either `agent_id` or `agent_name` — + * at least one is required. + * + * @param agentId the agentId value to set. + * @return the TracesEvaluatorGenerationJobSource object itself. + */ + @Generated + public TracesEvaluatorGenerationJobSource setAgentId(String agentId) { + this.agentId = agentId; + return this; + } + + /** + * Get the agentName property: The agent name to fetch traces for. Provide either `agent_id` or `agent_name` — at + * least one is required. + * + * @return the agentName value. + */ + @Generated + public String getAgentName() { + return this.agentName; + } + + /** + * Set the agentName property: The agent name to fetch traces for. Provide either `agent_id` or `agent_name` — at + * least one is required. + * + * @param agentName the agentName value to set. + * @return the TracesEvaluatorGenerationJobSource object itself. + */ + @Generated + public TracesEvaluatorGenerationJobSource setAgentName(String agentName) { + this.agentName = agentName; + return this; + } + + /** + * Get the agentVersion property: The agent version. If not specified, traces for ALL versions of the agent are + * included within the time window. + * + * @return the agentVersion value. + */ + @Generated + public String getAgentVersion() { + return this.agentVersion; + } + + /** + * Set the agentVersion property: The agent version. If not specified, traces for ALL versions of the agent are + * included within the time window. + * + * @param agentVersion the agentVersion value to set. + * @return the TracesEvaluatorGenerationJobSource object itself. + */ + @Generated + public TracesEvaluatorGenerationJobSource setAgentVersion(String agentVersion) { + this.agentVersion = agentVersion; + return this; + } + + /** + * Get the startTime property: Start of the time window (Unix timestamp in seconds) for fetching traces. + * + * @return the startTime value. + */ + @Generated + public OffsetDateTime getStartTime() { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.startTime), ZoneOffset.UTC); + } + + /** + * Get the endTime property: End of the time window (Unix timestamp in seconds). Defaults to current time. + * + * @return the endTime value. + */ + @Generated + public OffsetDateTime getEndTime() { + if (this.endTime == null) { + return null; + } + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(this.endTime), ZoneOffset.UTC); + } + + /** + * Set the endTime property: End of the time window (Unix timestamp in seconds). Defaults to current time. + * + * @param endTime the endTime value to set. + * @return the TracesEvaluatorGenerationJobSource object itself. + */ + @Generated + public TracesEvaluatorGenerationJobSource setEndTime(OffsetDateTime endTime) { + if (endTime == null) { + this.endTime = null; + } else { + this.endTime = endTime.toEpochSecond(); + } + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeLongField("start_time", this.startTime); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeStringField("agent_id", this.agentId); + jsonWriter.writeStringField("agent_name", this.agentName); + jsonWriter.writeStringField("agent_version", this.agentVersion); + jsonWriter.writeNumberField("end_time", this.endTime); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TracesEvaluatorGenerationJobSource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TracesEvaluatorGenerationJobSource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TracesEvaluatorGenerationJobSource. + */ + @Generated + public static TracesEvaluatorGenerationJobSource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OffsetDateTime startTime = null; + EvaluatorGenerationJobSourceType type = EvaluatorGenerationJobSourceType.TRACES; + String description = null; + String agentId = null; + String agentName = null; + String agentVersion = null; + Long endTime = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("start_time".equals(fieldName)) { + startTime = OffsetDateTime.ofInstant(Instant.ofEpochSecond(reader.getLong()), ZoneOffset.UTC); + } else if ("type".equals(fieldName)) { + type = EvaluatorGenerationJobSourceType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("agent_id".equals(fieldName)) { + agentId = reader.getString(); + } else if ("agent_name".equals(fieldName)) { + agentName = reader.getString(); + } else if ("agent_version".equals(fieldName)) { + agentVersion = reader.getString(); + } else if ("end_time".equals(fieldName)) { + endTime = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + TracesEvaluatorGenerationJobSource deserializedTracesEvaluatorGenerationJobSource + = new TracesEvaluatorGenerationJobSource(startTime); + deserializedTracesEvaluatorGenerationJobSource.type = type; + deserializedTracesEvaluatorGenerationJobSource.description = description; + deserializedTracesEvaluatorGenerationJobSource.agentId = agentId; + deserializedTracesEvaluatorGenerationJobSource.agentName = agentName; + deserializedTracesEvaluatorGenerationJobSource.agentVersion = agentVersion; + deserializedTracesEvaluatorGenerationJobSource.endTime = endTime; + return deserializedTracesEvaluatorGenerationJobSource; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/UpdateModelVersionInput.java b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/UpdateModelVersionInput.java new file mode 100644 index 000000000000..545107fdc8fa --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/main/java/com/azure/ai/projects/models/UpdateModelVersionInput.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.projects.models; + +import com.azure.ai.projects.implementation.JsonMergePatchHelper; +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; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * Request body for updating a model version. Only description and tags can be modified. + */ +@Fluent +public final class UpdateModelVersionInput implements JsonSerializable { + + /* + * The asset description text. + */ + @Generated + private String description; + + /* + * Tag dictionary. Tags can be added, removed, and updated. + */ + @Generated + private Map tags; + + /** + * Stores updated model property, the value is property name, not serialized name. + */ + @Generated + private final Set updatedProperties = new HashSet<>(); + + @Generated + private boolean jsonMergePatch; + + @Generated + private void serializeAsJsonMergePatch(boolean jsonMergePatch) { + this.jsonMergePatch = jsonMergePatch; + } + + static { + JsonMergePatchHelper + .setUpdateModelVersionInputAccessor(new JsonMergePatchHelper.UpdateModelVersionInputAccessor() { + + @Override + public UpdateModelVersionInput prepareModelForJsonMergePatch(UpdateModelVersionInput model, + boolean jsonMergePatchEnabled) { + model.serializeAsJsonMergePatch(jsonMergePatchEnabled); + return model; + } + + @Override + public boolean isJsonMergePatch(UpdateModelVersionInput model) { + return model.jsonMergePatch; + } + }); + } + + /** + * Creates an instance of UpdateModelVersionInput class. + */ + @Generated + public UpdateModelVersionInput() { + } + + /** + * Get the description property: The asset description text. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: The asset description text. + * + * @param description the description value to set. + * @return the UpdateModelVersionInput object itself. + */ + @Generated + public UpdateModelVersionInput setDescription(String description) { + this.description = description; + this.updatedProperties.add("description"); + return this; + } + + /** + * Get the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @return the tags value. + */ + @Generated + public Map getTags() { + return this.tags; + } + + /** + * Set the tags property: Tag dictionary. Tags can be added, removed, and updated. + * + * @param tags the tags value to set. + * @return the UpdateModelVersionInput object itself. + */ + @Generated + public UpdateModelVersionInput setTags(Map tags) { + this.tags = tags; + this.updatedProperties.add("tags"); + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + if (jsonMergePatch) { + return toJsonMergePatch(jsonWriter); + } else { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + } + + @Generated + private JsonWriter toJsonMergePatch(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (updatedProperties.contains("description")) { + if (this.description == null) { + jsonWriter.writeNullField("description"); + } else { + jsonWriter.writeStringField("description", this.description); + } + } + if (updatedProperties.contains("tags")) { + if (this.tags == null) { + jsonWriter.writeNullField("tags"); + } else { + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> { + if (element != null) { + writer.writeString(element); + } else { + writer.writeNull(); + } + }); + } + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of UpdateModelVersionInput from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of UpdateModelVersionInput 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 UpdateModelVersionInput. + */ + @Generated + public static UpdateModelVersionInput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + UpdateModelVersionInput deserializedUpdateModelVersionInput = new UpdateModelVersionInput(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("description".equals(fieldName)) { + deserializedUpdateModelVersionInput.description = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedUpdateModelVersionInput.tags = tags; + } else { + reader.skipChildren(); + } + } + return deserializedUpdateModelVersionInput; + }); + } +} diff --git a/sdk/ai/azure-ai-projects/src/main/resources/META-INF/azure-ai-projects_metadata.json b/sdk/ai/azure-ai-projects/src/main/resources/META-INF/azure-ai-projects_metadata.json index 57d4ac02a60d..e1d9906d5b7d 100644 --- a/sdk/ai/azure-ai-projects/src/main/resources/META-INF/azure-ai-projects_metadata.json +++ b/sdk/ai/azure-ai-projects/src/main/resources/META-INF/azure-ai-projects_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersions":{"Azure.AI.Projects":"v1"},"crossLanguageDefinitions":{"com.azure.ai.projects.AIProjectClientBuilder":"Azure.AI.Projects","com.azure.ai.projects.ConnectionsAsyncClient":"Azure.AI.Projects.Connections","com.azure.ai.projects.ConnectionsAsyncClient.getConnection":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsAsyncClient.getConnectionWithCredentials":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsAsyncClient.getConnectionWithCredentialsWithResponse":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsAsyncClient.getConnectionWithResponse":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsAsyncClient.listConnections":"Azure.AI.Projects.Connections.list","com.azure.ai.projects.ConnectionsClient":"Azure.AI.Projects.Connections","com.azure.ai.projects.ConnectionsClient.getConnection":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsClient.getConnectionWithCredentials":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsClient.getConnectionWithCredentialsWithResponse":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsClient.getConnectionWithResponse":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsClient.listConnections":"Azure.AI.Projects.Connections.list","com.azure.ai.projects.DatasetsAsyncClient":"Azure.AI.Projects.Datasets","com.azure.ai.projects.DatasetsAsyncClient.createOrUpdateDatasetVersion":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsAsyncClient.createOrUpdateDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsAsyncClient.deleteDatasetVersion":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsAsyncClient.deleteDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsAsyncClient.getCredentials":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsAsyncClient.getCredentialsWithResponse":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsAsyncClient.getDatasetVersion":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsAsyncClient.getDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsAsyncClient.listDatasetVersions":"Azure.AI.Projects.Datasets.listVersions","com.azure.ai.projects.DatasetsAsyncClient.listLatestDatasetVersions":"Azure.AI.Projects.Datasets.listLatest","com.azure.ai.projects.DatasetsAsyncClient.pendingUpload":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DatasetsAsyncClient.pendingUploadWithResponse":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DatasetsClient":"Azure.AI.Projects.Datasets","com.azure.ai.projects.DatasetsClient.createOrUpdateDatasetVersion":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsClient.createOrUpdateDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsClient.deleteDatasetVersion":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsClient.deleteDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsClient.getCredentials":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsClient.getCredentialsWithResponse":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsClient.getDatasetVersion":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsClient.getDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsClient.listDatasetVersions":"Azure.AI.Projects.Datasets.listVersions","com.azure.ai.projects.DatasetsClient.listLatestDatasetVersions":"Azure.AI.Projects.Datasets.listLatest","com.azure.ai.projects.DatasetsClient.pendingUpload":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DatasetsClient.pendingUploadWithResponse":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DeploymentsAsyncClient":"Azure.AI.Projects.Deployments","com.azure.ai.projects.DeploymentsAsyncClient.getDeployment":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsAsyncClient.getDeploymentWithResponse":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsAsyncClient.listDeployments":"Azure.AI.Projects.Deployments.list","com.azure.ai.projects.DeploymentsClient":"Azure.AI.Projects.Deployments","com.azure.ai.projects.DeploymentsClient.getDeployment":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsClient.getDeploymentWithResponse":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsClient.listDeployments":"Azure.AI.Projects.Deployments.list","com.azure.ai.projects.EvaluationRulesAsyncClient":"Azure.AI.Projects.EvaluationRules","com.azure.ai.projects.EvaluationRulesAsyncClient.createOrUpdateEvaluationRule":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesAsyncClient.createOrUpdateEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesAsyncClient.deleteEvaluationRule":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesAsyncClient.deleteEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesAsyncClient.getEvaluationRule":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesAsyncClient.getEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesAsyncClient.listEvaluationRules":"Azure.AI.Projects.EvaluationRules.list","com.azure.ai.projects.EvaluationRulesClient":"Azure.AI.Projects.EvaluationRules","com.azure.ai.projects.EvaluationRulesClient.createOrUpdateEvaluationRule":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesClient.createOrUpdateEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesClient.deleteEvaluationRule":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesClient.deleteEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesClient.getEvaluationRule":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesClient.getEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesClient.listEvaluationRules":"Azure.AI.Projects.EvaluationRules.list","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient":"Azure.AI.Projects.EvaluationTaxonomies","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.createEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.createEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.deleteEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.deleteEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.getEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.getEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.listEvaluationTaxonomies":"Azure.AI.Projects.EvaluationTaxonomies.list","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.updateEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.updateEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluationTaxonomiesClient":"Azure.AI.Projects.EvaluationTaxonomies","com.azure.ai.projects.EvaluationTaxonomiesClient.createEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesClient.createEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesClient.deleteEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesClient.deleteEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesClient.getEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesClient.getEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesClient.listEvaluationTaxonomies":"Azure.AI.Projects.EvaluationTaxonomies.list","com.azure.ai.projects.EvaluationTaxonomiesClient.updateEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluationTaxonomiesClient.updateEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluatorsAsyncClient":"Azure.AI.Projects.Evaluators","com.azure.ai.projects.EvaluatorsAsyncClient.createEvaluatorVersion":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsAsyncClient.createEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsAsyncClient.deleteEvaluatorVersion":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsAsyncClient.deleteEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsAsyncClient.getEvaluatorVersion":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsAsyncClient.getEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsAsyncClient.listEvaluatorVersions":"Azure.AI.Projects.Evaluators.listVersions","com.azure.ai.projects.EvaluatorsAsyncClient.listLatestEvaluatorVersions":"Azure.AI.Projects.Evaluators.listLatestVersions","com.azure.ai.projects.EvaluatorsAsyncClient.updateEvaluatorVersion":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.EvaluatorsAsyncClient.updateEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.EvaluatorsClient":"Azure.AI.Projects.Evaluators","com.azure.ai.projects.EvaluatorsClient.createEvaluatorVersion":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsClient.createEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsClient.deleteEvaluatorVersion":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsClient.deleteEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsClient.getEvaluatorVersion":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsClient.getEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsClient.listEvaluatorVersions":"Azure.AI.Projects.Evaluators.listVersions","com.azure.ai.projects.EvaluatorsClient.listLatestEvaluatorVersions":"Azure.AI.Projects.Evaluators.listLatestVersions","com.azure.ai.projects.EvaluatorsClient.updateEvaluatorVersion":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.EvaluatorsClient.updateEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.IndexesAsyncClient":"Azure.AI.Projects.Indexes","com.azure.ai.projects.IndexesAsyncClient.createOrUpdateIndexVersion":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesAsyncClient.createOrUpdateIndexVersionWithResponse":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesAsyncClient.deleteIndexVersion":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesAsyncClient.deleteIndexVersionWithResponse":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesAsyncClient.getIndexVersion":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesAsyncClient.getIndexVersionWithResponse":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesAsyncClient.listIndexVersions":"Azure.AI.Projects.Indexes.listVersions","com.azure.ai.projects.IndexesAsyncClient.listLatestIndexVersions":"Azure.AI.Projects.Indexes.listLatest","com.azure.ai.projects.IndexesClient":"Azure.AI.Projects.Indexes","com.azure.ai.projects.IndexesClient.createOrUpdateIndexVersion":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesClient.createOrUpdateIndexVersionWithResponse":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesClient.deleteIndexVersion":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesClient.deleteIndexVersionWithResponse":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesClient.getIndexVersion":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesClient.getIndexVersionWithResponse":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesClient.listIndexVersions":"Azure.AI.Projects.Indexes.listVersions","com.azure.ai.projects.IndexesClient.listLatestIndexVersions":"Azure.AI.Projects.Indexes.listLatest","com.azure.ai.projects.InsightsAsyncClient":"Azure.AI.Projects.Insights","com.azure.ai.projects.InsightsAsyncClient.generateInsight":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsAsyncClient.generateInsightWithResponse":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsAsyncClient.getInsight":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsAsyncClient.getInsightWithResponse":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsAsyncClient.listInsights":"Azure.AI.Projects.Insights.list","com.azure.ai.projects.InsightsClient":"Azure.AI.Projects.Insights","com.azure.ai.projects.InsightsClient.generateInsight":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsClient.generateInsightWithResponse":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsClient.getInsight":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsClient.getInsightWithResponse":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsClient.listInsights":"Azure.AI.Projects.Insights.list","com.azure.ai.projects.RedTeamsAsyncClient":"Azure.AI.Projects.RedTeams","com.azure.ai.projects.RedTeamsAsyncClient.createRedTeamRun":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsAsyncClient.createRedTeamRunWithResponse":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsAsyncClient.getRedTeam":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsAsyncClient.getRedTeamWithResponse":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsAsyncClient.listRedTeams":"Azure.AI.Projects.RedTeams.list","com.azure.ai.projects.RedTeamsClient":"Azure.AI.Projects.RedTeams","com.azure.ai.projects.RedTeamsClient.createRedTeamRun":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsClient.createRedTeamRunWithResponse":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsClient.getRedTeam":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsClient.getRedTeamWithResponse":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsClient.listRedTeams":"Azure.AI.Projects.RedTeams.list","com.azure.ai.projects.SchedulesAsyncClient":"Azure.AI.Projects.Schedules","com.azure.ai.projects.SchedulesAsyncClient.createOrUpdateSchedule":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesAsyncClient.createOrUpdateScheduleWithResponse":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesAsyncClient.deleteSchedule":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesAsyncClient.deleteScheduleWithResponse":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesAsyncClient.getSchedule":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesAsyncClient.getScheduleRun":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesAsyncClient.getScheduleRunWithResponse":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesAsyncClient.getScheduleWithResponse":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesAsyncClient.listScheduleRuns":"Azure.AI.Projects.Schedules.listRuns","com.azure.ai.projects.SchedulesAsyncClient.listSchedules":"Azure.AI.Projects.Schedules.list","com.azure.ai.projects.SchedulesClient":"Azure.AI.Projects.Schedules","com.azure.ai.projects.SchedulesClient.createOrUpdateSchedule":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesClient.createOrUpdateScheduleWithResponse":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesClient.deleteSchedule":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesClient.deleteScheduleWithResponse":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesClient.getSchedule":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesClient.getScheduleRun":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesClient.getScheduleRunWithResponse":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesClient.getScheduleWithResponse":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesClient.listScheduleRuns":"Azure.AI.Projects.Schedules.listRuns","com.azure.ai.projects.SchedulesClient.listSchedules":"Azure.AI.Projects.Schedules.list","com.azure.ai.projects.SkillsAsyncClient":"Azure.AI.Projects.Skills","com.azure.ai.projects.SkillsAsyncClient.createSkill":"Azure.AI.Projects.Skills.createSkill","com.azure.ai.projects.SkillsAsyncClient.createSkillFromPackage":"Azure.AI.Projects.Skills.createSkillFromPackage","com.azure.ai.projects.SkillsAsyncClient.createSkillFromPackageWithResponse":"Azure.AI.Projects.Skills.createSkillFromPackage","com.azure.ai.projects.SkillsAsyncClient.createSkillWithResponse":"Azure.AI.Projects.Skills.createSkill","com.azure.ai.projects.SkillsAsyncClient.downloadSkill":"Azure.AI.Projects.Skills.downloadSkill","com.azure.ai.projects.SkillsAsyncClient.downloadSkillWithResponse":"Azure.AI.Projects.Skills.downloadSkill","com.azure.ai.projects.SkillsAsyncClient.getSkill":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsAsyncClient.getSkillWithResponse":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsAsyncClient.listSkills":"Azure.AI.Projects.Skills.listSkills","com.azure.ai.projects.SkillsAsyncClient.updateSkill":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.SkillsAsyncClient.updateSkillWithResponse":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.SkillsClient":"Azure.AI.Projects.Skills","com.azure.ai.projects.SkillsClient.createSkill":"Azure.AI.Projects.Skills.createSkill","com.azure.ai.projects.SkillsClient.createSkillFromPackage":"Azure.AI.Projects.Skills.createSkillFromPackage","com.azure.ai.projects.SkillsClient.createSkillFromPackageWithResponse":"Azure.AI.Projects.Skills.createSkillFromPackage","com.azure.ai.projects.SkillsClient.createSkillWithResponse":"Azure.AI.Projects.Skills.createSkill","com.azure.ai.projects.SkillsClient.downloadSkill":"Azure.AI.Projects.Skills.downloadSkill","com.azure.ai.projects.SkillsClient.downloadSkillWithResponse":"Azure.AI.Projects.Skills.downloadSkill","com.azure.ai.projects.SkillsClient.getSkill":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsClient.getSkillWithResponse":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsClient.listSkills":"Azure.AI.Projects.Skills.listSkills","com.azure.ai.projects.SkillsClient.updateSkill":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.SkillsClient.updateSkillWithResponse":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.implementation.models.CreateSkillRequest":"Azure.AI.Projects.createSkill.Request.anonymous","com.azure.ai.projects.implementation.models.UpdateSkillRequest":"Azure.AI.Projects.updateSkill.Request.anonymous","com.azure.ai.projects.models.AIProjectIndex":"Azure.AI.Projects.Index","com.azure.ai.projects.models.AgentClusterInsightRequest":"Azure.AI.Projects.AgentClusterInsightRequest","com.azure.ai.projects.models.AgentClusterInsightResult":"Azure.AI.Projects.AgentClusterInsightResult","com.azure.ai.projects.models.AgentTaxonomyInput":"Azure.AI.Projects.AgentTaxonomyInput","com.azure.ai.projects.models.AgenticIdentityPreviewCredential":"Azure.AI.Projects.AgenticIdentityPreviewCredentials","com.azure.ai.projects.models.ApiKeyCredential":"Azure.AI.Projects.ApiKeyCredentials","com.azure.ai.projects.models.AttackStrategy":"Azure.AI.Projects.AttackStrategy","com.azure.ai.projects.models.AzureAIAgentTarget":"Azure.AI.Projects.AzureAIAgentTarget","com.azure.ai.projects.models.AzureAIModelTarget":"Azure.AI.Projects.AzureAIModelTarget","com.azure.ai.projects.models.AzureAISearchIndex":"Azure.AI.Projects.AzureAISearchIndex","com.azure.ai.projects.models.AzureOpenAIModelConfiguration":"Azure.AI.Projects.AzureOpenAIModelConfiguration","com.azure.ai.projects.models.BaseCredential":"Azure.AI.Projects.BaseCredentials","com.azure.ai.projects.models.BlobReference":"Azure.AI.Projects.BlobReference","com.azure.ai.projects.models.BlobReferenceSasCredential":"Azure.AI.Projects.SasCredential","com.azure.ai.projects.models.ChartCoordinate":"Azure.AI.Projects.ChartCoordinate","com.azure.ai.projects.models.ClusterInsightResult":"Azure.AI.Projects.ClusterInsightResult","com.azure.ai.projects.models.ClusterTokenUsage":"Azure.AI.Projects.ClusterTokenUsage","com.azure.ai.projects.models.CodeBasedEvaluatorDefinition":"Azure.AI.Projects.CodeBasedEvaluatorDefinition","com.azure.ai.projects.models.Connection":"Azure.AI.Projects.Connection","com.azure.ai.projects.models.ConnectionType":"Azure.AI.Projects.ConnectionType","com.azure.ai.projects.models.ContinuousEvaluationRuleAction":"Azure.AI.Projects.ContinuousEvaluationRuleAction","com.azure.ai.projects.models.CosmosDBIndex":"Azure.AI.Projects.CosmosDBIndex","com.azure.ai.projects.models.CredentialType":"Azure.AI.Projects.CredentialType","com.azure.ai.projects.models.CronTrigger":"Azure.AI.Projects.CronTrigger","com.azure.ai.projects.models.CustomCredential":"Azure.AI.Projects.CustomCredential","com.azure.ai.projects.models.DailyRecurrenceSchedule":"Azure.AI.Projects.DailyRecurrenceSchedule","com.azure.ai.projects.models.DatasetCredential":"Azure.AI.Projects.AssetCredentialResponse","com.azure.ai.projects.models.DatasetType":"Azure.AI.Projects.DatasetType","com.azure.ai.projects.models.DatasetVersion":"Azure.AI.Projects.DatasetVersion","com.azure.ai.projects.models.Deployment":"Azure.AI.Projects.Deployment","com.azure.ai.projects.models.DeploymentType":"Azure.AI.Projects.DeploymentType","com.azure.ai.projects.models.EmbeddingConfiguration":"Azure.AI.Projects.EmbeddingConfiguration","com.azure.ai.projects.models.EntraIdCredential":"Azure.AI.Projects.EntraIDCredentials","com.azure.ai.projects.models.EvaluationComparisonInsightRequest":"Azure.AI.Projects.EvaluationComparisonInsightRequest","com.azure.ai.projects.models.EvaluationComparisonInsightResult":"Azure.AI.Projects.EvaluationComparisonInsightResult","com.azure.ai.projects.models.EvaluationResult":"Azure.AI.Projects.EvalResult","com.azure.ai.projects.models.EvaluationResultSample":"Azure.AI.Projects.EvaluationResultSample","com.azure.ai.projects.models.EvaluationRule":"Azure.AI.Projects.EvaluationRule","com.azure.ai.projects.models.EvaluationRuleAction":"Azure.AI.Projects.EvaluationRuleAction","com.azure.ai.projects.models.EvaluationRuleActionType":"Azure.AI.Projects.EvaluationRuleActionType","com.azure.ai.projects.models.EvaluationRuleEventType":"Azure.AI.Projects.EvaluationRuleEventType","com.azure.ai.projects.models.EvaluationRuleFilter":"Azure.AI.Projects.EvaluationRuleFilter","com.azure.ai.projects.models.EvaluationRunClusterInsightRequest":"Azure.AI.Projects.EvaluationRunClusterInsightRequest","com.azure.ai.projects.models.EvaluationRunClusterInsightResult":"Azure.AI.Projects.EvaluationRunClusterInsightResult","com.azure.ai.projects.models.EvaluationRunResultCompareItem":"Azure.AI.Projects.EvalRunResultCompareItem","com.azure.ai.projects.models.EvaluationRunResultComparison":"Azure.AI.Projects.EvalRunResultComparison","com.azure.ai.projects.models.EvaluationRunResultSummary":"Azure.AI.Projects.EvalRunResultSummary","com.azure.ai.projects.models.EvaluationScheduleTask":"Azure.AI.Projects.EvaluationScheduleTask","com.azure.ai.projects.models.EvaluationScheduleTaskEvalRun":"Azure.AI.Projects.EvaluationScheduleTask.evalRun.anonymous","com.azure.ai.projects.models.EvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomy","com.azure.ai.projects.models.EvaluationTaxonomyInput":"Azure.AI.Projects.EvaluationTaxonomyInput","com.azure.ai.projects.models.EvaluationTaxonomyInputType":"Azure.AI.Projects.EvaluationTaxonomyInputType","com.azure.ai.projects.models.EvaluatorCategory":"Azure.AI.Projects.EvaluatorCategory","com.azure.ai.projects.models.EvaluatorDefinition":"Azure.AI.Projects.EvaluatorDefinition","com.azure.ai.projects.models.EvaluatorDefinitionType":"Azure.AI.Projects.EvaluatorDefinitionType","com.azure.ai.projects.models.EvaluatorMetric":"Azure.AI.Projects.EvaluatorMetric","com.azure.ai.projects.models.EvaluatorMetricDirection":"Azure.AI.Projects.EvaluatorMetricDirection","com.azure.ai.projects.models.EvaluatorMetricType":"Azure.AI.Projects.EvaluatorMetricType","com.azure.ai.projects.models.EvaluatorType":"Azure.AI.Projects.EvaluatorType","com.azure.ai.projects.models.EvaluatorVersion":"Azure.AI.Projects.EvaluatorVersion","com.azure.ai.projects.models.FieldMapping":"Azure.AI.Projects.FieldMapping","com.azure.ai.projects.models.FileDatasetVersion":"Azure.AI.Projects.FileDatasetVersion","com.azure.ai.projects.models.FolderDatasetVersion":"Azure.AI.Projects.FolderDatasetVersion","com.azure.ai.projects.models.FoundryFeaturesOptInKeys":"Azure.AI.Projects.FoundryFeaturesOptInKeys","com.azure.ai.projects.models.HourlyRecurrenceSchedule":"Azure.AI.Projects.HourlyRecurrenceSchedule","com.azure.ai.projects.models.HumanEvaluationPreviewRuleAction":"Azure.AI.Projects.HumanEvaluationPreviewRuleAction","com.azure.ai.projects.models.IndexType":"Azure.AI.Projects.IndexType","com.azure.ai.projects.models.Insight":"Azure.AI.Projects.Insight","com.azure.ai.projects.models.InsightCluster":"Azure.AI.Projects.InsightCluster","com.azure.ai.projects.models.InsightModelConfiguration":"Azure.AI.Projects.InsightModelConfiguration","com.azure.ai.projects.models.InsightRequest":"Azure.AI.Projects.InsightRequest","com.azure.ai.projects.models.InsightResult":"Azure.AI.Projects.InsightResult","com.azure.ai.projects.models.InsightSample":"Azure.AI.Projects.InsightSample","com.azure.ai.projects.models.InsightScheduleTask":"Azure.AI.Projects.InsightScheduleTask","com.azure.ai.projects.models.InsightSummary":"Azure.AI.Projects.InsightSummary","com.azure.ai.projects.models.InsightType":"Azure.AI.Projects.InsightType","com.azure.ai.projects.models.InsightsMetadata":"Azure.AI.Projects.InsightsMetadata","com.azure.ai.projects.models.ListVersionsRequestType":"Azure.AI.Projects.listVersions.RequestType.anonymous","com.azure.ai.projects.models.ManagedAzureAISearchIndex":"Azure.AI.Projects.ManagedAzureAISearchIndex","com.azure.ai.projects.models.ModelDeployment":"Azure.AI.Projects.ModelDeployment","com.azure.ai.projects.models.ModelDeploymentSku":"Azure.AI.Projects.Sku","com.azure.ai.projects.models.ModelSamplingParams":"Azure.AI.Projects.ModelSamplingParams","com.azure.ai.projects.models.MonthlyRecurrenceSchedule":"Azure.AI.Projects.MonthlyRecurrenceSchedule","com.azure.ai.projects.models.NoAuthenticationCredential":"Azure.AI.Projects.NoAuthenticationCredentials","com.azure.ai.projects.models.OneTimeTrigger":"Azure.AI.Projects.OneTimeTrigger","com.azure.ai.projects.models.OperationStatus":"Azure.Core.Foundations.OperationState","com.azure.ai.projects.models.PendingUploadRequest":"Azure.AI.Projects.PendingUploadRequest","com.azure.ai.projects.models.PendingUploadResponse":"Azure.AI.Projects.PendingUploadResponse","com.azure.ai.projects.models.PendingUploadType":"Azure.AI.Projects.PendingUploadType","com.azure.ai.projects.models.PromptBasedEvaluatorDefinition":"Azure.AI.Projects.PromptBasedEvaluatorDefinition","com.azure.ai.projects.models.RecurrenceSchedule":"Azure.AI.Projects.RecurrenceSchedule","com.azure.ai.projects.models.RecurrenceTrigger":"Azure.AI.Projects.RecurrenceTrigger","com.azure.ai.projects.models.RecurrenceType":"Azure.AI.Projects.RecurrenceType","com.azure.ai.projects.models.RedTeam":"Azure.AI.Projects.RedTeam","com.azure.ai.projects.models.RiskCategory":"Azure.AI.Projects.RiskCategory","com.azure.ai.projects.models.SampleType":"Azure.AI.Projects.SampleType","com.azure.ai.projects.models.SasCredential":"Azure.AI.Projects.SASCredentials","com.azure.ai.projects.models.Schedule":"Azure.AI.Projects.Schedule","com.azure.ai.projects.models.ScheduleProvisioningStatus":"Azure.AI.Projects.ScheduleProvisioningStatus","com.azure.ai.projects.models.ScheduleRun":"Azure.AI.Projects.ScheduleRun","com.azure.ai.projects.models.ScheduleTask":"Azure.AI.Projects.ScheduleTask","com.azure.ai.projects.models.ScheduleTaskType":"Azure.AI.Projects.ScheduleTaskType","com.azure.ai.projects.models.SkillDetails":"Azure.AI.Projects.SkillObject","com.azure.ai.projects.models.Target":"Azure.AI.Projects.Target","com.azure.ai.projects.models.TargetConfig":"Azure.AI.Projects.TargetConfig","com.azure.ai.projects.models.TaxonomyCategory":"Azure.AI.Projects.TaxonomyCategory","com.azure.ai.projects.models.TaxonomySubCategory":"Azure.AI.Projects.TaxonomySubCategory","com.azure.ai.projects.models.ToolDescription":"Azure.AI.Projects.ToolDescription","com.azure.ai.projects.models.TreatmentEffectType":"Azure.AI.Projects.TreatmentEffectType","com.azure.ai.projects.models.Trigger":"Azure.AI.Projects.Trigger","com.azure.ai.projects.models.TriggerType":"Azure.AI.Projects.TriggerType","com.azure.ai.projects.models.WeeklyRecurrenceSchedule":"Azure.AI.Projects.WeeklyRecurrenceSchedule"},"generatedFiles":["src/main/java/com/azure/ai/projects/AIProjectClientBuilder.java","src/main/java/com/azure/ai/projects/AIProjectsServiceVersion.java","src/main/java/com/azure/ai/projects/ConnectionsAsyncClient.java","src/main/java/com/azure/ai/projects/ConnectionsClient.java","src/main/java/com/azure/ai/projects/DatasetsAsyncClient.java","src/main/java/com/azure/ai/projects/DatasetsClient.java","src/main/java/com/azure/ai/projects/DeploymentsAsyncClient.java","src/main/java/com/azure/ai/projects/DeploymentsClient.java","src/main/java/com/azure/ai/projects/EvaluationRulesAsyncClient.java","src/main/java/com/azure/ai/projects/EvaluationRulesClient.java","src/main/java/com/azure/ai/projects/EvaluationTaxonomiesAsyncClient.java","src/main/java/com/azure/ai/projects/EvaluationTaxonomiesClient.java","src/main/java/com/azure/ai/projects/EvaluatorsAsyncClient.java","src/main/java/com/azure/ai/projects/EvaluatorsClient.java","src/main/java/com/azure/ai/projects/IndexesAsyncClient.java","src/main/java/com/azure/ai/projects/IndexesClient.java","src/main/java/com/azure/ai/projects/InsightsAsyncClient.java","src/main/java/com/azure/ai/projects/InsightsClient.java","src/main/java/com/azure/ai/projects/RedTeamsAsyncClient.java","src/main/java/com/azure/ai/projects/RedTeamsClient.java","src/main/java/com/azure/ai/projects/SchedulesAsyncClient.java","src/main/java/com/azure/ai/projects/SchedulesClient.java","src/main/java/com/azure/ai/projects/SkillsAsyncClient.java","src/main/java/com/azure/ai/projects/SkillsClient.java","src/main/java/com/azure/ai/projects/implementation/AIProjectClientImpl.java","src/main/java/com/azure/ai/projects/implementation/ConnectionsImpl.java","src/main/java/com/azure/ai/projects/implementation/DatasetsImpl.java","src/main/java/com/azure/ai/projects/implementation/DeploymentsImpl.java","src/main/java/com/azure/ai/projects/implementation/EvaluationRulesImpl.java","src/main/java/com/azure/ai/projects/implementation/EvaluationTaxonomiesImpl.java","src/main/java/com/azure/ai/projects/implementation/EvaluatorsImpl.java","src/main/java/com/azure/ai/projects/implementation/IndexesImpl.java","src/main/java/com/azure/ai/projects/implementation/InsightsImpl.java","src/main/java/com/azure/ai/projects/implementation/JsonMergePatchHelper.java","src/main/java/com/azure/ai/projects/implementation/RedTeamsImpl.java","src/main/java/com/azure/ai/projects/implementation/SchedulesImpl.java","src/main/java/com/azure/ai/projects/implementation/SkillsImpl.java","src/main/java/com/azure/ai/projects/implementation/models/CreateSkillRequest.java","src/main/java/com/azure/ai/projects/implementation/models/UpdateSkillRequest.java","src/main/java/com/azure/ai/projects/implementation/models/package-info.java","src/main/java/com/azure/ai/projects/implementation/package-info.java","src/main/java/com/azure/ai/projects/models/AIProjectIndex.java","src/main/java/com/azure/ai/projects/models/AgentClusterInsightRequest.java","src/main/java/com/azure/ai/projects/models/AgentClusterInsightResult.java","src/main/java/com/azure/ai/projects/models/AgentTaxonomyInput.java","src/main/java/com/azure/ai/projects/models/AgenticIdentityPreviewCredential.java","src/main/java/com/azure/ai/projects/models/ApiKeyCredential.java","src/main/java/com/azure/ai/projects/models/AttackStrategy.java","src/main/java/com/azure/ai/projects/models/AzureAIAgentTarget.java","src/main/java/com/azure/ai/projects/models/AzureAIModelTarget.java","src/main/java/com/azure/ai/projects/models/AzureAISearchIndex.java","src/main/java/com/azure/ai/projects/models/AzureOpenAIModelConfiguration.java","src/main/java/com/azure/ai/projects/models/BaseCredential.java","src/main/java/com/azure/ai/projects/models/BlobReference.java","src/main/java/com/azure/ai/projects/models/BlobReferenceSasCredential.java","src/main/java/com/azure/ai/projects/models/ChartCoordinate.java","src/main/java/com/azure/ai/projects/models/ClusterInsightResult.java","src/main/java/com/azure/ai/projects/models/ClusterTokenUsage.java","src/main/java/com/azure/ai/projects/models/CodeBasedEvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/Connection.java","src/main/java/com/azure/ai/projects/models/ConnectionType.java","src/main/java/com/azure/ai/projects/models/ContinuousEvaluationRuleAction.java","src/main/java/com/azure/ai/projects/models/CosmosDBIndex.java","src/main/java/com/azure/ai/projects/models/CredentialType.java","src/main/java/com/azure/ai/projects/models/CronTrigger.java","src/main/java/com/azure/ai/projects/models/CustomCredential.java","src/main/java/com/azure/ai/projects/models/DailyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/DatasetCredential.java","src/main/java/com/azure/ai/projects/models/DatasetType.java","src/main/java/com/azure/ai/projects/models/DatasetVersion.java","src/main/java/com/azure/ai/projects/models/Deployment.java","src/main/java/com/azure/ai/projects/models/DeploymentType.java","src/main/java/com/azure/ai/projects/models/EmbeddingConfiguration.java","src/main/java/com/azure/ai/projects/models/EntraIdCredential.java","src/main/java/com/azure/ai/projects/models/EvaluationComparisonInsightRequest.java","src/main/java/com/azure/ai/projects/models/EvaluationComparisonInsightResult.java","src/main/java/com/azure/ai/projects/models/EvaluationResult.java","src/main/java/com/azure/ai/projects/models/EvaluationResultSample.java","src/main/java/com/azure/ai/projects/models/EvaluationRule.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleAction.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleActionType.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleEventType.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleFilter.java","src/main/java/com/azure/ai/projects/models/EvaluationRunClusterInsightRequest.java","src/main/java/com/azure/ai/projects/models/EvaluationRunClusterInsightResult.java","src/main/java/com/azure/ai/projects/models/EvaluationRunResultCompareItem.java","src/main/java/com/azure/ai/projects/models/EvaluationRunResultComparison.java","src/main/java/com/azure/ai/projects/models/EvaluationRunResultSummary.java","src/main/java/com/azure/ai/projects/models/EvaluationScheduleTask.java","src/main/java/com/azure/ai/projects/models/EvaluationScheduleTaskEvalRun.java","src/main/java/com/azure/ai/projects/models/EvaluationTaxonomy.java","src/main/java/com/azure/ai/projects/models/EvaluationTaxonomyInput.java","src/main/java/com/azure/ai/projects/models/EvaluationTaxonomyInputType.java","src/main/java/com/azure/ai/projects/models/EvaluatorCategory.java","src/main/java/com/azure/ai/projects/models/EvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/EvaluatorDefinitionType.java","src/main/java/com/azure/ai/projects/models/EvaluatorMetric.java","src/main/java/com/azure/ai/projects/models/EvaluatorMetricDirection.java","src/main/java/com/azure/ai/projects/models/EvaluatorMetricType.java","src/main/java/com/azure/ai/projects/models/EvaluatorType.java","src/main/java/com/azure/ai/projects/models/EvaluatorVersion.java","src/main/java/com/azure/ai/projects/models/FieldMapping.java","src/main/java/com/azure/ai/projects/models/FileDatasetVersion.java","src/main/java/com/azure/ai/projects/models/FolderDatasetVersion.java","src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java","src/main/java/com/azure/ai/projects/models/HourlyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/HumanEvaluationPreviewRuleAction.java","src/main/java/com/azure/ai/projects/models/IndexType.java","src/main/java/com/azure/ai/projects/models/Insight.java","src/main/java/com/azure/ai/projects/models/InsightCluster.java","src/main/java/com/azure/ai/projects/models/InsightModelConfiguration.java","src/main/java/com/azure/ai/projects/models/InsightRequest.java","src/main/java/com/azure/ai/projects/models/InsightResult.java","src/main/java/com/azure/ai/projects/models/InsightSample.java","src/main/java/com/azure/ai/projects/models/InsightScheduleTask.java","src/main/java/com/azure/ai/projects/models/InsightSummary.java","src/main/java/com/azure/ai/projects/models/InsightType.java","src/main/java/com/azure/ai/projects/models/InsightsMetadata.java","src/main/java/com/azure/ai/projects/models/ListVersionsRequestType.java","src/main/java/com/azure/ai/projects/models/ManagedAzureAISearchIndex.java","src/main/java/com/azure/ai/projects/models/ModelDeployment.java","src/main/java/com/azure/ai/projects/models/ModelDeploymentSku.java","src/main/java/com/azure/ai/projects/models/ModelSamplingParams.java","src/main/java/com/azure/ai/projects/models/MonthlyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/NoAuthenticationCredential.java","src/main/java/com/azure/ai/projects/models/OneTimeTrigger.java","src/main/java/com/azure/ai/projects/models/OperationStatus.java","src/main/java/com/azure/ai/projects/models/PendingUploadRequest.java","src/main/java/com/azure/ai/projects/models/PendingUploadResponse.java","src/main/java/com/azure/ai/projects/models/PendingUploadType.java","src/main/java/com/azure/ai/projects/models/PromptBasedEvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/RecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java","src/main/java/com/azure/ai/projects/models/RecurrenceType.java","src/main/java/com/azure/ai/projects/models/RedTeam.java","src/main/java/com/azure/ai/projects/models/RiskCategory.java","src/main/java/com/azure/ai/projects/models/SampleType.java","src/main/java/com/azure/ai/projects/models/SasCredential.java","src/main/java/com/azure/ai/projects/models/Schedule.java","src/main/java/com/azure/ai/projects/models/ScheduleProvisioningStatus.java","src/main/java/com/azure/ai/projects/models/ScheduleRun.java","src/main/java/com/azure/ai/projects/models/ScheduleTask.java","src/main/java/com/azure/ai/projects/models/ScheduleTaskType.java","src/main/java/com/azure/ai/projects/models/SkillDetails.java","src/main/java/com/azure/ai/projects/models/Target.java","src/main/java/com/azure/ai/projects/models/TargetConfig.java","src/main/java/com/azure/ai/projects/models/TaxonomyCategory.java","src/main/java/com/azure/ai/projects/models/TaxonomySubCategory.java","src/main/java/com/azure/ai/projects/models/ToolDescription.java","src/main/java/com/azure/ai/projects/models/TreatmentEffectType.java","src/main/java/com/azure/ai/projects/models/Trigger.java","src/main/java/com/azure/ai/projects/models/TriggerType.java","src/main/java/com/azure/ai/projects/models/WeeklyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/package-info.java","src/main/java/com/azure/ai/projects/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersions":{"Azure.AI.Projects":"v1"},"crossLanguagePackageId":"Azure.AI.Projects","crossLanguageVersion":"3e64ba85b9d6","crossLanguageDefinitions":{"com.azure.ai.projects.AIProjectClientBuilder":"Azure.AI.Projects","com.azure.ai.projects.ConnectionsAsyncClient":"Azure.AI.Projects.Connections","com.azure.ai.projects.ConnectionsAsyncClient.getConnection":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsAsyncClient.getConnectionWithCredentials":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsAsyncClient.getConnectionWithCredentialsWithResponse":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsAsyncClient.getConnectionWithResponse":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsAsyncClient.listConnections":"Azure.AI.Projects.Connections.list","com.azure.ai.projects.ConnectionsClient":"Azure.AI.Projects.Connections","com.azure.ai.projects.ConnectionsClient.getConnection":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsClient.getConnectionWithCredentials":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsClient.getConnectionWithCredentialsWithResponse":"Azure.AI.Projects.Connections.getWithCredentials","com.azure.ai.projects.ConnectionsClient.getConnectionWithResponse":"Azure.AI.Projects.Connections.get","com.azure.ai.projects.ConnectionsClient.listConnections":"Azure.AI.Projects.Connections.list","com.azure.ai.projects.DataGenerationJobsAsyncClient":"Azure.AI.Projects.DataGenerationJobs","com.azure.ai.projects.DataGenerationJobsAsyncClient.cancelGenerationJob":"Azure.AI.Projects.DataGenerationJobs.cancel","com.azure.ai.projects.DataGenerationJobsAsyncClient.cancelGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.cancel","com.azure.ai.projects.DataGenerationJobsAsyncClient.createGenerationJob":"Azure.AI.Projects.DataGenerationJobs.create","com.azure.ai.projects.DataGenerationJobsAsyncClient.createGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.create","com.azure.ai.projects.DataGenerationJobsAsyncClient.deleteGenerationJob":"Azure.AI.Projects.DataGenerationJobs.delete","com.azure.ai.projects.DataGenerationJobsAsyncClient.deleteGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.delete","com.azure.ai.projects.DataGenerationJobsAsyncClient.getGenerationJob":"Azure.AI.Projects.DataGenerationJobs.get","com.azure.ai.projects.DataGenerationJobsAsyncClient.getGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.get","com.azure.ai.projects.DataGenerationJobsAsyncClient.listGenerationJobs":"Azure.AI.Projects.DataGenerationJobs.list","com.azure.ai.projects.DataGenerationJobsClient":"Azure.AI.Projects.DataGenerationJobs","com.azure.ai.projects.DataGenerationJobsClient.cancelGenerationJob":"Azure.AI.Projects.DataGenerationJobs.cancel","com.azure.ai.projects.DataGenerationJobsClient.cancelGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.cancel","com.azure.ai.projects.DataGenerationJobsClient.createGenerationJob":"Azure.AI.Projects.DataGenerationJobs.create","com.azure.ai.projects.DataGenerationJobsClient.createGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.create","com.azure.ai.projects.DataGenerationJobsClient.deleteGenerationJob":"Azure.AI.Projects.DataGenerationJobs.delete","com.azure.ai.projects.DataGenerationJobsClient.deleteGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.delete","com.azure.ai.projects.DataGenerationJobsClient.getGenerationJob":"Azure.AI.Projects.DataGenerationJobs.get","com.azure.ai.projects.DataGenerationJobsClient.getGenerationJobWithResponse":"Azure.AI.Projects.DataGenerationJobs.get","com.azure.ai.projects.DataGenerationJobsClient.listGenerationJobs":"Azure.AI.Projects.DataGenerationJobs.list","com.azure.ai.projects.DatasetsAsyncClient":"Azure.AI.Projects.Datasets","com.azure.ai.projects.DatasetsAsyncClient.createOrUpdateDatasetVersion":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsAsyncClient.createOrUpdateDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsAsyncClient.deleteDatasetVersion":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsAsyncClient.deleteDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsAsyncClient.getCredentials":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsAsyncClient.getCredentialsWithResponse":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsAsyncClient.getDatasetVersion":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsAsyncClient.getDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsAsyncClient.listDatasetVersions":"Azure.AI.Projects.Datasets.listVersions","com.azure.ai.projects.DatasetsAsyncClient.listLatestDatasetVersions":"Azure.AI.Projects.Datasets.listLatest","com.azure.ai.projects.DatasetsAsyncClient.pendingUpload":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DatasetsAsyncClient.pendingUploadWithResponse":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DatasetsClient":"Azure.AI.Projects.Datasets","com.azure.ai.projects.DatasetsClient.createOrUpdateDatasetVersion":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsClient.createOrUpdateDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.createOrUpdateVersion","com.azure.ai.projects.DatasetsClient.deleteDatasetVersion":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsClient.deleteDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.deleteVersion","com.azure.ai.projects.DatasetsClient.getCredentials":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsClient.getCredentialsWithResponse":"Azure.AI.Projects.Datasets.getCredentials","com.azure.ai.projects.DatasetsClient.getDatasetVersion":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsClient.getDatasetVersionWithResponse":"Azure.AI.Projects.Datasets.getVersion","com.azure.ai.projects.DatasetsClient.listDatasetVersions":"Azure.AI.Projects.Datasets.listVersions","com.azure.ai.projects.DatasetsClient.listLatestDatasetVersions":"Azure.AI.Projects.Datasets.listLatest","com.azure.ai.projects.DatasetsClient.pendingUpload":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DatasetsClient.pendingUploadWithResponse":"Azure.AI.Projects.Datasets.startPendingUploadVersion","com.azure.ai.projects.DeploymentsAsyncClient":"Azure.AI.Projects.Deployments","com.azure.ai.projects.DeploymentsAsyncClient.getDeployment":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsAsyncClient.getDeploymentWithResponse":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsAsyncClient.listDeployments":"Azure.AI.Projects.Deployments.list","com.azure.ai.projects.DeploymentsClient":"Azure.AI.Projects.Deployments","com.azure.ai.projects.DeploymentsClient.getDeployment":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsClient.getDeploymentWithResponse":"Azure.AI.Projects.Deployments.get","com.azure.ai.projects.DeploymentsClient.listDeployments":"Azure.AI.Projects.Deployments.list","com.azure.ai.projects.EvaluationRulesAsyncClient":"Azure.AI.Projects.EvaluationRules","com.azure.ai.projects.EvaluationRulesAsyncClient.createOrUpdateEvaluationRule":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesAsyncClient.createOrUpdateEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesAsyncClient.deleteEvaluationRule":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesAsyncClient.deleteEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesAsyncClient.getEvaluationRule":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesAsyncClient.getEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesAsyncClient.listEvaluationRules":"Azure.AI.Projects.EvaluationRules.list","com.azure.ai.projects.EvaluationRulesClient":"Azure.AI.Projects.EvaluationRules","com.azure.ai.projects.EvaluationRulesClient.createOrUpdateEvaluationRule":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesClient.createOrUpdateEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.createOrUpdate","com.azure.ai.projects.EvaluationRulesClient.deleteEvaluationRule":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesClient.deleteEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.delete","com.azure.ai.projects.EvaluationRulesClient.getEvaluationRule":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesClient.getEvaluationRuleWithResponse":"Azure.AI.Projects.EvaluationRules.get","com.azure.ai.projects.EvaluationRulesClient.listEvaluationRules":"Azure.AI.Projects.EvaluationRules.list","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient":"Azure.AI.Projects.EvaluationTaxonomies","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.createEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.createEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.deleteEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.deleteEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.getEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.getEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.listEvaluationTaxonomies":"Azure.AI.Projects.EvaluationTaxonomies.list","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.updateEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluationTaxonomiesAsyncClient.updateEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluationTaxonomiesClient":"Azure.AI.Projects.EvaluationTaxonomies","com.azure.ai.projects.EvaluationTaxonomiesClient.createEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesClient.createEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.create","com.azure.ai.projects.EvaluationTaxonomiesClient.deleteEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesClient.deleteEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.delete","com.azure.ai.projects.EvaluationTaxonomiesClient.getEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesClient.getEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.get","com.azure.ai.projects.EvaluationTaxonomiesClient.listEvaluationTaxonomies":"Azure.AI.Projects.EvaluationTaxonomies.list","com.azure.ai.projects.EvaluationTaxonomiesClient.updateEvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluationTaxonomiesClient.updateEvaluationTaxonomyWithResponse":"Azure.AI.Projects.EvaluationTaxonomies.update","com.azure.ai.projects.EvaluatorsAsyncClient":"Azure.AI.Projects.Evaluators","com.azure.ai.projects.EvaluatorsAsyncClient.cancelEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.cancel","com.azure.ai.projects.EvaluatorsAsyncClient.cancelEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.cancel","com.azure.ai.projects.EvaluatorsAsyncClient.createEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.create","com.azure.ai.projects.EvaluatorsAsyncClient.createEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.create","com.azure.ai.projects.EvaluatorsAsyncClient.createEvaluatorVersion":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsAsyncClient.createEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsAsyncClient.deleteEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.delete","com.azure.ai.projects.EvaluatorsAsyncClient.deleteEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.delete","com.azure.ai.projects.EvaluatorsAsyncClient.deleteEvaluatorVersion":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsAsyncClient.deleteEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsAsyncClient.getCredentials":"Azure.AI.Projects.Evaluators.getCredentials","com.azure.ai.projects.EvaluatorsAsyncClient.getCredentialsWithResponse":"Azure.AI.Projects.Evaluators.getCredentials","com.azure.ai.projects.EvaluatorsAsyncClient.getEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.get","com.azure.ai.projects.EvaluatorsAsyncClient.getEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.get","com.azure.ai.projects.EvaluatorsAsyncClient.getEvaluatorVersion":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsAsyncClient.getEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsAsyncClient.listEvaluatorGenerationJobs":"Azure.AI.Projects.EvaluatorGenerationJobs.list","com.azure.ai.projects.EvaluatorsAsyncClient.listEvaluatorVersions":"Azure.AI.Projects.Evaluators.listVersions","com.azure.ai.projects.EvaluatorsAsyncClient.listLatestEvaluatorVersions":"Azure.AI.Projects.Evaluators.listLatestVersions","com.azure.ai.projects.EvaluatorsAsyncClient.startPendingUpload":"Azure.AI.Projects.Evaluators.startPendingUpload","com.azure.ai.projects.EvaluatorsAsyncClient.startPendingUploadWithResponse":"Azure.AI.Projects.Evaluators.startPendingUpload","com.azure.ai.projects.EvaluatorsAsyncClient.updateEvaluatorVersion":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.EvaluatorsAsyncClient.updateEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.EvaluatorsClient":"Azure.AI.Projects.Evaluators","com.azure.ai.projects.EvaluatorsClient.cancelEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.cancel","com.azure.ai.projects.EvaluatorsClient.cancelEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.cancel","com.azure.ai.projects.EvaluatorsClient.createEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.create","com.azure.ai.projects.EvaluatorsClient.createEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.create","com.azure.ai.projects.EvaluatorsClient.createEvaluatorVersion":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsClient.createEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.createVersion","com.azure.ai.projects.EvaluatorsClient.deleteEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.delete","com.azure.ai.projects.EvaluatorsClient.deleteEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.delete","com.azure.ai.projects.EvaluatorsClient.deleteEvaluatorVersion":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsClient.deleteEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.deleteVersion","com.azure.ai.projects.EvaluatorsClient.getCredentials":"Azure.AI.Projects.Evaluators.getCredentials","com.azure.ai.projects.EvaluatorsClient.getCredentialsWithResponse":"Azure.AI.Projects.Evaluators.getCredentials","com.azure.ai.projects.EvaluatorsClient.getEvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJobs.get","com.azure.ai.projects.EvaluatorsClient.getEvaluatorGenerationJobWithResponse":"Azure.AI.Projects.EvaluatorGenerationJobs.get","com.azure.ai.projects.EvaluatorsClient.getEvaluatorVersion":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsClient.getEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.getVersion","com.azure.ai.projects.EvaluatorsClient.listEvaluatorGenerationJobs":"Azure.AI.Projects.EvaluatorGenerationJobs.list","com.azure.ai.projects.EvaluatorsClient.listEvaluatorVersions":"Azure.AI.Projects.Evaluators.listVersions","com.azure.ai.projects.EvaluatorsClient.listLatestEvaluatorVersions":"Azure.AI.Projects.Evaluators.listLatestVersions","com.azure.ai.projects.EvaluatorsClient.startPendingUpload":"Azure.AI.Projects.Evaluators.startPendingUpload","com.azure.ai.projects.EvaluatorsClient.startPendingUploadWithResponse":"Azure.AI.Projects.Evaluators.startPendingUpload","com.azure.ai.projects.EvaluatorsClient.updateEvaluatorVersion":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.EvaluatorsClient.updateEvaluatorVersionWithResponse":"Azure.AI.Projects.Evaluators.updateVersion","com.azure.ai.projects.IndexesAsyncClient":"Azure.AI.Projects.Indexes","com.azure.ai.projects.IndexesAsyncClient.createOrUpdateIndexVersion":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesAsyncClient.createOrUpdateIndexVersionWithResponse":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesAsyncClient.deleteIndexVersion":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesAsyncClient.deleteIndexVersionWithResponse":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesAsyncClient.getIndexVersion":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesAsyncClient.getIndexVersionWithResponse":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesAsyncClient.listIndexVersions":"Azure.AI.Projects.Indexes.listVersions","com.azure.ai.projects.IndexesAsyncClient.listLatestIndexVersions":"Azure.AI.Projects.Indexes.listLatest","com.azure.ai.projects.IndexesClient":"Azure.AI.Projects.Indexes","com.azure.ai.projects.IndexesClient.createOrUpdateIndexVersion":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesClient.createOrUpdateIndexVersionWithResponse":"Azure.AI.Projects.Indexes.createOrUpdateVersion","com.azure.ai.projects.IndexesClient.deleteIndexVersion":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesClient.deleteIndexVersionWithResponse":"Azure.AI.Projects.Indexes.deleteVersion","com.azure.ai.projects.IndexesClient.getIndexVersion":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesClient.getIndexVersionWithResponse":"Azure.AI.Projects.Indexes.getVersion","com.azure.ai.projects.IndexesClient.listIndexVersions":"Azure.AI.Projects.Indexes.listVersions","com.azure.ai.projects.IndexesClient.listLatestIndexVersions":"Azure.AI.Projects.Indexes.listLatest","com.azure.ai.projects.InsightsAsyncClient":"Azure.AI.Projects.Insights","com.azure.ai.projects.InsightsAsyncClient.generateInsight":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsAsyncClient.generateInsightWithResponse":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsAsyncClient.getInsight":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsAsyncClient.getInsightWithResponse":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsAsyncClient.listInsights":"Azure.AI.Projects.Insights.list","com.azure.ai.projects.InsightsClient":"Azure.AI.Projects.Insights","com.azure.ai.projects.InsightsClient.generateInsight":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsClient.generateInsightWithResponse":"Azure.AI.Projects.Insights.generate","com.azure.ai.projects.InsightsClient.getInsight":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsClient.getInsightWithResponse":"Azure.AI.Projects.Insights.get","com.azure.ai.projects.InsightsClient.listInsights":"Azure.AI.Projects.Insights.list","com.azure.ai.projects.ModelsAsyncClient":"Azure.AI.Projects.Models","com.azure.ai.projects.ModelsAsyncClient.createModelVersionAsyncWithResponse":"Azure.AI.Projects.Models.createAsync","com.azure.ai.projects.ModelsAsyncClient.deleteModelVersion":"Azure.AI.Projects.Models.deleteVersion","com.azure.ai.projects.ModelsAsyncClient.deleteModelVersionWithResponse":"Azure.AI.Projects.Models.deleteVersion","com.azure.ai.projects.ModelsAsyncClient.getModelCredentials":"Azure.AI.Projects.Models.getCredentials","com.azure.ai.projects.ModelsAsyncClient.getModelCredentialsWithResponse":"Azure.AI.Projects.Models.getCredentials","com.azure.ai.projects.ModelsAsyncClient.getModelVersion":"Azure.AI.Projects.Models.getVersion","com.azure.ai.projects.ModelsAsyncClient.getModelVersionWithResponse":"Azure.AI.Projects.Models.getVersion","com.azure.ai.projects.ModelsAsyncClient.listLatestModelVersions":"Azure.AI.Projects.Models.listLatest","com.azure.ai.projects.ModelsAsyncClient.listModelVersions":"Azure.AI.Projects.Models.listVersions","com.azure.ai.projects.ModelsAsyncClient.startModelPendingUpload":"Azure.AI.Projects.Models.startPendingUpload","com.azure.ai.projects.ModelsAsyncClient.startModelPendingUploadWithResponse":"Azure.AI.Projects.Models.startPendingUpload","com.azure.ai.projects.ModelsAsyncClient.updateModelVersion":"Azure.AI.Projects.Models.createOrUpdateVersion","com.azure.ai.projects.ModelsAsyncClient.updateModelVersionWithResponse":"Azure.AI.Projects.Models.createOrUpdateVersion","com.azure.ai.projects.ModelsClient":"Azure.AI.Projects.Models","com.azure.ai.projects.ModelsClient.createModelVersionAsyncWithResponse":"Azure.AI.Projects.Models.createAsync","com.azure.ai.projects.ModelsClient.deleteModelVersion":"Azure.AI.Projects.Models.deleteVersion","com.azure.ai.projects.ModelsClient.deleteModelVersionWithResponse":"Azure.AI.Projects.Models.deleteVersion","com.azure.ai.projects.ModelsClient.getModelCredentials":"Azure.AI.Projects.Models.getCredentials","com.azure.ai.projects.ModelsClient.getModelCredentialsWithResponse":"Azure.AI.Projects.Models.getCredentials","com.azure.ai.projects.ModelsClient.getModelVersion":"Azure.AI.Projects.Models.getVersion","com.azure.ai.projects.ModelsClient.getModelVersionWithResponse":"Azure.AI.Projects.Models.getVersion","com.azure.ai.projects.ModelsClient.listLatestModelVersions":"Azure.AI.Projects.Models.listLatest","com.azure.ai.projects.ModelsClient.listModelVersions":"Azure.AI.Projects.Models.listVersions","com.azure.ai.projects.ModelsClient.startModelPendingUpload":"Azure.AI.Projects.Models.startPendingUpload","com.azure.ai.projects.ModelsClient.startModelPendingUploadWithResponse":"Azure.AI.Projects.Models.startPendingUpload","com.azure.ai.projects.ModelsClient.updateModelVersion":"Azure.AI.Projects.Models.createOrUpdateVersion","com.azure.ai.projects.ModelsClient.updateModelVersionWithResponse":"Azure.AI.Projects.Models.createOrUpdateVersion","com.azure.ai.projects.RedTeamsAsyncClient":"Azure.AI.Projects.RedTeams","com.azure.ai.projects.RedTeamsAsyncClient.createRedTeamRun":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsAsyncClient.createRedTeamRunWithResponse":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsAsyncClient.getRedTeam":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsAsyncClient.getRedTeamWithResponse":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsAsyncClient.listRedTeams":"Azure.AI.Projects.RedTeams.list","com.azure.ai.projects.RedTeamsClient":"Azure.AI.Projects.RedTeams","com.azure.ai.projects.RedTeamsClient.createRedTeamRun":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsClient.createRedTeamRunWithResponse":"Azure.AI.Projects.RedTeams.create","com.azure.ai.projects.RedTeamsClient.getRedTeam":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsClient.getRedTeamWithResponse":"Azure.AI.Projects.RedTeams.get","com.azure.ai.projects.RedTeamsClient.listRedTeams":"Azure.AI.Projects.RedTeams.list","com.azure.ai.projects.RoutinesAsyncClient":"Azure.AI.Projects.Routines","com.azure.ai.projects.RoutinesAsyncClient.createOrUpdateRoutine":"Azure.AI.Projects.Routines.createOrUpdateRoutine","com.azure.ai.projects.RoutinesAsyncClient.createOrUpdateRoutineWithResponse":"Azure.AI.Projects.Routines.createOrUpdateRoutine","com.azure.ai.projects.RoutinesAsyncClient.deleteRoutine":"Azure.AI.Projects.Routines.deleteRoutine","com.azure.ai.projects.RoutinesAsyncClient.deleteRoutineWithResponse":"Azure.AI.Projects.Routines.deleteRoutine","com.azure.ai.projects.RoutinesAsyncClient.disableRoutine":"Azure.AI.Projects.Routines.disableRoutine","com.azure.ai.projects.RoutinesAsyncClient.disableRoutineWithResponse":"Azure.AI.Projects.Routines.disableRoutine","com.azure.ai.projects.RoutinesAsyncClient.dispatchRoutine":"Azure.AI.Projects.Routines.dispatchRoutineAsync","com.azure.ai.projects.RoutinesAsyncClient.dispatchRoutineWithResponse":"Azure.AI.Projects.Routines.dispatchRoutineAsync","com.azure.ai.projects.RoutinesAsyncClient.enableRoutine":"Azure.AI.Projects.Routines.enableRoutine","com.azure.ai.projects.RoutinesAsyncClient.enableRoutineWithResponse":"Azure.AI.Projects.Routines.enableRoutine","com.azure.ai.projects.RoutinesAsyncClient.getRoutine":"Azure.AI.Projects.Routines.getRoutine","com.azure.ai.projects.RoutinesAsyncClient.getRoutineWithResponse":"Azure.AI.Projects.Routines.getRoutine","com.azure.ai.projects.RoutinesAsyncClient.listRoutineRuns":"Azure.AI.Projects.Routines.listRoutineRuns","com.azure.ai.projects.RoutinesAsyncClient.listRoutines":"Azure.AI.Projects.Routines.listRoutines","com.azure.ai.projects.RoutinesClient":"Azure.AI.Projects.Routines","com.azure.ai.projects.RoutinesClient.createOrUpdateRoutine":"Azure.AI.Projects.Routines.createOrUpdateRoutine","com.azure.ai.projects.RoutinesClient.createOrUpdateRoutineWithResponse":"Azure.AI.Projects.Routines.createOrUpdateRoutine","com.azure.ai.projects.RoutinesClient.deleteRoutine":"Azure.AI.Projects.Routines.deleteRoutine","com.azure.ai.projects.RoutinesClient.deleteRoutineWithResponse":"Azure.AI.Projects.Routines.deleteRoutine","com.azure.ai.projects.RoutinesClient.disableRoutine":"Azure.AI.Projects.Routines.disableRoutine","com.azure.ai.projects.RoutinesClient.disableRoutineWithResponse":"Azure.AI.Projects.Routines.disableRoutine","com.azure.ai.projects.RoutinesClient.dispatchRoutine":"Azure.AI.Projects.Routines.dispatchRoutineAsync","com.azure.ai.projects.RoutinesClient.dispatchRoutineWithResponse":"Azure.AI.Projects.Routines.dispatchRoutineAsync","com.azure.ai.projects.RoutinesClient.enableRoutine":"Azure.AI.Projects.Routines.enableRoutine","com.azure.ai.projects.RoutinesClient.enableRoutineWithResponse":"Azure.AI.Projects.Routines.enableRoutine","com.azure.ai.projects.RoutinesClient.getRoutine":"Azure.AI.Projects.Routines.getRoutine","com.azure.ai.projects.RoutinesClient.getRoutineWithResponse":"Azure.AI.Projects.Routines.getRoutine","com.azure.ai.projects.RoutinesClient.listRoutineRuns":"Azure.AI.Projects.Routines.listRoutineRuns","com.azure.ai.projects.RoutinesClient.listRoutines":"Azure.AI.Projects.Routines.listRoutines","com.azure.ai.projects.SchedulesAsyncClient":"Azure.AI.Projects.Schedules","com.azure.ai.projects.SchedulesAsyncClient.createOrUpdateSchedule":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesAsyncClient.createOrUpdateScheduleWithResponse":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesAsyncClient.deleteSchedule":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesAsyncClient.deleteScheduleWithResponse":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesAsyncClient.getSchedule":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesAsyncClient.getScheduleRun":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesAsyncClient.getScheduleRunWithResponse":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesAsyncClient.getScheduleWithResponse":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesAsyncClient.listScheduleRuns":"Azure.AI.Projects.Schedules.listRuns","com.azure.ai.projects.SchedulesAsyncClient.listSchedules":"Azure.AI.Projects.Schedules.list","com.azure.ai.projects.SchedulesClient":"Azure.AI.Projects.Schedules","com.azure.ai.projects.SchedulesClient.createOrUpdateSchedule":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesClient.createOrUpdateScheduleWithResponse":"Azure.AI.Projects.Schedules.createOrUpdate","com.azure.ai.projects.SchedulesClient.deleteSchedule":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesClient.deleteScheduleWithResponse":"Azure.AI.Projects.Schedules.delete","com.azure.ai.projects.SchedulesClient.getSchedule":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesClient.getScheduleRun":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesClient.getScheduleRunWithResponse":"Azure.AI.Projects.Schedules.getRun","com.azure.ai.projects.SchedulesClient.getScheduleWithResponse":"Azure.AI.Projects.Schedules.get","com.azure.ai.projects.SchedulesClient.listScheduleRuns":"Azure.AI.Projects.Schedules.listRuns","com.azure.ai.projects.SchedulesClient.listSchedules":"Azure.AI.Projects.Schedules.list","com.azure.ai.projects.SkillsAsyncClient":"Azure.AI.Projects.Skills","com.azure.ai.projects.SkillsAsyncClient.createSkillVersion":"Azure.AI.Projects.Skills.createSkillVersion","com.azure.ai.projects.SkillsAsyncClient.createSkillVersionFromFiles":"Azure.AI.Projects.Skills.createSkillVersionFromFiles","com.azure.ai.projects.SkillsAsyncClient.createSkillVersionFromFilesWithResponse":"Azure.AI.Projects.Skills.createSkillVersionFromFiles","com.azure.ai.projects.SkillsAsyncClient.createSkillVersionWithResponse":"Azure.AI.Projects.Skills.createSkillVersion","com.azure.ai.projects.SkillsAsyncClient.getSkill":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsAsyncClient.getSkillContent":"Azure.AI.Projects.Skills.getSkillContent","com.azure.ai.projects.SkillsAsyncClient.getSkillContentWithResponse":"Azure.AI.Projects.Skills.getSkillContent","com.azure.ai.projects.SkillsAsyncClient.getSkillVersion":"Azure.AI.Projects.Skills.getSkillVersion","com.azure.ai.projects.SkillsAsyncClient.getSkillVersionContent":"Azure.AI.Projects.Skills.getSkillVersionContent","com.azure.ai.projects.SkillsAsyncClient.getSkillVersionContentWithResponse":"Azure.AI.Projects.Skills.getSkillVersionContent","com.azure.ai.projects.SkillsAsyncClient.getSkillVersionWithResponse":"Azure.AI.Projects.Skills.getSkillVersion","com.azure.ai.projects.SkillsAsyncClient.getSkillWithResponse":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsAsyncClient.listSkillVersions":"Azure.AI.Projects.Skills.listSkillVersions","com.azure.ai.projects.SkillsAsyncClient.listSkills":"Azure.AI.Projects.Skills.listSkills","com.azure.ai.projects.SkillsAsyncClient.updateSkill":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.SkillsAsyncClient.updateSkillWithResponse":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.SkillsClient":"Azure.AI.Projects.Skills","com.azure.ai.projects.SkillsClient.createSkillVersion":"Azure.AI.Projects.Skills.createSkillVersion","com.azure.ai.projects.SkillsClient.createSkillVersionFromFiles":"Azure.AI.Projects.Skills.createSkillVersionFromFiles","com.azure.ai.projects.SkillsClient.createSkillVersionFromFilesWithResponse":"Azure.AI.Projects.Skills.createSkillVersionFromFiles","com.azure.ai.projects.SkillsClient.createSkillVersionWithResponse":"Azure.AI.Projects.Skills.createSkillVersion","com.azure.ai.projects.SkillsClient.getSkill":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsClient.getSkillContent":"Azure.AI.Projects.Skills.getSkillContent","com.azure.ai.projects.SkillsClient.getSkillContentWithResponse":"Azure.AI.Projects.Skills.getSkillContent","com.azure.ai.projects.SkillsClient.getSkillVersion":"Azure.AI.Projects.Skills.getSkillVersion","com.azure.ai.projects.SkillsClient.getSkillVersionContent":"Azure.AI.Projects.Skills.getSkillVersionContent","com.azure.ai.projects.SkillsClient.getSkillVersionContentWithResponse":"Azure.AI.Projects.Skills.getSkillVersionContent","com.azure.ai.projects.SkillsClient.getSkillVersionWithResponse":"Azure.AI.Projects.Skills.getSkillVersion","com.azure.ai.projects.SkillsClient.getSkillWithResponse":"Azure.AI.Projects.Skills.getSkill","com.azure.ai.projects.SkillsClient.listSkillVersions":"Azure.AI.Projects.Skills.listSkillVersions","com.azure.ai.projects.SkillsClient.listSkills":"Azure.AI.Projects.Skills.listSkills","com.azure.ai.projects.SkillsClient.updateSkill":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.SkillsClient.updateSkillWithResponse":"Azure.AI.Projects.Skills.updateSkill","com.azure.ai.projects.implementation.models.CreateOrUpdateRoutineRequest":"Azure.AI.Projects.createOrUpdateRoutine.Request.anonymous","com.azure.ai.projects.implementation.models.CreateSkillVersionRequest":"Azure.AI.Projects.createSkillVersion.Request.anonymous","com.azure.ai.projects.implementation.models.DispatchRoutineAsyncRequest":"Azure.AI.Projects.dispatchRoutineAsync.Request.anonymous","com.azure.ai.projects.implementation.models.UpdateSkillRequest":"Azure.AI.Projects.updateSkill.Request.anonymous","com.azure.ai.projects.models.AIProjectIndex":"Azure.AI.Projects.Index","com.azure.ai.projects.models.AgentClusterInsightRequest":"Azure.AI.Projects.AgentClusterInsightRequest","com.azure.ai.projects.models.AgentClusterInsightResult":"Azure.AI.Projects.AgentClusterInsightResult","com.azure.ai.projects.models.AgentDataGenerationJobSource":"Azure.AI.Projects.AgentDataGenerationJobSource","com.azure.ai.projects.models.AgentEvaluatorGenerationJobSource":"Azure.AI.Projects.AgentEvaluatorGenerationJobSource","com.azure.ai.projects.models.AgentTaxonomyInput":"Azure.AI.Projects.AgentTaxonomyInput","com.azure.ai.projects.models.AgenticIdentityPreviewCredential":"Azure.AI.Projects.AgenticIdentityPreviewCredentials","com.azure.ai.projects.models.ApiError":"OpenAI.Error","com.azure.ai.projects.models.ApiKeyCredential":"Azure.AI.Projects.ApiKeyCredentials","com.azure.ai.projects.models.ArtifactProfile":"Azure.AI.Projects.ArtifactProfile","com.azure.ai.projects.models.AttackStrategy":"Azure.AI.Projects.AttackStrategy","com.azure.ai.projects.models.AzureAIAgentTarget":"Azure.AI.Projects.AzureAIAgentTarget","com.azure.ai.projects.models.AzureAIModelTarget":"Azure.AI.Projects.AzureAIModelTarget","com.azure.ai.projects.models.AzureAISearchIndex":"Azure.AI.Projects.AzureAISearchIndex","com.azure.ai.projects.models.AzureOpenAIModelConfiguration":"Azure.AI.Projects.AzureOpenAIModelConfiguration","com.azure.ai.projects.models.BaseCredential":"Azure.AI.Projects.BaseCredentials","com.azure.ai.projects.models.BlobReference":"Azure.AI.Projects.BlobReference","com.azure.ai.projects.models.BlobReferenceSasCredential":"Azure.AI.Projects.SasCredential","com.azure.ai.projects.models.ChartCoordinate":"Azure.AI.Projects.ChartCoordinate","com.azure.ai.projects.models.ClusterInsightResult":"Azure.AI.Projects.ClusterInsightResult","com.azure.ai.projects.models.ClusterTokenUsage":"Azure.AI.Projects.ClusterTokenUsage","com.azure.ai.projects.models.CodeBasedEvaluatorDefinition":"Azure.AI.Projects.CodeBasedEvaluatorDefinition","com.azure.ai.projects.models.Connection":"Azure.AI.Projects.Connection","com.azure.ai.projects.models.ConnectionType":"Azure.AI.Projects.ConnectionType","com.azure.ai.projects.models.ContinuousEvaluationRuleAction":"Azure.AI.Projects.ContinuousEvaluationRuleAction","com.azure.ai.projects.models.CosmosDBIndex":"Azure.AI.Projects.CosmosDBIndex","com.azure.ai.projects.models.CreateAsyncResponse":"Azure.AI.Projects.createAsync.Response.anonymous","com.azure.ai.projects.models.CreateSkillVersionFromFilesBody":"Azure.AI.Projects.CreateSkillVersionFromFilesBody","com.azure.ai.projects.models.CredentialType":"Azure.AI.Projects.CredentialType","com.azure.ai.projects.models.CronTrigger":"Azure.AI.Projects.CronTrigger","com.azure.ai.projects.models.CustomCredential":"Azure.AI.Projects.CustomCredential","com.azure.ai.projects.models.CustomRoutineTrigger":"Azure.AI.Projects.CustomRoutineTrigger","com.azure.ai.projects.models.DailyRecurrenceSchedule":"Azure.AI.Projects.DailyRecurrenceSchedule","com.azure.ai.projects.models.DataGenerationJob":"Azure.AI.Projects.DataGenerationJob","com.azure.ai.projects.models.DataGenerationJobInputs":"Azure.AI.Projects.DataGenerationJobInputs","com.azure.ai.projects.models.DataGenerationJobOptions":"Azure.AI.Projects.DataGenerationJobOptions","com.azure.ai.projects.models.DataGenerationJobOutput":"Azure.AI.Projects.DataGenerationJobOutput","com.azure.ai.projects.models.DataGenerationJobOutputOptions":"Azure.AI.Projects.DataGenerationJobOutputOptions","com.azure.ai.projects.models.DataGenerationJobOutputType":"Azure.AI.Projects.DataGenerationJobOutputType","com.azure.ai.projects.models.DataGenerationJobResult":"Azure.AI.Projects.DataGenerationJobResult","com.azure.ai.projects.models.DataGenerationJobScenario":"Azure.AI.Projects.DataGenerationJobScenario","com.azure.ai.projects.models.DataGenerationJobSource":"Azure.AI.Projects.DataGenerationJobSource","com.azure.ai.projects.models.DataGenerationJobSourceType":"Azure.AI.Projects.DataGenerationJobSourceType","com.azure.ai.projects.models.DataGenerationJobType":"Azure.AI.Projects.DataGenerationJobType","com.azure.ai.projects.models.DataGenerationModelOptions":"Azure.AI.Projects.DataGenerationModelOptions","com.azure.ai.projects.models.DataGenerationTokenUsage":"Azure.AI.Projects.DataGenerationTokenUsage","com.azure.ai.projects.models.DatasetCredential":"Azure.AI.Projects.AssetCredentialResponse","com.azure.ai.projects.models.DatasetDataGenerationJobOutput":"Azure.AI.Projects.DatasetDataGenerationJobOutput","com.azure.ai.projects.models.DatasetEvaluatorGenerationJobSource":"Azure.AI.Projects.DatasetEvaluatorGenerationJobSource","com.azure.ai.projects.models.DatasetReference":"Azure.AI.Projects.DatasetReference","com.azure.ai.projects.models.DatasetType":"Azure.AI.Projects.DatasetType","com.azure.ai.projects.models.DatasetVersion":"Azure.AI.Projects.DatasetVersion","com.azure.ai.projects.models.Deployment":"Azure.AI.Projects.Deployment","com.azure.ai.projects.models.DeploymentType":"Azure.AI.Projects.DeploymentType","com.azure.ai.projects.models.Dimension":"Azure.AI.Projects.Dimension","com.azure.ai.projects.models.DispatchRoutineResult":"Azure.AI.Projects.DispatchRoutineResponse","com.azure.ai.projects.models.EmbeddingConfiguration":"Azure.AI.Projects.EmbeddingConfiguration","com.azure.ai.projects.models.EntraIdCredential":"Azure.AI.Projects.EntraIDCredentials","com.azure.ai.projects.models.EvaluationComparisonInsightRequest":"Azure.AI.Projects.EvaluationComparisonInsightRequest","com.azure.ai.projects.models.EvaluationComparisonInsightResult":"Azure.AI.Projects.EvaluationComparisonInsightResult","com.azure.ai.projects.models.EvaluationResult":"Azure.AI.Projects.EvalResult","com.azure.ai.projects.models.EvaluationResultSample":"Azure.AI.Projects.EvaluationResultSample","com.azure.ai.projects.models.EvaluationRule":"Azure.AI.Projects.EvaluationRule","com.azure.ai.projects.models.EvaluationRuleAction":"Azure.AI.Projects.EvaluationRuleAction","com.azure.ai.projects.models.EvaluationRuleActionType":"Azure.AI.Projects.EvaluationRuleActionType","com.azure.ai.projects.models.EvaluationRuleEventType":"Azure.AI.Projects.EvaluationRuleEventType","com.azure.ai.projects.models.EvaluationRuleFilter":"Azure.AI.Projects.EvaluationRuleFilter","com.azure.ai.projects.models.EvaluationRunClusterInsightRequest":"Azure.AI.Projects.EvaluationRunClusterInsightRequest","com.azure.ai.projects.models.EvaluationRunClusterInsightResult":"Azure.AI.Projects.EvaluationRunClusterInsightResult","com.azure.ai.projects.models.EvaluationRunResultCompareItem":"Azure.AI.Projects.EvalRunResultCompareItem","com.azure.ai.projects.models.EvaluationRunResultComparison":"Azure.AI.Projects.EvalRunResultComparison","com.azure.ai.projects.models.EvaluationRunResultSummary":"Azure.AI.Projects.EvalRunResultSummary","com.azure.ai.projects.models.EvaluationScheduleTask":"Azure.AI.Projects.EvaluationScheduleTask","com.azure.ai.projects.models.EvaluationTaxonomy":"Azure.AI.Projects.EvaluationTaxonomy","com.azure.ai.projects.models.EvaluationTaxonomyInput":"Azure.AI.Projects.EvaluationTaxonomyInput","com.azure.ai.projects.models.EvaluationTaxonomyInputType":"Azure.AI.Projects.EvaluationTaxonomyInputType","com.azure.ai.projects.models.EvaluatorCategory":"Azure.AI.Projects.EvaluatorCategory","com.azure.ai.projects.models.EvaluatorCredentialInput":"Azure.AI.Projects.EvaluatorCredentialRequest","com.azure.ai.projects.models.EvaluatorDefinition":"Azure.AI.Projects.EvaluatorDefinition","com.azure.ai.projects.models.EvaluatorDefinitionType":"Azure.AI.Projects.EvaluatorDefinitionType","com.azure.ai.projects.models.EvaluatorGenerationArtifacts":"Azure.AI.Projects.EvaluatorGenerationArtifacts","com.azure.ai.projects.models.EvaluatorGenerationInputs":"Azure.AI.Projects.EvaluatorGenerationInputs","com.azure.ai.projects.models.EvaluatorGenerationJob":"Azure.AI.Projects.EvaluatorGenerationJob","com.azure.ai.projects.models.EvaluatorGenerationJobSource":"Azure.AI.Projects.EvaluatorGenerationJobSource","com.azure.ai.projects.models.EvaluatorGenerationJobSourceType":"Azure.AI.Projects.EvaluatorGenerationJobSourceType","com.azure.ai.projects.models.EvaluatorGenerationTokenUsage":"Azure.AI.Projects.EvaluatorGenerationTokenUsage","com.azure.ai.projects.models.EvaluatorMetric":"Azure.AI.Projects.EvaluatorMetric","com.azure.ai.projects.models.EvaluatorMetricDirection":"Azure.AI.Projects.EvaluatorMetricDirection","com.azure.ai.projects.models.EvaluatorMetricType":"Azure.AI.Projects.EvaluatorMetricType","com.azure.ai.projects.models.EvaluatorType":"Azure.AI.Projects.EvaluatorType","com.azure.ai.projects.models.EvaluatorVersion":"Azure.AI.Projects.EvaluatorVersion","com.azure.ai.projects.models.FieldMapping":"Azure.AI.Projects.FieldMapping","com.azure.ai.projects.models.FileDataGenerationJobOutput":"Azure.AI.Projects.FileDataGenerationJobOutput","com.azure.ai.projects.models.FileDataGenerationJobSource":"Azure.AI.Projects.FileDataGenerationJobSource","com.azure.ai.projects.models.FileDatasetVersion":"Azure.AI.Projects.FileDatasetVersion","com.azure.ai.projects.models.FolderDatasetVersion":"Azure.AI.Projects.FolderDatasetVersion","com.azure.ai.projects.models.FoundryFeaturesOptInKeys":"Azure.AI.Projects.FoundryFeaturesOptInKeys","com.azure.ai.projects.models.FoundryModelArtifactProfileCategory":"Azure.AI.Projects.FoundryModelArtifactProfileCategory","com.azure.ai.projects.models.FoundryModelArtifactProfileSignal":"Azure.AI.Projects.FoundryModelArtifactProfileSignal","com.azure.ai.projects.models.FoundryModelSourceType":"Azure.AI.Projects.FoundryModelSourceType","com.azure.ai.projects.models.FoundryModelWarning":"Azure.AI.Projects.FoundryModelWarning","com.azure.ai.projects.models.FoundryModelWarningCode":"Azure.AI.Projects.FoundryModelWarningCode","com.azure.ai.projects.models.FoundryModelWeightType":"Azure.AI.Projects.FoundryModelWeightType","com.azure.ai.projects.models.GitHubIssueEvent":"Azure.AI.Projects.GitHubIssueEvent","com.azure.ai.projects.models.GitHubIssueRoutineTrigger":"Azure.AI.Projects.GitHubIssueRoutineTrigger","com.azure.ai.projects.models.GraderAzureAIEvaluator":"Azure.AI.Projects.GraderAzureAIEvaluator","com.azure.ai.projects.models.HourlyRecurrenceSchedule":"Azure.AI.Projects.HourlyRecurrenceSchedule","com.azure.ai.projects.models.HumanEvaluationPreviewRuleAction":"Azure.AI.Projects.HumanEvaluationPreviewRuleAction","com.azure.ai.projects.models.IndexType":"Azure.AI.Projects.IndexType","com.azure.ai.projects.models.Insight":"Azure.AI.Projects.Insight","com.azure.ai.projects.models.InsightCluster":"Azure.AI.Projects.InsightCluster","com.azure.ai.projects.models.InsightModelConfiguration":"Azure.AI.Projects.InsightModelConfiguration","com.azure.ai.projects.models.InsightRequest":"Azure.AI.Projects.InsightRequest","com.azure.ai.projects.models.InsightResult":"Azure.AI.Projects.InsightResult","com.azure.ai.projects.models.InsightSample":"Azure.AI.Projects.InsightSample","com.azure.ai.projects.models.InsightScheduleTask":"Azure.AI.Projects.InsightScheduleTask","com.azure.ai.projects.models.InsightSummary":"Azure.AI.Projects.InsightSummary","com.azure.ai.projects.models.InsightType":"Azure.AI.Projects.InsightType","com.azure.ai.projects.models.InsightsMetadata":"Azure.AI.Projects.InsightsMetadata","com.azure.ai.projects.models.InvokeAgentInvocationsApiDispatchPayload":"Azure.AI.Projects.InvokeAgentInvocationsApiDispatchPayload","com.azure.ai.projects.models.InvokeAgentInvocationsApiRoutineAction":"Azure.AI.Projects.InvokeAgentInvocationsApiRoutineAction","com.azure.ai.projects.models.InvokeAgentResponsesApiDispatchPayload":"Azure.AI.Projects.InvokeAgentResponsesApiDispatchPayload","com.azure.ai.projects.models.InvokeAgentResponsesApiRoutineAction":"Azure.AI.Projects.InvokeAgentResponsesApiRoutineAction","com.azure.ai.projects.models.JobStatus":"Azure.AI.Projects.JobStatus","com.azure.ai.projects.models.ListVersionsRequestType":"Azure.AI.Projects.listVersions.RequestType.anonymous","com.azure.ai.projects.models.LoraConfig":"Azure.AI.Projects.LoraConfig","com.azure.ai.projects.models.ManagedAzureAISearchIndex":"Azure.AI.Projects.ManagedAzureAISearchIndex","com.azure.ai.projects.models.ModelCredentialInput":"Azure.AI.Projects.ModelCredentialRequest","com.azure.ai.projects.models.ModelDeployment":"Azure.AI.Projects.ModelDeployment","com.azure.ai.projects.models.ModelDeploymentSku":"Azure.AI.Projects.Sku","com.azure.ai.projects.models.ModelPendingUploadInput":"Azure.AI.Projects.ModelPendingUploadRequest","com.azure.ai.projects.models.ModelPendingUploadResult":"Azure.AI.Projects.ModelPendingUploadResponse","com.azure.ai.projects.models.ModelSamplingParams":"Azure.AI.Projects.ModelSamplingParams","com.azure.ai.projects.models.ModelSourceData":"Azure.AI.Projects.ModelSourceData","com.azure.ai.projects.models.ModelVersion":"Azure.AI.Projects.ModelVersion","com.azure.ai.projects.models.MonthlyRecurrenceSchedule":"Azure.AI.Projects.MonthlyRecurrenceSchedule","com.azure.ai.projects.models.NoAuthenticationCredential":"Azure.AI.Projects.NoAuthenticationCredentials","com.azure.ai.projects.models.OneTimeTrigger":"Azure.AI.Projects.OneTimeTrigger","com.azure.ai.projects.models.OperationStatus":"Azure.Core.Foundations.OperationState","com.azure.ai.projects.models.PendingUploadRequest":"Azure.AI.Projects.PendingUploadRequest","com.azure.ai.projects.models.PendingUploadResponse":"Azure.AI.Projects.PendingUploadResponse","com.azure.ai.projects.models.PendingUploadType":"Azure.AI.Projects.PendingUploadType","com.azure.ai.projects.models.PromptBasedEvaluatorDefinition":"Azure.AI.Projects.PromptBasedEvaluatorDefinition","com.azure.ai.projects.models.PromptDataGenerationJobSource":"Azure.AI.Projects.PromptDataGenerationJobSource","com.azure.ai.projects.models.PromptEvaluatorGenerationJobSource":"Azure.AI.Projects.PromptEvaluatorGenerationJobSource","com.azure.ai.projects.models.RecurrenceSchedule":"Azure.AI.Projects.RecurrenceSchedule","com.azure.ai.projects.models.RecurrenceTrigger":"Azure.AI.Projects.RecurrenceTrigger","com.azure.ai.projects.models.RecurrenceType":"Azure.AI.Projects.RecurrenceType","com.azure.ai.projects.models.RedTeam":"Azure.AI.Projects.RedTeam","com.azure.ai.projects.models.RiskCategory":"Azure.AI.Projects.RiskCategory","com.azure.ai.projects.models.Routine":"Azure.AI.Projects.Routine","com.azure.ai.projects.models.RoutineAction":"Azure.AI.Projects.RoutineAction","com.azure.ai.projects.models.RoutineActionType":"Azure.AI.Projects.RoutineActionType","com.azure.ai.projects.models.RoutineAttemptSource":"Azure.AI.Projects.RoutineAttemptSource","com.azure.ai.projects.models.RoutineDispatchPayload":"Azure.AI.Projects.RoutineDispatchPayload","com.azure.ai.projects.models.RoutineDispatchPayloadType":"Azure.AI.Projects.RoutineDispatchPayloadType","com.azure.ai.projects.models.RoutineRun":"Azure.AI.Projects.RoutineRun","com.azure.ai.projects.models.RoutineRunPhase":"Azure.AI.Projects.RoutineRunPhase","com.azure.ai.projects.models.RoutineTrigger":"Azure.AI.Projects.RoutineTrigger","com.azure.ai.projects.models.RoutineTriggerType":"Azure.AI.Projects.RoutineTriggerType","com.azure.ai.projects.models.RubricBasedEvaluatorDefinition":"Azure.AI.Projects.RubricBasedEvaluatorDefinition","com.azure.ai.projects.models.SampleType":"Azure.AI.Projects.SampleType","com.azure.ai.projects.models.SasCredential":"Azure.AI.Projects.SASCredentials","com.azure.ai.projects.models.Schedule":"Azure.AI.Projects.Schedule","com.azure.ai.projects.models.ScheduleProvisioningStatus":"Azure.AI.Projects.ScheduleProvisioningStatus","com.azure.ai.projects.models.ScheduleRoutineTrigger":"Azure.AI.Projects.ScheduleRoutineTrigger","com.azure.ai.projects.models.ScheduleRun":"Azure.AI.Projects.ScheduleRun","com.azure.ai.projects.models.ScheduleTask":"Azure.AI.Projects.ScheduleTask","com.azure.ai.projects.models.ScheduleTaskType":"Azure.AI.Projects.ScheduleTaskType","com.azure.ai.projects.models.SimpleQnADataGenerationJobOptions":"Azure.AI.Projects.SimpleQnADataGenerationJobOptions","com.azure.ai.projects.models.SimpleQnAFineTuningQuestionType":"Azure.AI.Projects.SimpleQnAFineTuningQuestionType","com.azure.ai.projects.models.Skill":"Azure.AI.Projects.Skill","com.azure.ai.projects.models.SkillFileDetails":"TypeSpec.Http.File","com.azure.ai.projects.models.SkillInlineContent":"Azure.AI.Projects.SkillInlineContent","com.azure.ai.projects.models.SkillVersion":"Azure.AI.Projects.SkillVersion","com.azure.ai.projects.models.SystemDataV3":"Azure.AI.Projects.SystemDataV3","com.azure.ai.projects.models.Target":"Azure.AI.Projects.Target","com.azure.ai.projects.models.TargetConfig":"Azure.AI.Projects.RedTeamTargetConfig","com.azure.ai.projects.models.TaxonomyCategory":"Azure.AI.Projects.TaxonomyCategory","com.azure.ai.projects.models.TaxonomySubCategory":"Azure.AI.Projects.TaxonomySubCategory","com.azure.ai.projects.models.TestingCriterionAzureAIEvaluator":"Azure.AI.Projects.TestingCriterionAzureAIEvaluator","com.azure.ai.projects.models.TimerRoutineTrigger":"Azure.AI.Projects.TimerRoutineTrigger","com.azure.ai.projects.models.ToolDescription":"Azure.AI.Projects.ToolDescription","com.azure.ai.projects.models.ToolUseFineTuningDataGenerationJobOptions":"Azure.AI.Projects.ToolUseFineTuningDataGenerationJobOptions","com.azure.ai.projects.models.TracesDataGenerationJobOptions":"Azure.AI.Projects.TracesDataGenerationJobOptions","com.azure.ai.projects.models.TracesDataGenerationJobSource":"Azure.AI.Projects.TracesDataGenerationJobSource","com.azure.ai.projects.models.TracesEvaluatorGenerationJobSource":"Azure.AI.Projects.TracesEvaluatorGenerationJobSource","com.azure.ai.projects.models.TreatmentEffectType":"Azure.AI.Projects.TreatmentEffectType","com.azure.ai.projects.models.Trigger":"Azure.AI.Projects.Trigger","com.azure.ai.projects.models.TriggerType":"Azure.AI.Projects.TriggerType","com.azure.ai.projects.models.UpdateModelVersionInput":"Azure.AI.Projects.UpdateModelVersionRequest","com.azure.ai.projects.models.WeeklyRecurrenceSchedule":"Azure.AI.Projects.WeeklyRecurrenceSchedule"},"generatedFiles":["src/main/java/com/azure/ai/projects/AIProjectClientBuilder.java","src/main/java/com/azure/ai/projects/AIProjectsServiceVersion.java","src/main/java/com/azure/ai/projects/ConnectionsAsyncClient.java","src/main/java/com/azure/ai/projects/ConnectionsClient.java","src/main/java/com/azure/ai/projects/DataGenerationJobsAsyncClient.java","src/main/java/com/azure/ai/projects/DataGenerationJobsClient.java","src/main/java/com/azure/ai/projects/DatasetsAsyncClient.java","src/main/java/com/azure/ai/projects/DatasetsClient.java","src/main/java/com/azure/ai/projects/DeploymentsAsyncClient.java","src/main/java/com/azure/ai/projects/DeploymentsClient.java","src/main/java/com/azure/ai/projects/EvaluationRulesAsyncClient.java","src/main/java/com/azure/ai/projects/EvaluationRulesClient.java","src/main/java/com/azure/ai/projects/EvaluationTaxonomiesAsyncClient.java","src/main/java/com/azure/ai/projects/EvaluationTaxonomiesClient.java","src/main/java/com/azure/ai/projects/EvaluatorsAsyncClient.java","src/main/java/com/azure/ai/projects/EvaluatorsClient.java","src/main/java/com/azure/ai/projects/IndexesAsyncClient.java","src/main/java/com/azure/ai/projects/IndexesClient.java","src/main/java/com/azure/ai/projects/InsightsAsyncClient.java","src/main/java/com/azure/ai/projects/InsightsClient.java","src/main/java/com/azure/ai/projects/ModelsAsyncClient.java","src/main/java/com/azure/ai/projects/ModelsClient.java","src/main/java/com/azure/ai/projects/RedTeamsAsyncClient.java","src/main/java/com/azure/ai/projects/RedTeamsClient.java","src/main/java/com/azure/ai/projects/RoutinesAsyncClient.java","src/main/java/com/azure/ai/projects/RoutinesClient.java","src/main/java/com/azure/ai/projects/SchedulesAsyncClient.java","src/main/java/com/azure/ai/projects/SchedulesClient.java","src/main/java/com/azure/ai/projects/SkillsAsyncClient.java","src/main/java/com/azure/ai/projects/SkillsClient.java","src/main/java/com/azure/ai/projects/implementation/AIProjectClientImpl.java","src/main/java/com/azure/ai/projects/implementation/ConnectionsImpl.java","src/main/java/com/azure/ai/projects/implementation/DataGenerationJobsImpl.java","src/main/java/com/azure/ai/projects/implementation/DatasetsImpl.java","src/main/java/com/azure/ai/projects/implementation/DeploymentsImpl.java","src/main/java/com/azure/ai/projects/implementation/EvaluationRulesImpl.java","src/main/java/com/azure/ai/projects/implementation/EvaluationTaxonomiesImpl.java","src/main/java/com/azure/ai/projects/implementation/EvaluatorsImpl.java","src/main/java/com/azure/ai/projects/implementation/IndexesImpl.java","src/main/java/com/azure/ai/projects/implementation/InsightsImpl.java","src/main/java/com/azure/ai/projects/implementation/JsonMergePatchHelper.java","src/main/java/com/azure/ai/projects/implementation/ModelsImpl.java","src/main/java/com/azure/ai/projects/implementation/MultipartFormDataHelper.java","src/main/java/com/azure/ai/projects/implementation/RedTeamsImpl.java","src/main/java/com/azure/ai/projects/implementation/RoutinesImpl.java","src/main/java/com/azure/ai/projects/implementation/SchedulesImpl.java","src/main/java/com/azure/ai/projects/implementation/SkillsImpl.java","src/main/java/com/azure/ai/projects/implementation/models/CreateOrUpdateRoutineRequest.java","src/main/java/com/azure/ai/projects/implementation/models/CreateSkillVersionRequest.java","src/main/java/com/azure/ai/projects/implementation/models/DispatchRoutineAsyncRequest.java","src/main/java/com/azure/ai/projects/implementation/models/UpdateSkillRequest.java","src/main/java/com/azure/ai/projects/implementation/models/package-info.java","src/main/java/com/azure/ai/projects/implementation/package-info.java","src/main/java/com/azure/ai/projects/models/AIProjectIndex.java","src/main/java/com/azure/ai/projects/models/AgentClusterInsightRequest.java","src/main/java/com/azure/ai/projects/models/AgentClusterInsightResult.java","src/main/java/com/azure/ai/projects/models/AgentDataGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/AgentEvaluatorGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/AgentTaxonomyInput.java","src/main/java/com/azure/ai/projects/models/AgenticIdentityPreviewCredential.java","src/main/java/com/azure/ai/projects/models/ApiError.java","src/main/java/com/azure/ai/projects/models/ApiKeyCredential.java","src/main/java/com/azure/ai/projects/models/ArtifactProfile.java","src/main/java/com/azure/ai/projects/models/AttackStrategy.java","src/main/java/com/azure/ai/projects/models/AzureAIAgentTarget.java","src/main/java/com/azure/ai/projects/models/AzureAIModelTarget.java","src/main/java/com/azure/ai/projects/models/AzureAISearchIndex.java","src/main/java/com/azure/ai/projects/models/AzureOpenAIModelConfiguration.java","src/main/java/com/azure/ai/projects/models/BaseCredential.java","src/main/java/com/azure/ai/projects/models/BlobReference.java","src/main/java/com/azure/ai/projects/models/BlobReferenceSasCredential.java","src/main/java/com/azure/ai/projects/models/ChartCoordinate.java","src/main/java/com/azure/ai/projects/models/ClusterInsightResult.java","src/main/java/com/azure/ai/projects/models/ClusterTokenUsage.java","src/main/java/com/azure/ai/projects/models/CodeBasedEvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/Connection.java","src/main/java/com/azure/ai/projects/models/ConnectionType.java","src/main/java/com/azure/ai/projects/models/ContinuousEvaluationRuleAction.java","src/main/java/com/azure/ai/projects/models/CosmosDBIndex.java","src/main/java/com/azure/ai/projects/models/CreateAsyncResponse.java","src/main/java/com/azure/ai/projects/models/CreateSkillVersionFromFilesBody.java","src/main/java/com/azure/ai/projects/models/CredentialType.java","src/main/java/com/azure/ai/projects/models/CronTrigger.java","src/main/java/com/azure/ai/projects/models/CustomCredential.java","src/main/java/com/azure/ai/projects/models/CustomRoutineTrigger.java","src/main/java/com/azure/ai/projects/models/DailyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/DataGenerationJob.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobInputs.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobOptions.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobOutput.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputOptions.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobOutputType.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobResult.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobScenario.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobSourceType.java","src/main/java/com/azure/ai/projects/models/DataGenerationJobType.java","src/main/java/com/azure/ai/projects/models/DataGenerationModelOptions.java","src/main/java/com/azure/ai/projects/models/DataGenerationTokenUsage.java","src/main/java/com/azure/ai/projects/models/DatasetCredential.java","src/main/java/com/azure/ai/projects/models/DatasetDataGenerationJobOutput.java","src/main/java/com/azure/ai/projects/models/DatasetEvaluatorGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/DatasetReference.java","src/main/java/com/azure/ai/projects/models/DatasetType.java","src/main/java/com/azure/ai/projects/models/DatasetVersion.java","src/main/java/com/azure/ai/projects/models/Deployment.java","src/main/java/com/azure/ai/projects/models/DeploymentType.java","src/main/java/com/azure/ai/projects/models/Dimension.java","src/main/java/com/azure/ai/projects/models/DispatchRoutineResult.java","src/main/java/com/azure/ai/projects/models/EmbeddingConfiguration.java","src/main/java/com/azure/ai/projects/models/EntraIdCredential.java","src/main/java/com/azure/ai/projects/models/EvaluationComparisonInsightRequest.java","src/main/java/com/azure/ai/projects/models/EvaluationComparisonInsightResult.java","src/main/java/com/azure/ai/projects/models/EvaluationResult.java","src/main/java/com/azure/ai/projects/models/EvaluationResultSample.java","src/main/java/com/azure/ai/projects/models/EvaluationRule.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleAction.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleActionType.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleEventType.java","src/main/java/com/azure/ai/projects/models/EvaluationRuleFilter.java","src/main/java/com/azure/ai/projects/models/EvaluationRunClusterInsightRequest.java","src/main/java/com/azure/ai/projects/models/EvaluationRunClusterInsightResult.java","src/main/java/com/azure/ai/projects/models/EvaluationRunResultCompareItem.java","src/main/java/com/azure/ai/projects/models/EvaluationRunResultComparison.java","src/main/java/com/azure/ai/projects/models/EvaluationRunResultSummary.java","src/main/java/com/azure/ai/projects/models/EvaluationScheduleTask.java","src/main/java/com/azure/ai/projects/models/EvaluationTaxonomy.java","src/main/java/com/azure/ai/projects/models/EvaluationTaxonomyInput.java","src/main/java/com/azure/ai/projects/models/EvaluationTaxonomyInputType.java","src/main/java/com/azure/ai/projects/models/EvaluatorCategory.java","src/main/java/com/azure/ai/projects/models/EvaluatorCredentialInput.java","src/main/java/com/azure/ai/projects/models/EvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/EvaluatorDefinitionType.java","src/main/java/com/azure/ai/projects/models/EvaluatorGenerationArtifacts.java","src/main/java/com/azure/ai/projects/models/EvaluatorGenerationInputs.java","src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJob.java","src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/EvaluatorGenerationJobSourceType.java","src/main/java/com/azure/ai/projects/models/EvaluatorGenerationTokenUsage.java","src/main/java/com/azure/ai/projects/models/EvaluatorMetric.java","src/main/java/com/azure/ai/projects/models/EvaluatorMetricDirection.java","src/main/java/com/azure/ai/projects/models/EvaluatorMetricType.java","src/main/java/com/azure/ai/projects/models/EvaluatorType.java","src/main/java/com/azure/ai/projects/models/EvaluatorVersion.java","src/main/java/com/azure/ai/projects/models/FieldMapping.java","src/main/java/com/azure/ai/projects/models/FileDataGenerationJobOutput.java","src/main/java/com/azure/ai/projects/models/FileDataGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/FileDatasetVersion.java","src/main/java/com/azure/ai/projects/models/FolderDatasetVersion.java","src/main/java/com/azure/ai/projects/models/FoundryFeaturesOptInKeys.java","src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileCategory.java","src/main/java/com/azure/ai/projects/models/FoundryModelArtifactProfileSignal.java","src/main/java/com/azure/ai/projects/models/FoundryModelSourceType.java","src/main/java/com/azure/ai/projects/models/FoundryModelWarning.java","src/main/java/com/azure/ai/projects/models/FoundryModelWarningCode.java","src/main/java/com/azure/ai/projects/models/FoundryModelWeightType.java","src/main/java/com/azure/ai/projects/models/GitHubIssueEvent.java","src/main/java/com/azure/ai/projects/models/GitHubIssueRoutineTrigger.java","src/main/java/com/azure/ai/projects/models/GraderAzureAIEvaluator.java","src/main/java/com/azure/ai/projects/models/HourlyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/HumanEvaluationPreviewRuleAction.java","src/main/java/com/azure/ai/projects/models/IndexType.java","src/main/java/com/azure/ai/projects/models/Insight.java","src/main/java/com/azure/ai/projects/models/InsightCluster.java","src/main/java/com/azure/ai/projects/models/InsightModelConfiguration.java","src/main/java/com/azure/ai/projects/models/InsightRequest.java","src/main/java/com/azure/ai/projects/models/InsightResult.java","src/main/java/com/azure/ai/projects/models/InsightSample.java","src/main/java/com/azure/ai/projects/models/InsightScheduleTask.java","src/main/java/com/azure/ai/projects/models/InsightSummary.java","src/main/java/com/azure/ai/projects/models/InsightType.java","src/main/java/com/azure/ai/projects/models/InsightsMetadata.java","src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiDispatchPayload.java","src/main/java/com/azure/ai/projects/models/InvokeAgentInvocationsApiRoutineAction.java","src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiDispatchPayload.java","src/main/java/com/azure/ai/projects/models/InvokeAgentResponsesApiRoutineAction.java","src/main/java/com/azure/ai/projects/models/JobStatus.java","src/main/java/com/azure/ai/projects/models/ListVersionsRequestType.java","src/main/java/com/azure/ai/projects/models/LoraConfig.java","src/main/java/com/azure/ai/projects/models/ManagedAzureAISearchIndex.java","src/main/java/com/azure/ai/projects/models/ModelCredentialInput.java","src/main/java/com/azure/ai/projects/models/ModelDeployment.java","src/main/java/com/azure/ai/projects/models/ModelDeploymentSku.java","src/main/java/com/azure/ai/projects/models/ModelPendingUploadInput.java","src/main/java/com/azure/ai/projects/models/ModelPendingUploadResult.java","src/main/java/com/azure/ai/projects/models/ModelSamplingParams.java","src/main/java/com/azure/ai/projects/models/ModelSourceData.java","src/main/java/com/azure/ai/projects/models/ModelVersion.java","src/main/java/com/azure/ai/projects/models/MonthlyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/NoAuthenticationCredential.java","src/main/java/com/azure/ai/projects/models/OneTimeTrigger.java","src/main/java/com/azure/ai/projects/models/OperationStatus.java","src/main/java/com/azure/ai/projects/models/PendingUploadRequest.java","src/main/java/com/azure/ai/projects/models/PendingUploadResponse.java","src/main/java/com/azure/ai/projects/models/PendingUploadType.java","src/main/java/com/azure/ai/projects/models/PromptBasedEvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/PromptDataGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/PromptEvaluatorGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/RecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/RecurrenceTrigger.java","src/main/java/com/azure/ai/projects/models/RecurrenceType.java","src/main/java/com/azure/ai/projects/models/RedTeam.java","src/main/java/com/azure/ai/projects/models/RiskCategory.java","src/main/java/com/azure/ai/projects/models/Routine.java","src/main/java/com/azure/ai/projects/models/RoutineAction.java","src/main/java/com/azure/ai/projects/models/RoutineActionType.java","src/main/java/com/azure/ai/projects/models/RoutineAttemptSource.java","src/main/java/com/azure/ai/projects/models/RoutineDispatchPayload.java","src/main/java/com/azure/ai/projects/models/RoutineDispatchPayloadType.java","src/main/java/com/azure/ai/projects/models/RoutineRun.java","src/main/java/com/azure/ai/projects/models/RoutineRunPhase.java","src/main/java/com/azure/ai/projects/models/RoutineTrigger.java","src/main/java/com/azure/ai/projects/models/RoutineTriggerType.java","src/main/java/com/azure/ai/projects/models/RubricBasedEvaluatorDefinition.java","src/main/java/com/azure/ai/projects/models/SampleType.java","src/main/java/com/azure/ai/projects/models/SasCredential.java","src/main/java/com/azure/ai/projects/models/Schedule.java","src/main/java/com/azure/ai/projects/models/ScheduleProvisioningStatus.java","src/main/java/com/azure/ai/projects/models/ScheduleRoutineTrigger.java","src/main/java/com/azure/ai/projects/models/ScheduleRun.java","src/main/java/com/azure/ai/projects/models/ScheduleTask.java","src/main/java/com/azure/ai/projects/models/ScheduleTaskType.java","src/main/java/com/azure/ai/projects/models/SimpleQnADataGenerationJobOptions.java","src/main/java/com/azure/ai/projects/models/SimpleQnAFineTuningQuestionType.java","src/main/java/com/azure/ai/projects/models/Skill.java","src/main/java/com/azure/ai/projects/models/SkillFileDetails.java","src/main/java/com/azure/ai/projects/models/SkillInlineContent.java","src/main/java/com/azure/ai/projects/models/SkillVersion.java","src/main/java/com/azure/ai/projects/models/SystemDataV3.java","src/main/java/com/azure/ai/projects/models/Target.java","src/main/java/com/azure/ai/projects/models/TargetConfig.java","src/main/java/com/azure/ai/projects/models/TaxonomyCategory.java","src/main/java/com/azure/ai/projects/models/TaxonomySubCategory.java","src/main/java/com/azure/ai/projects/models/TestingCriterionAzureAIEvaluator.java","src/main/java/com/azure/ai/projects/models/TimerRoutineTrigger.java","src/main/java/com/azure/ai/projects/models/ToolDescription.java","src/main/java/com/azure/ai/projects/models/ToolUseFineTuningDataGenerationJobOptions.java","src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobOptions.java","src/main/java/com/azure/ai/projects/models/TracesDataGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/TracesEvaluatorGenerationJobSource.java","src/main/java/com/azure/ai/projects/models/TreatmentEffectType.java","src/main/java/com/azure/ai/projects/models/Trigger.java","src/main/java/com/azure/ai/projects/models/TriggerType.java","src/main/java/com/azure/ai/projects/models/UpdateModelVersionInput.java","src/main/java/com/azure/ai/projects/models/WeeklyRecurrenceSchedule.java","src/main/java/com/azure/ai/projects/models/package-info.java","src/main/java/com/azure/ai/projects/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobWithEvaluationSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobWithEvaluationSample.java new file mode 100644 index 000000000000..4cf74629b77d --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobWithEvaluationSample.java @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.projects.models.ApiError; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.DataGenerationJobInputs; +import com.azure.ai.projects.models.DataGenerationJobOutput; +import com.azure.ai.projects.models.DataGenerationJobOutputOptions; +import com.azure.ai.projects.models.DataGenerationJobScenario; +import com.azure.ai.projects.models.DataGenerationModelOptions; +import com.azure.ai.projects.models.DatasetDataGenerationJobOutput; +import com.azure.ai.projects.models.DatasetVersion; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.JobStatus; +import com.azure.ai.projects.models.PromptDataGenerationJobSource; +import com.azure.ai.projects.models.SimpleQnADataGenerationJobOptions; +import com.azure.ai.projects.models.TestingCriterionAzureAIEvaluator; +import com.azure.core.util.Configuration; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.client.OpenAIClient; +import com.openai.core.JsonValue; +import com.openai.models.evals.EvalCreateParams; +import com.openai.models.evals.EvalCreateParams.DataSourceConfig.Custom; +import com.openai.models.evals.EvalCreateParams.DataSourceConfig.Custom.ItemSchema; +import com.openai.models.evals.EvalCreateResponse; +import com.openai.models.evals.EvalDeleteParams; +import com.openai.models.evals.runs.CreateEvalCompletionsRunDataSource; +import com.openai.models.evals.runs.RunCreateParams; +import com.openai.models.evals.runs.RunCreateResponse; +import com.openai.models.evals.runs.RunRetrieveParams; +import com.openai.models.evals.runs.RunRetrieveResponse; +import com.openai.models.evals.runs.outputitems.OutputItemListParams; +import com.openai.models.evals.runs.outputitems.OutputItemListResponse; +import com.openai.models.responses.EasyInputMessage; + +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/** + * End-to-end sample combining data generation with an OpenAI evaluation run. + * + *

The sample creates a Simple QnA data generation job from an inline prompt, waits for the generated dataset, + * creates an OpenAI evaluation using Azure AI built-in evaluators, runs the evaluation against the dataset, and cleans + * up the evaluation and data generation job.

+ * + *

Before running the sample, set these environment variables:

+ *
    + *
  • {@code FOUNDRY_PROJECT_ENDPOINT} - the Azure AI Foundry project endpoint.
  • + *
  • {@code FOUNDRY_MODEL_NAME} - the model deployment name used for generation and judging.
  • + *
  • {@code DATASET_NAME} - optional, the generated dataset name.
  • + *
  • {@code POLL_INTERVAL_SECONDS} - optional, seconds to wait between polling attempts.
  • + *
+ */ +public class DataGenerationJobWithEvaluationSample { + private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW + = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; + private static final String DEFAULT_DATASET_NAME = "dataset-generation-eval-sample"; + private static final int DEFAULT_POLL_INTERVAL_SECONDS = 10; + + public static void main(String[] args) throws InterruptedException { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + String datasetName = Configuration.getGlobalConfiguration().get("DATASET_NAME", DEFAULT_DATASET_NAME); + int pollIntervalSeconds = Integer.parseInt(Configuration.getGlobalConfiguration() + .get("POLL_INTERVAL_SECONDS", String.valueOf(DEFAULT_POLL_INTERVAL_SECONDS))); + + AIProjectClientBuilder projectClientBuilder = new AIProjectClientBuilder() + .endpoint(endpoint) + .credential(new DefaultAzureCredentialBuilder().build()); + + DataGenerationJobsClient dataGenerationJobsClient = projectClientBuilder.buildDataGenerationJobsClient(); + DatasetsClient datasetsClient = projectClientBuilder.buildDatasetsClient(); + OpenAIClient openAIClient = projectClientBuilder.buildOpenAIClient(); + + DataGenerationJob job = null; + EvalCreateResponse eval = null; + + try { + System.out.println("Create a data generation job."); + job = dataGenerationJobsClient.createGenerationJob(createDataGenerationJob(modelName, datasetName), + DATA_GENERATION_PREVIEW, UUID.randomUUID().toString()); + System.out.printf("Created data generation job `%s` (status: `%s`).%n", job.getId(), job.getStatus()); + + job = waitForDataGenerationJob(dataGenerationJobsClient, job.getId(), pollIntervalSeconds); + System.out.printf("Final job status: `%s`.%n", job.getStatus()); + + if (!JobStatus.SUCCEEDED.equals(job.getStatus())) { + ApiError error = job.getError(); + String message = error == null ? "" : error.getMessage(); + throw new IllegalStateException(String.format("Job `%s` ended with status `%s`: %s", + job.getId(), job.getStatus(), message)); + } + + DatasetDataGenerationJobOutput output = findDatasetOutput(job); + DatasetVersion dataset = datasetsClient.getDatasetVersion(output.getName(), output.getVersion()); + System.out.printf("Generated dataset: name=`%s` version=`%s` id=`%s`%n", + dataset.getName(), dataset.getVersion(), dataset.getId()); + + System.out.println("Create the evaluation."); + eval = openAIClient.evals().create(createEvaluationParams(modelName)); + System.out.printf("Evaluation created (id: %s).%n", eval.id()); + + System.out.printf("Create an evaluation run that consumes dataset `%s`.%n", dataset.getId()); + RunCreateResponse evalRun = openAIClient.evals().runs().create(createEvaluationRunParams(eval.id(), + dataset.getId(), modelName)); + System.out.printf("Evaluation run created (id: %s).%n", evalRun.id()); + + RunRetrieveResponse completedRun = waitForEvaluationRun(openAIClient, eval.id(), evalRun.id(), + pollIntervalSeconds); + System.out.printf("Final eval run status: `%s`.%n", completedRun.status()); + + if ("completed".equals(completedRun.status())) { + System.out.printf("Result counts: %s%n", completedRun.resultCounts()); + System.out.printf("Eval run report URL: %s%n", completedRun.reportUrl()); + printOutputItems(openAIClient, eval.id(), evalRun.id()); + } else { + System.out.println("Evaluation run did not complete successfully."); + } + } finally { + if (eval != null) { + System.out.printf("Delete evaluation `%s`.%n", eval.id()); + openAIClient.evals().delete(EvalDeleteParams.builder().evalId(eval.id()).build()); + } + if (job != null) { + System.out.printf("Delete the data generation job `%s`.%n", job.getId()); + dataGenerationJobsClient.deleteGenerationJob(job.getId(), DATA_GENERATION_PREVIEW); + } + } + } + + static DataGenerationJob createDataGenerationJob(String modelName, String datasetName) { + PromptDataGenerationJobSource source = new PromptDataGenerationJobSource( + "Contoso offers a full refund within 30 days of purchase for any product returned in its original " + + "condition. After 30 days, store credit may be issued at the discretion of customer support. " + + "Digital goods are non-refundable once downloaded.") + .setDescription("Contoso refund policy"); + + SimpleQnADataGenerationJobOptions options = new SimpleQnADataGenerationJobOptions(15) + .setModelOptions(new DataGenerationModelOptions(modelName)); + + DataGenerationJobOutputOptions outputOptions = new DataGenerationJobOutputOptions() + .setName(datasetName) + .setDescription("QnA pairs generated from the Contoso refund policy prompt.") + .setTags(Collections.singletonMap("sample", "dataset-generation-with-evaluation")); + + DataGenerationJobInputs inputs = new DataGenerationJobInputs("qna-from-policy-prompt", + Collections.singletonList(source), options, DataGenerationJobScenario.EVALUATION) + .setOutputOptions(outputOptions); + + return new DataGenerationJob().setInputs(inputs); + } + + private static DataGenerationJob waitForDataGenerationJob(DataGenerationJobsClient dataGenerationJobsClient, + String jobId, int pollIntervalSeconds) throws InterruptedException { + System.out.printf("Poll job `%s` until it reaches a terminal state.", jobId); + DataGenerationJob job; + do { + Thread.sleep(pollIntervalSeconds * 1000L); + System.out.print("."); + job = dataGenerationJobsClient.getGenerationJob(jobId, DATA_GENERATION_PREVIEW); + } while (!isTerminalStatus(job.getStatus())); + System.out.println(); + return job; + } + + static boolean isTerminalStatus(JobStatus status) { + return JobStatus.SUCCEEDED.equals(status) + || JobStatus.FAILED.equals(status) + || JobStatus.CANCELLED.equals(status); + } + + static DatasetDataGenerationJobOutput findDatasetOutput(DataGenerationJob job) { + if (job.getResult() != null && job.getResult().getOutputs() != null) { + for (DataGenerationJobOutput output : job.getResult().getOutputs()) { + if (output instanceof DatasetDataGenerationJobOutput) { + DatasetDataGenerationJobOutput datasetOutput = (DatasetDataGenerationJobOutput) output; + if (datasetOutput.getName() != null && datasetOutput.getVersion() != null) { + return datasetOutput; + } + } + } + } + + throw new IllegalStateException(String.format("Job `%s` did not produce a dataset output.", job.getId())); + } + + static EvalCreateParams createEvaluationParams(String modelName) { + Map queryProperty = new LinkedHashMap<>(); + queryProperty.put("type", "string"); + + Map groundTruthProperty = new LinkedHashMap<>(); + groundTruthProperty.put("type", "string"); + + Map properties = new LinkedHashMap<>(); + properties.put("query", queryProperty); + properties.put("ground_truth", groundTruthProperty); + + ItemSchema itemSchema = ItemSchema.builder() + .putAdditionalProperty("type", JsonValue.from("object")) + .putAdditionalProperty("properties", JsonValue.from(properties)) + .putAdditionalProperty("required", JsonValue.from(Collections.singletonList("query"))) + .build(); + + Custom dataSourceConfig = Custom.builder() + .itemSchema(itemSchema) + .includeSampleSchema(true) + .build(); + + return EvalCreateParams.builder() + .name("generated-qna-evaluation") + .dataSourceConfig(dataSourceConfig) + .testingCriteria(createAzureAIEvaluatorCriteria(modelName)) + .build(); + } + + private static List createAzureAIEvaluatorCriteria(String modelName) { + Map dataMapping = new LinkedHashMap<>(); + dataMapping.put("query", "{{item.query}}"); + dataMapping.put("response", "{{sample.output_text}}"); + return Arrays.asList( + createAzureAIEvaluator("coherence", "builtin.coherence", modelName, + dataMapping), + createAzureAIEvaluator("fluency", "builtin.fluency", modelName, + Collections.singletonMap("response", "{{sample.output_text}}"))); + } + + private static EvalCreateParams.TestingCriterion createAzureAIEvaluator(String name, String evaluatorName, + String modelName, Map dataMapping) { + TestingCriterionAzureAIEvaluator evaluator = new TestingCriterionAzureAIEvaluator(name, evaluatorName) + .setInitializationParameters(Collections.singletonMap("deployment_name", BinaryData.fromObject(modelName))) + .setDataMapping(dataMapping); + + return EvaluationsHelper.toTestingCriterion(evaluator); + } + + static RunCreateParams createEvaluationRunParams(String evalId, String datasetId, String modelName) { + CreateEvalCompletionsRunDataSource.InputMessages.Template inputMessages + = CreateEvalCompletionsRunDataSource.InputMessages.Template.builder() + .addTemplate(EasyInputMessage.builder() + .role(EasyInputMessage.Role.DEVELOPER) + .content("You are a Contoso customer-support assistant. Answer the user's question about the " + + "Contoso refund policy clearly and concisely.") + .build()) + .addTemplate(EasyInputMessage.builder() + .role(EasyInputMessage.Role.USER) + .content("{{item.query}}") + .build()) + .build(); + + CreateEvalCompletionsRunDataSource dataSource = CreateEvalCompletionsRunDataSource.builder() + .fileIdSource(datasetId) + .type(CreateEvalCompletionsRunDataSource.Type.COMPLETIONS) + .inputMessages(inputMessages) + .model(modelName) + .build(); + + return RunCreateParams.builder() + .evalId(evalId) + .name("generated-qna-evaluation-run") + .dataSource(dataSource) + .build(); + } + + private static RunRetrieveResponse waitForEvaluationRun(OpenAIClient openAIClient, String evalId, String runId, + int pollIntervalSeconds) throws InterruptedException { + RunRetrieveResponse evalRun = openAIClient.evals().runs().retrieve(RunRetrieveParams.builder() + .evalId(evalId) + .runId(runId) + .build()); + while (!"completed".equals(evalRun.status()) && !"failed".equals(evalRun.status())) { + Thread.sleep(pollIntervalSeconds * 1000L); + evalRun = openAIClient.evals().runs().retrieve(RunRetrieveParams.builder() + .evalId(evalId) + .runId(runId) + .build()); + } + return evalRun; + } + + private static void printOutputItems(OpenAIClient openAIClient, String evalId, String runId) { + int count = 0; + for (OutputItemListResponse item : openAIClient.evals().runs().outputItems().list(OutputItemListParams.builder() + .evalId(evalId) + .runId(runId) + .build()).autoPager()) { + count++; + System.out.printf(" item %d: status=%s | %s%n", count, item.status(), item.results()); + } + System.out.printf("Output items (total: %d).%n", count); + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobsAsyncSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobsAsyncSample.java new file mode 100644 index 000000000000..74c5740f06a5 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobsAsyncSample.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.DataGenerationJobInputs; +import com.azure.ai.projects.models.DataGenerationJobScenario; +import com.azure.ai.projects.models.DataGenerationModelOptions; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.PromptDataGenerationJobSource; +import com.azure.ai.projects.models.SimpleQnADataGenerationJobOptions; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.Collections; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * Sample demonstrating data generation job operations using the asynchronous DataGenerationJobsAsyncClient. + * + *

Data generation jobs are a preview feature. Before running, set the following environment variables:

+ *
    + *
  • {@code FOUNDRY_PROJECT_ENDPOINT} - the Azure AI Foundry project endpoint.
  • + *
  • {@code FOUNDRY_MODEL_NAME} - optional, a model deployment name for creating a generation job.
  • + *
+ */ +public class DataGenerationJobsAsyncSample { + private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW + = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; + + private static final DataGenerationJobsAsyncClient DATA_GENERATION_JOBS_ASYNC_CLIENT = new AIProjectClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT", "endpoint")) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildDataGenerationJobsAsyncClient(); + + public static void main(String[] args) { + listGenerationJobs() + .timeout(Duration.ofMinutes(2)) + .block(); + + // Uncomment to create, retrieve, cancel, and delete a sample job. +// createGetCancelAndDeleteGenerationJob().block(); + } + + public static Mono listGenerationJobs() { + // BEGIN:com.azure.ai.projects.DataGenerationJobsAsyncSample.listGenerationJobs + + AtomicBoolean found = new AtomicBoolean(false); + return DATA_GENERATION_JOBS_ASYNC_CLIENT.listGenerationJobs( + DATA_GENERATION_PREVIEW, 5, PageOrder.DESC, null, null) + .take(5) + .doOnNext(job -> { + found.set(true); + System.out.printf("Data generation job ID: %s%n", job.getId()); + System.out.printf("Status: %s%n", job.getStatus()); + if (job.getInputs() != null) { + System.out.printf("Input name: %s%n", job.getInputs().getName()); + } + System.out.println("-------------------------------------------------"); + }) + .then(Mono.fromRunnable(() -> { + if (!found.get()) { + System.out.println("No data generation jobs found."); + } + })); + + // END:com.azure.ai.projects.DataGenerationJobsAsyncSample.listGenerationJobs + } + + public static Mono createGetCancelAndDeleteGenerationJob() { + // BEGIN:com.azure.ai.projects.DataGenerationJobsAsyncSample.createGenerationJob + + String model = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + return DATA_GENERATION_JOBS_ASYNC_CLIENT.createGenerationJob( + createSampleDataGenerationJob(model), + DATA_GENERATION_PREVIEW, + UUID.randomUUID().toString() + ).doOnNext(job -> { + System.out.printf("Created data generation job: %s%n", job.getId()); + System.out.printf("Status: %s%n", job.getStatus()); + }) + + // END:com.azure.ai.projects.DataGenerationJobsAsyncSample.createGenerationJob + + // BEGIN:com.azure.ai.projects.DataGenerationJobsAsyncSample.getCancelDeleteGenerationJob + + .flatMap(job -> DATA_GENERATION_JOBS_ASYNC_CLIENT.getGenerationJob(job.getId(), DATA_GENERATION_PREVIEW)) + .doOnNext(fetched -> { + System.out.printf("Fetched data generation job: %s%n", fetched.getId()); + System.out.printf("Status: %s%n", fetched.getStatus()); + }) + .flatMap(fetched -> DATA_GENERATION_JOBS_ASYNC_CLIENT.cancelGenerationJob(fetched.getId(), + DATA_GENERATION_PREVIEW)) + .doOnNext(cancelled -> { + System.out.printf("Cancelled data generation job: %s%n", cancelled.getId()); + System.out.printf("Status: %s%n", cancelled.getStatus()); + }) + .flatMap(cancelled -> DATA_GENERATION_JOBS_ASYNC_CLIENT.deleteGenerationJob(cancelled.getId(), + DATA_GENERATION_PREVIEW) + .doOnSuccess(unused -> System.out.printf("Deleted data generation job: %s%n", cancelled.getId()))); + + // END:com.azure.ai.projects.DataGenerationJobsAsyncSample.getCancelDeleteGenerationJob + } + + private static DataGenerationJob createSampleDataGenerationJob(String model) { + PromptDataGenerationJobSource source = new PromptDataGenerationJobSource( + "Contoso TrailGear sells hiking backpacks and tents. Customer support should answer questions about " + + "warranty coverage, product care, returns, and trail safety in a concise, friendly tone.") + .setDescription("Contoso TrailGear support policy and product guidance."); + + SimpleQnADataGenerationJobOptions options = new SimpleQnADataGenerationJobOptions(1) + .setModelOptions(new DataGenerationModelOptions(model)); + + DataGenerationJobInputs inputs = new DataGenerationJobInputs( + "java-sample-data-generation-job", + Collections.singletonList(source), + options, + DataGenerationJobScenario.EVALUATION); + + return new DataGenerationJob().setInputs(inputs); + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobsSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobsSample.java new file mode 100644 index 000000000000..bfcfadfd549e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/DataGenerationJobsSample.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.DataGenerationJobInputs; +import com.azure.ai.projects.models.DataGenerationJobScenario; +import com.azure.ai.projects.models.DataGenerationModelOptions; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.PromptDataGenerationJobSource; +import com.azure.ai.projects.models.SimpleQnADataGenerationJobOptions; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.util.Collections; +import java.util.UUID; + +/** + * Sample demonstrating data generation job operations using the synchronous DataGenerationJobsClient. + * + *

Data generation jobs are a preview feature. Before running, set the following environment variables:

+ *
    + *
  • {@code FOUNDRY_PROJECT_ENDPOINT} - the Azure AI Foundry project endpoint.
  • + *
  • {@code FOUNDRY_MODEL_NAME} - optional, a model deployment name for creating a generation job.
  • + *
+ */ +public class DataGenerationJobsSample { + private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW + = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; + + private static final DataGenerationJobsClient DATA_GENERATION_JOBS_CLIENT = new AIProjectClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT", "endpoint")) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildDataGenerationJobsClient(); + + public static void main(String[] args) { + listGenerationJobs(); + + // Uncomment to create, retrieve, cancel, and delete a sample job. +// createGetCancelAndDeleteGenerationJob(); + } + + public static void listGenerationJobs() { + // BEGIN:com.azure.ai.projects.DataGenerationJobsSample.listGenerationJobs + + Iterable jobs = DATA_GENERATION_JOBS_CLIENT.listGenerationJobs( + DATA_GENERATION_PREVIEW, 5, PageOrder.DESC, null, null); + + int count = 0; + for (DataGenerationJob job : jobs) { + count++; + System.out.printf("Data generation job ID: %s%n", job.getId()); + System.out.printf("Status: %s%n", job.getStatus()); + if (job.getInputs() != null) { + System.out.printf("Input name: %s%n", job.getInputs().getName()); + } + System.out.println("-------------------------------------------------"); + } + if (count == 0) { + System.out.println("No data generation jobs found."); + } + + // END:com.azure.ai.projects.DataGenerationJobsSample.listGenerationJobs + } + + public static void createGetCancelAndDeleteGenerationJob() { + // BEGIN:com.azure.ai.projects.DataGenerationJobsSample.createGenerationJob + + String model = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_NAME"); + DataGenerationJob job = DATA_GENERATION_JOBS_CLIENT.createGenerationJob( + createSampleDataGenerationJob(model), + DATA_GENERATION_PREVIEW, + UUID.randomUUID().toString() + ); + + System.out.printf("Created data generation job: %s%n", job.getId()); + System.out.printf("Status: %s%n", job.getStatus()); + + // END:com.azure.ai.projects.DataGenerationJobsSample.createGenerationJob + + // BEGIN:com.azure.ai.projects.DataGenerationJobsSample.getCancelDeleteGenerationJob + + DataGenerationJob fetched = DATA_GENERATION_JOBS_CLIENT.getGenerationJob(job.getId(), DATA_GENERATION_PREVIEW); + System.out.printf("Fetched data generation job: %s%n", fetched.getId()); + System.out.printf("Status: %s%n", fetched.getStatus()); + + DataGenerationJob cancelled = DATA_GENERATION_JOBS_CLIENT.cancelGenerationJob(job.getId(), DATA_GENERATION_PREVIEW); + System.out.printf("Cancelled data generation job: %s%n", cancelled.getId()); + System.out.printf("Status: %s%n", cancelled.getStatus()); + + DATA_GENERATION_JOBS_CLIENT.deleteGenerationJob(job.getId(), DATA_GENERATION_PREVIEW); + System.out.printf("Deleted data generation job: %s%n", job.getId()); + + // END:com.azure.ai.projects.DataGenerationJobsSample.getCancelDeleteGenerationJob + } + + private static DataGenerationJob createSampleDataGenerationJob(String model) { + PromptDataGenerationJobSource source = new PromptDataGenerationJobSource( + "Contoso TrailGear sells hiking backpacks and tents. Customer support should answer questions about " + + "warranty coverage, product care, returns, and trail safety in a concise, friendly tone.") + .setDescription("Contoso TrailGear support policy and product guidance."); + + SimpleQnADataGenerationJobOptions options = new SimpleQnADataGenerationJobOptions(1) + .setModelOptions(new DataGenerationModelOptions(model)); + + DataGenerationJobInputs inputs = new DataGenerationJobInputs( + "java-sample-data-generation-job", + Collections.singletonList(source), + options, + DataGenerationJobScenario.EVALUATION); + + return new DataGenerationJob().setInputs(inputs); + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsAsyncSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsAsyncSample.java new file mode 100644 index 000000000000..d6c1155e96a6 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsAsyncSample.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.projects.models.ModelVersion; +import com.azure.ai.projects.models.UpdateModelVersionInput; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; + +import java.time.Duration; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; + +/** + * Sample demonstrating model version operations using the asynchronous ModelsAsyncClient. + * + *

Before running, set {@code FOUNDRY_PROJECT_ENDPOINT} to your Azure AI Foundry project endpoint.

+ */ +public class ModelsAsyncSample { + private static final ModelsAsyncClient MODELS_ASYNC_CLIENT = new AIProjectClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT", "endpoint")) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildModelsAsyncClient(); + + public static void main(String[] args) { + listLatestModelVersions() + .timeout(Duration.ofMinutes(2)) + .block(); + + // Uncomment these samples when you have a model asset name/version/blob URI to work with. +// listModelVersions().block(); +// getModelVersion().block(); +// createModelVersionAsync().block(); +// updateModelVersion().block(); +// deleteModelVersion().block(); + } + + public static Mono listLatestModelVersions() { + // BEGIN:com.azure.ai.projects.ModelsAsyncSample.listLatestModelVersions + + AtomicBoolean found = new AtomicBoolean(false); + return MODELS_ASYNC_CLIENT.listLatestModelVersions() + .doOnNext(modelVersion -> { + found.set(true); + System.out.printf("Model name: %s%n", modelVersion.getName()); + System.out.printf("Model version: %s%n", modelVersion.getVersion()); + System.out.printf("Blob URI: %s%n", modelVersion.getBlobUrl()); + System.out.println("-------------------------------------------------"); + }) + .then(Mono.fromRunnable(() -> { + if (!found.get()) { + System.out.println("No model versions found."); + } + })); + + // END:com.azure.ai.projects.ModelsAsyncSample.listLatestModelVersions + } + + public static Mono listModelVersions() { + // BEGIN:com.azure.ai.projects.ModelsAsyncSample.listModelVersions + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + return MODELS_ASYNC_CLIENT.listModelVersions(modelName) + .doOnNext(modelVersion -> { + System.out.printf("Model name: %s%n", modelVersion.getName()); + System.out.printf("Model version: %s%n", modelVersion.getVersion()); + System.out.println("-------------------------------------------------"); + }) + .then(); + + // END:com.azure.ai.projects.ModelsAsyncSample.listModelVersions + } + + public static Mono getModelVersion() { + // BEGIN:com.azure.ai.projects.ModelsAsyncSample.getModelVersion + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + return MODELS_ASYNC_CLIENT.getModelVersion(modelName, modelVersion) + .doOnNext(version -> { + System.out.printf("Model name: %s%n", version.getName()); + System.out.printf("Model version: %s%n", version.getVersion()); + System.out.printf("Description: %s%n", version.getDescription()); + }); + + // END:com.azure.ai.projects.ModelsAsyncSample.getModelVersion + } + + public static Mono createModelVersionAsync() { + // BEGIN:com.azure.ai.projects.ModelsAsyncSample.createModelVersionAsync + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + String blobUri = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_BLOB_URI"); + + ModelVersion modelVersionDefinition = new ModelVersion(blobUri) + .setDescription("Model version created by the Azure AI Projects Java SDK sample."); + + return MODELS_ASYNC_CLIENT.createModelVersionAsync(modelName, modelVersion, modelVersionDefinition) + .doOnSuccess(response -> System.out.printf("Started model version creation: %s/%s%n", modelName, + modelVersion)) + .then(); + + // END:com.azure.ai.projects.ModelsAsyncSample.createModelVersionAsync + } + + public static Mono updateModelVersion() { + // BEGIN:com.azure.ai.projects.ModelsAsyncSample.updateModelVersion + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + + Map tags = new HashMap<>(); + tags.put("sample", "true"); + + return MODELS_ASYNC_CLIENT.updateModelVersion(modelName, modelVersion, + new UpdateModelVersionInput() + .setDescription("Updated by the Azure AI Projects Java SDK sample.") + .setTags(tags)) + .doOnNext(updated -> System.out.printf("Updated model version: %s/%s%n", updated.getName(), + updated.getVersion())); + + // END:com.azure.ai.projects.ModelsAsyncSample.updateModelVersion + } + + public static Mono deleteModelVersion() { + // BEGIN:com.azure.ai.projects.ModelsAsyncSample.deleteModelVersion + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + + return MODELS_ASYNC_CLIENT.deleteModelVersion(modelName, modelVersion) + .doOnSuccess(unused -> System.out.printf("Deleted model version: %s/%s%n", modelName, modelVersion)); + + // END:com.azure.ai.projects.ModelsAsyncSample.deleteModelVersion + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsCreateAndPollSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsCreateAndPollSample.java new file mode 100644 index 000000000000..8c672d6cde53 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsCreateAndPollSample.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.projects.models.FoundryModelWeightType; +import com.azure.ai.projects.models.ModelPendingUploadInput; +import com.azure.ai.projects.models.ModelVersion; +import com.azure.core.exception.ResourceNotFoundException; +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.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.azure.storage.blob.BlobContainerClient; +import com.azure.storage.blob.BlobContainerClientBuilder; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Collections; +import java.util.Map; +import java.util.stream.Stream; + +/** + * Sample demonstrating model registration using the explicit pending-upload flow. + * + *

Before running, set {@code FOUNDRY_PROJECT_ENDPOINT}. You may optionally set {@code FOUNDRY_MODEL_ASSET_NAME}, + * {@code FOUNDRY_MODEL_ASSET_VERSION}, and {@code FOUNDRY_MODEL_ASSET_PATH}. If {@code FOUNDRY_MODEL_ASSET_PATH} is + * not set, the sample creates a small temporary folder with dummy model files.

+ */ +public class ModelsCreateAndPollSample { + public static void main(String[] args) throws IOException, InterruptedException { + String endpoint = Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT"); + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME", + "sample-model-pending-upload-java"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION", "1"); + Path sourceDirectory = getSourceDirectory(); + + ModelsClient modelsClient = new AIProjectClientBuilder() + .endpoint(endpoint) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildModelsClient(); + + System.out.printf("Step 1/3: start pending upload for %s/%s%n", modelName, modelVersion); + BlobUploadLocation uploadLocation = startPendingUpload(modelsClient, modelName, modelVersion); + + System.out.printf("Step 2/3: upload files from %s%n", sourceDirectory); + uploadDirectory(sourceDirectory, uploadLocation.getSasUrl()); + + System.out.printf("Step 3/3: create model version %s/%s%n", modelName, modelVersion); + modelsClient.createModelVersionAsync(modelName, modelVersion, + new ModelVersion(uploadLocation.getBlobUrl()) + .setWeightType(FoundryModelWeightType.FULL_WEIGHT) + .setDescription("Sample model registered from ModelsCreateAndPollSample.java") + .setTags(Collections.singletonMap("source", "ModelsCreateAndPollSample.java"))); + + try { + Map committed = pollUntilModelVersionExists(modelsClient, modelName, modelVersion); + System.out.printf("Model version is available: %s/%s%n", committed.get("name"), committed.get("version")); + } finally { + modelsClient.deleteModelVersion(modelName, modelVersion); + System.out.printf("Deleted model version: %s/%s%n", modelName, modelVersion); + } + } + + private static Path getSourceDirectory() throws IOException { + String configuredPath = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_PATH"); + if (configuredPath != null && !configuredPath.isEmpty()) { + return Paths.get(configuredPath); + } + + Path sourceDirectory = Files.createTempDirectory("sample-model-"); + Files.write(sourceDirectory.resolve("weights.bin"), "hello-foundry-model".getBytes(StandardCharsets.UTF_8)); + Files.write(sourceDirectory.resolve("config.json"), "{\"sample\":true}".getBytes(StandardCharsets.UTF_8)); + return sourceDirectory; + } + + private static BlobUploadLocation startPendingUpload(ModelsClient modelsClient, String modelName, + String modelVersion) { + Response pendingUploadResponse = modelsClient.startModelPendingUploadWithResponse(modelName, + modelVersion, BinaryData.fromObject(new ModelPendingUploadInput()), new RequestOptions()); + + Map payload = pendingUploadResponse.getValue().toObject(Map.class); + Object blobReference = payload.get("blobReferenceForConsumption"); + if (blobReference == null) { + blobReference = payload.get("blobReference"); + } + if (!(blobReference instanceof Map)) { + throw new IllegalStateException("Pending upload response did not include a blob reference: " + payload); + } + + Map blobReferenceMap = (Map) blobReference; + String blobUrl = stringValue(blobReferenceMap.get("blobUri")); + if (blobUrl == null) { + blobUrl = stringValue(blobReferenceMap.get("blobUrl")); + } + + Object credential = blobReferenceMap.get("credential"); + if (!(credential instanceof Map)) { + throw new IllegalStateException("Pending upload response did not include a SAS credential: " + payload); + } + Map credentialMap = (Map) credential; + String sasUrl = stringValue(credentialMap.get("sasUri")); + if (sasUrl == null) { + sasUrl = stringValue(credentialMap.get("sasUrl")); + } + + if (blobUrl == null || sasUrl == null) { + throw new IllegalStateException("Pending upload response missing SAS URL or blob URL: " + payload); + } + return new BlobUploadLocation(blobUrl, sasUrl); + } + + private static String stringValue(Object value) { + return value == null ? null : String.valueOf(value); + } + + private static void uploadDirectory(Path sourceDirectory, String containerSasUrl) throws IOException { + BlobContainerClient containerClient = new BlobContainerClientBuilder() + .endpoint(containerSasUrl) + .buildClient(); + + try (Stream paths = Files.walk(sourceDirectory)) { + paths.filter(Files::isRegularFile).forEach(path -> { + String blobName = sourceDirectory.relativize(path).toString().replace('\\', '/'); + containerClient.getBlobClient(blobName).upload(BinaryData.fromFile(path), true); + System.out.printf("Uploaded %s%n", blobName); + }); + } + } + + private static Map pollUntilModelVersionExists(ModelsClient modelsClient, String modelName, + String modelVersion) throws InterruptedException { + long deadline = System.currentTimeMillis() + 300_000; + while (true) { + try { + return modelsClient.getModelVersionWithResponse(modelName, modelVersion, new RequestOptions()) + .getValue() + .toObject(Map.class); + } catch (ResourceNotFoundException ex) { + if (System.currentTimeMillis() >= deadline) { + throw ex; + } + Thread.sleep(2_000); + } + } + } + + private static final class BlobUploadLocation { + private final String blobUrl; + private final String sasUrl; + + private BlobUploadLocation(String blobUrl, String sasUrl) { + this.blobUrl = blobUrl; + this.sasUrl = sasUrl; + } + + private String getBlobUrl() { + return blobUrl; + } + + private String getSasUrl() { + return sasUrl; + } + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsSample.java new file mode 100644 index 000000000000..32934a372325 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ModelsSample.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.projects.models.ModelVersion; +import com.azure.ai.projects.models.UpdateModelVersionInput; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.util.HashMap; +import java.util.Map; + +/** + * Sample demonstrating model version operations using the synchronous ModelsClient. + * + *

Before running, set {@code FOUNDRY_PROJECT_ENDPOINT} to your Azure AI Foundry project endpoint.

+ */ +public class ModelsSample { + private static final ModelsClient MODELS_CLIENT = new AIProjectClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT", "endpoint")) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildModelsClient(); + + public static void main(String[] args) { + listLatestModelVersions(); + + // Uncomment these samples when you have a model asset name/version/blob URI to work with. +// listModelVersions(); +// getModelVersion(); +// createModelVersionAsync(); +// updateModelVersion(); +// deleteModelVersion(); + } + + public static void listLatestModelVersions() { + // BEGIN:com.azure.ai.projects.ModelsSample.listLatestModelVersions + + int count = 0; + for (ModelVersion modelVersion : MODELS_CLIENT.listLatestModelVersions()) { + count++; + System.out.printf("Model name: %s%n", modelVersion.getName()); + System.out.printf("Model version: %s%n", modelVersion.getVersion()); + System.out.printf("Blob URI: %s%n", modelVersion.getBlobUrl()); + System.out.println("-------------------------------------------------"); + } + if (count == 0) { + System.out.println("No model versions found."); + } + + // END:com.azure.ai.projects.ModelsSample.listLatestModelVersions + } + + public static void listModelVersions() { + // BEGIN:com.azure.ai.projects.ModelsSample.listModelVersions + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + for (ModelVersion modelVersion : MODELS_CLIENT.listModelVersions(modelName)) { + System.out.printf("Model name: %s%n", modelVersion.getName()); + System.out.printf("Model version: %s%n", modelVersion.getVersion()); + System.out.println("-------------------------------------------------"); + } + + // END:com.azure.ai.projects.ModelsSample.listModelVersions + } + + public static void getModelVersion() { + // BEGIN:com.azure.ai.projects.ModelsSample.getModelVersion + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + ModelVersion version = MODELS_CLIENT.getModelVersion(modelName, modelVersion); + + System.out.printf("Model name: %s%n", version.getName()); + System.out.printf("Model version: %s%n", version.getVersion()); + System.out.printf("Description: %s%n", version.getDescription()); + + // END:com.azure.ai.projects.ModelsSample.getModelVersion + } + + public static void createModelVersionAsync() { + // BEGIN:com.azure.ai.projects.ModelsSample.createModelVersionAsync + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + String blobUri = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_BLOB_URI"); + + ModelVersion modelVersionDefinition = new ModelVersion(blobUri) + .setDescription("Model version created by the Azure AI Projects Java SDK sample."); + + MODELS_CLIENT.createModelVersionAsync(modelName, modelVersion, modelVersionDefinition); + System.out.printf("Started model version creation: %s/%s%n", modelName, modelVersion); + + // END:com.azure.ai.projects.ModelsSample.createModelVersionAsync + } + + public static void updateModelVersion() { + // BEGIN:com.azure.ai.projects.ModelsSample.updateModelVersion + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + + Map tags = new HashMap<>(); + tags.put("sample", "true"); + + ModelVersion updated = MODELS_CLIENT.updateModelVersion(modelName, modelVersion, + new UpdateModelVersionInput() + .setDescription("Updated by the Azure AI Projects Java SDK sample.") + .setTags(tags)); + + System.out.printf("Updated model version: %s/%s%n", updated.getName(), updated.getVersion()); + + // END:com.azure.ai.projects.ModelsSample.updateModelVersion + } + + public static void deleteModelVersion() { + // BEGIN:com.azure.ai.projects.ModelsSample.deleteModelVersion + + String modelName = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_NAME"); + String modelVersion = Configuration.getGlobalConfiguration().get("FOUNDRY_MODEL_ASSET_VERSION"); + + MODELS_CLIENT.deleteModelVersion(modelName, modelVersion); + System.out.printf("Deleted model version: %s/%s%n", modelName, modelVersion); + + // END:com.azure.ai.projects.ModelsSample.deleteModelVersion + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ReadmeSamples.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ReadmeSamples.java index b5d93350ed11..e43df35f75d8 100644 --- a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ReadmeSamples.java +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/ReadmeSamples.java @@ -8,17 +8,25 @@ import com.azure.ai.agents.AgentsClientBuilder; import com.azure.ai.agents.MemoryStoresClient; import com.azure.ai.agents.ResponsesClient; +import com.azure.ai.projects.models.TestingCriterionAzureAIEvaluator; +import com.azure.core.util.BinaryData; import com.openai.client.OpenAIClient; import com.openai.client.OpenAIClientAsync; +import com.openai.models.evals.EvalCreateParams; import com.openai.services.async.EvalServiceAsync; import com.openai.services.blocking.EvalService; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + public final class ReadmeSamples { public void readmeSamples() { // BEGIN: com.azure.ai.projects.clientInitialization AIProjectClientBuilder builder = new AIProjectClientBuilder(); ConnectionsClient connectionsClient = builder.buildConnectionsClient(); + DataGenerationJobsClient dataGenerationJobsClient = builder.buildDataGenerationJobsClient(); DatasetsClient datasetsClient = builder.buildDatasetsClient(); DeploymentsClient deploymentsClient = builder.buildDeploymentsClient(); EvaluationRulesClient evaluationRulesClient = builder.buildEvaluationRulesClient(); @@ -26,7 +34,9 @@ public void readmeSamples() { EvaluatorsClient evaluatorsClient = builder.buildEvaluatorsClient(); IndexesClient indexesClient = builder.buildIndexesClient(); InsightsClient insightsClient = builder.buildInsightsClient(); + ModelsClient modelsClient = builder.buildModelsClient(); RedTeamsClient redTeamsClient = builder.buildRedTeamsClient(); + RoutinesClient routinesClient = builder.buildRoutinesClient(); SchedulesClient schedulesClient = builder.buildSchedulesClient(); SkillsClient skillsClient = builder.buildSkillsClient(); // END: com.azure.ai.projects.clientInitialization @@ -36,6 +46,21 @@ public void readmeSamples() { EvalServiceAsync evalAsyncService = builder.buildOpenAIAsyncClient().evals(); // END: com.azure.ai.projects.evalsServices + // BEGIN: com.azure.ai.projects.evaluationsHelper + Map dataMapping = new LinkedHashMap<>(); + dataMapping.put("query", "{{item.query}}"); + dataMapping.put("response", "{{sample.output_text}}"); + + TestingCriterionAzureAIEvaluator coherenceEvaluator = new TestingCriterionAzureAIEvaluator("coherence", + "builtin.coherence") + .setInitializationParameters(Collections.singletonMap("deployment_name", + BinaryData.fromObject("gpt-4o-mini"))) + .setDataMapping(dataMapping); + + EvalCreateParams.TestingCriterion testingCriterion + = EvaluationsHelper.toTestingCriterion(coherenceEvaluator); + // END: com.azure.ai.projects.evaluationsHelper + // BEGIN: com.azure.ai.projects.openAIClient OpenAIClient openAIClient = builder.buildOpenAIClient(); OpenAIClientAsync openAIClientAsync = builder.buildOpenAIAsyncClient(); diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsAsyncSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsAsyncSample.java index 0809f86d6855..125fd554ce46 100644 --- a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsAsyncSample.java +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsAsyncSample.java @@ -2,15 +2,14 @@ // Licensed under the MIT License. package com.azure.ai.projects; -import com.azure.ai.projects.models.SkillDetails; +import com.azure.ai.projects.models.Skill; +import com.azure.ai.projects.models.SkillInlineContent; +import com.azure.ai.projects.models.SkillVersion; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.util.HashMap; -import java.util.Map; - /** * Sample demonstrating CRUD operations on Skills using the asynchronous SkillsAsyncClient. * @@ -29,34 +28,31 @@ public class SkillsAsyncSample { public static void main(String[] args) { // Using block() to wait for the async operations to complete in the sample -// createSkill().block(); +// createSkillVersion().block(); // getSkill().block(); // updateSkill().block(); // listSkills().blockLast(); // deleteSkill().block(); } - public static Mono createSkill() { - // BEGIN:com.azure.ai.projects.SkillsAsyncSample.createSkill - - Map metadata = new HashMap<>(); - metadata.put("domain", "support"); + public static Mono createSkillVersion() { + // BEGIN:com.azure.ai.projects.SkillsAsyncSample.createSkillVersion - return skillsAsyncClient.createSkill( - "product-support-skill", + SkillInlineContent inlineContent = new SkillInlineContent( "Answers product support questions using company policy.", - "You help answer product support questions using company policy and product guidance.", - metadata - ).doOnNext(skill -> { - System.out.println("Created skill: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); - }); - - // END:com.azure.ai.projects.SkillsAsyncSample.createSkill + "You help answer product support questions using company policy and product guidance." + ); + + return skillsAsyncClient.createSkillVersion("product-support-skill", inlineContent, true) + .doOnNext(skillVersion -> { + System.out.println("Created skill version: " + skillVersion.getName()); + System.out.println("Version: " + skillVersion.getVersion()); + }); + + // END:com.azure.ai.projects.SkillsAsyncSample.createSkillVersion } - public static Mono getSkill() { + public static Mono getSkill() { // BEGIN:com.azure.ai.projects.SkillsAsyncSample.getSkill String skillName = "product-support-skill"; @@ -64,44 +60,34 @@ public static Mono getSkill() { return skillsAsyncClient.getSkill(skillName) .doOnNext(skill -> { System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); System.out.println("Description: " + skill.getDescription()); + System.out.println("Default version: " + skill.getDefaultVersion()); }); // END:com.azure.ai.projects.SkillsAsyncSample.getSkill } - public static Mono updateSkill() { + public static Mono updateSkill() { // BEGIN:com.azure.ai.projects.SkillsAsyncSample.updateSkill String skillName = "product-support-skill"; - Map metadata = new HashMap<>(); - metadata.put("domain", "support"); - metadata.put("status", "updated"); - - return skillsAsyncClient.updateSkill( - skillName, - "Updated description for the sample skill.", - null, - metadata - ).doOnNext(updated -> { - System.out.println("Updated skill: " + updated.getName()); - System.out.println("Description: " + updated.getDescription()); - System.out.println("Metadata: " + updated.getMetadata()); - }); + return skillsAsyncClient.updateSkill(skillName, "2") + .doOnNext(updated -> { + System.out.println("Updated skill: " + updated.getName()); + System.out.println("Default version: " + updated.getDefaultVersion()); + }); // END:com.azure.ai.projects.SkillsAsyncSample.updateSkill } - public static Flux listSkills() { + public static Flux listSkills() { // BEGIN:com.azure.ai.projects.SkillsAsyncSample.listSkills return skillsAsyncClient.listSkills() .doOnNext(skill -> { System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); + System.out.println("Description: " + skill.getDescription()); System.out.println("-------------------------------------------------"); }); diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsPackageAsyncSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsPackageAsyncSample.java new file mode 100644 index 000000000000..aa3b117866c4 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsPackageAsyncSample.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.projects.models.CreateSkillVersionFromFilesBody; +import com.azure.ai.projects.models.SkillFileDetails; +import com.azure.ai.projects.models.Skill; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; +import reactor.core.publisher.Mono; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.time.Duration; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicReference; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * Sample demonstrating uploading and downloading a skill package using the asynchronous SkillsAsyncClient. + * + *

Skills are a preview feature. Before running, set the following environment variable:

+ *
    + *
  • {@code FOUNDRY_PROJECT_ENDPOINT} - the Azure AI Foundry project endpoint.
  • + *
+ */ +public class SkillsPackageAsyncSample { + private static final String SKILL_NAME = "java-sample-skill-package"; + + private static final SkillsAsyncClient SKILLS_ASYNC_CLIENT = new AIProjectClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT", "endpoint")) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildSkillsAsyncClient(); + + public static void main(String[] args) throws IOException { + AtomicReference skillNameRef = new AtomicReference<>(SKILL_NAME); + + Mono workflow = SKILLS_ASYNC_CLIENT.deleteSkill(SKILL_NAME) + .doOnSuccess(unused -> System.out.println("Deleted existing skill: " + SKILL_NAME)) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(SKILLS_ASYNC_CLIENT.createSkillVersionFromFiles(SKILL_NAME, createSkillPackageBody())) + .doOnNext(imported -> { + skillNameRef.set(imported.getName()); + System.out.println("Imported skill from package: " + imported.getName() + + " (version=" + imported.getVersion() + ")"); + }) + .flatMap(imported -> SKILLS_ASYNC_CLIENT.getSkill(imported.getName())) + .doOnNext(fetched -> System.out.println("Fetched imported skill: " + fetched.getName())) + .flatMap(SkillsPackageAsyncSample::downloadSkillContent) + .flatMap(fetched -> SKILLS_ASYNC_CLIENT.deleteSkill(fetched.getName()) + .doOnSuccess(unused -> System.out.println("Deleted imported skill: " + fetched.getName()))); + + workflow + .onErrorResume(error -> SKILLS_ASYNC_CLIENT.deleteSkill(skillNameRef.get()) + .onErrorResume(ResourceNotFoundException.class, ignored -> Mono.empty()) + .then(Mono.error(error))) + .timeout(Duration.ofMinutes(2)) + .block(); + } + + private static Mono downloadSkillContent(Skill fetched) { + return SKILLS_ASYNC_CLIENT.getSkillContent(fetched.getName()) + .map(downloaded -> { + try { + Path downloadPath = Files.createTempFile(fetched.getName() + "-", ".zip"); + Files.write(downloadPath, downloaded.toBytes()); + System.out.println("Downloaded skill package path: " + downloadPath); + return fetched; + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + } + + private static CreateSkillVersionFromFilesBody createSkillPackageBody() { + String skillMarkdown = "---\n" + + "name: " + SKILL_NAME + "\n" + + "description: Answers product support questions using company policy and product guidance.\n" + + "---\n\n" + + "You help answer product support questions using company policy and product guidance.\n"; + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { + zipOutputStream.putNextEntry(new ZipEntry(SKILL_NAME + "/SKILL.md")); + zipOutputStream.write(skillMarkdown.getBytes(StandardCharsets.UTF_8)); + zipOutputStream.closeEntry(); + } catch (IOException e) { + throw new RuntimeException(e); + } + + SkillFileDetails fileDetails = new SkillFileDetails(BinaryData.fromBytes(outputStream.toByteArray())) + .setFilename(SKILL_NAME + ".zip"); + return new CreateSkillVersionFromFilesBody(Arrays.asList(fileDetails)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsPackageSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsPackageSample.java new file mode 100644 index 000000000000..adecdbc3b19b --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsPackageSample.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.projects.models.CreateSkillVersionFromFilesBody; +import com.azure.ai.projects.models.SkillFileDetails; +import com.azure.ai.projects.models.Skill; +import com.azure.ai.projects.models.SkillVersion; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +/** + * Sample demonstrating uploading and downloading a skill package using the synchronous SkillsClient. + * + *

Skills are a preview feature. Before running, set the following environment variable:

+ *
    + *
  • {@code FOUNDRY_PROJECT_ENDPOINT} - the Azure AI Foundry project endpoint.
  • + *
+ */ +public class SkillsPackageSample { + private static final String SKILL_NAME = "java-sample-skill-package"; + + private static final SkillsClient SKILLS_CLIENT = new AIProjectClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT", "endpoint")) + .credential(new DefaultAzureCredentialBuilder().build()) + .buildSkillsClient(); + + public static void main(String[] args) throws IOException { + try { + SKILLS_CLIENT.deleteSkill(SKILL_NAME); + System.out.println("Deleted existing skill: " + SKILL_NAME); + } catch (ResourceNotFoundException ignored) { + // The sample skill does not already exist. + } + + SkillVersion imported = null; + try { + // BEGIN:com.azure.ai.projects.SkillsPackageSample.createSkillVersionFromFiles + + imported = SKILLS_CLIENT.createSkillVersionFromFiles(SKILL_NAME, createSkillPackageBody()); + System.out.println("Imported skill from package: " + imported.getName() + + " (version=" + imported.getVersion() + ")"); + + // END:com.azure.ai.projects.SkillsPackageSample.createSkillVersionFromFiles + + // BEGIN:com.azure.ai.projects.SkillsPackageSample.getSkillContent + + Skill fetched = SKILLS_CLIENT.getSkill(imported.getName()); + System.out.println("Fetched imported skill: " + fetched.getName()); + + BinaryData downloaded = SKILLS_CLIENT.getSkillContent(fetched.getName()); + Path downloadPath = Files.createTempFile(fetched.getName() + "-", ".zip"); + Files.write(downloadPath, downloaded.toBytes()); + System.out.println("Downloaded skill package path: " + downloadPath); + + // END:com.azure.ai.projects.SkillsPackageSample.getSkillContent + } finally { + String skillName = imported == null ? SKILL_NAME : imported.getName(); + try { + SKILLS_CLIENT.deleteSkill(skillName); + System.out.println("Deleted imported skill: " + skillName); + } catch (ResourceNotFoundException ignored) { + // The skill may not have been created. + } + } + } + + private static CreateSkillVersionFromFilesBody createSkillPackageBody() throws IOException { + String skillMarkdown = "---\n" + + "name: " + SKILL_NAME + "\n" + + "description: Answers product support questions using company policy and product guidance.\n" + + "---\n\n" + + "You help answer product support questions using company policy and product guidance.\n"; + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { + zipOutputStream.putNextEntry(new ZipEntry(SKILL_NAME + "/SKILL.md")); + zipOutputStream.write(skillMarkdown.getBytes(StandardCharsets.UTF_8)); + zipOutputStream.closeEntry(); + } + + SkillFileDetails fileDetails = new SkillFileDetails(BinaryData.fromBytes(outputStream.toByteArray())) + .setFilename(SKILL_NAME + ".zip"); + return new CreateSkillVersionFromFilesBody(Arrays.asList(fileDetails)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsSample.java b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsSample.java index 1260f1e3bfbb..c1c72b640102 100644 --- a/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsSample.java +++ b/sdk/ai/azure-ai-projects/src/samples/java/com/azure/ai/projects/SkillsSample.java @@ -2,14 +2,13 @@ // Licensed under the MIT License. package com.azure.ai.projects; -import com.azure.ai.projects.models.SkillDetails; +import com.azure.ai.projects.models.Skill; +import com.azure.ai.projects.models.SkillInlineContent; +import com.azure.ai.projects.models.SkillVersion; import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Configuration; import com.azure.identity.DefaultAzureCredentialBuilder; -import java.util.HashMap; -import java.util.Map; - /** * Sample demonstrating CRUD operations on Skills using the synchronous SkillsClient. * @@ -28,42 +27,38 @@ public class SkillsSample { public static void main(String[] args) { // Uncomment the sample you want to run -// createSkill(); +// createSkillVersion(); // getSkill(); // updateSkill(); // listSkills(); // deleteSkill(); } - public static void createSkill() { - // BEGIN:com.azure.ai.projects.SkillsSample.createSkill - - Map metadata = new HashMap<>(); - metadata.put("domain", "support"); + public static void createSkillVersion() { + // BEGIN:com.azure.ai.projects.SkillsSample.createSkillVersion - SkillDetails skill = skillsClient.createSkill( - "product-support-skill", + SkillInlineContent inlineContent = new SkillInlineContent( "Answers product support questions using company policy.", - "You help answer product support questions using company policy and product guidance.", - metadata + "You help answer product support questions using company policy and product guidance." ); - System.out.println("Created skill: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); + SkillVersion skillVersion = skillsClient.createSkillVersion("product-support-skill", inlineContent, true); + + System.out.println("Created skill version: " + skillVersion.getName()); + System.out.println("Version: " + skillVersion.getVersion()); - // END:com.azure.ai.projects.SkillsSample.createSkill + // END:com.azure.ai.projects.SkillsSample.createSkillVersion } public static void getSkill() { // BEGIN:com.azure.ai.projects.SkillsSample.getSkill String skillName = "product-support-skill"; - SkillDetails skill = skillsClient.getSkill(skillName); + Skill skill = skillsClient.getSkill(skillName); System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); System.out.println("Description: " + skill.getDescription()); + System.out.println("Default version: " + skill.getDefaultVersion()); // END:com.azure.ai.projects.SkillsSample.getSkill } @@ -73,20 +68,10 @@ public static void updateSkill() { String skillName = "product-support-skill"; - Map metadata = new HashMap<>(); - metadata.put("domain", "support"); - metadata.put("status", "updated"); - - SkillDetails updated = skillsClient.updateSkill( - skillName, - "Updated description for the sample skill.", - null, - metadata - ); + Skill updated = skillsClient.updateSkill(skillName, "2"); System.out.println("Updated skill: " + updated.getName()); - System.out.println("Description: " + updated.getDescription()); - System.out.println("Metadata: " + updated.getMetadata()); + System.out.println("Default version: " + updated.getDefaultVersion()); // END:com.azure.ai.projects.SkillsSample.updateSkill } @@ -94,11 +79,10 @@ public static void updateSkill() { public static void listSkills() { // BEGIN:com.azure.ai.projects.SkillsSample.listSkills - PagedIterable skills = skillsClient.listSkills(); - for (SkillDetails skill : skills) { + PagedIterable skills = skillsClient.listSkills(); + for (Skill skill : skills) { System.out.println("Skill name: " + skill.getName()); - System.out.println("Skill ID: " + skill.getSkillId()); - System.out.println("Blob present: " + skill.isBlobPresent()); + System.out.println("Description: " + skill.getDescription()); System.out.println("-------------------------------------------------"); } diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ClientTestBase.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ClientTestBase.java index e8f526ddc5a6..551b40ea0028 100644 --- a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ClientTestBase.java +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ClientTestBase.java @@ -55,10 +55,10 @@ protected AIProjectClientBuilder getClientBuilder(HttpClient httpClient, builder.endpoint("https://localhost:8080").credential(new MockTokenCredential()); } else if (testMode == TestMode.RECORD) { builder.addPolicy(interceptorManager.getRecordPolicy()) - .endpoint(Configuration.getGlobalConfiguration().get("AI_PROJECTS_ENDPOINT")) + .endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT")) .credential(new DefaultAzureCredentialBuilder().build()); } else { - builder.endpoint(Configuration.getGlobalConfiguration().get("AI_PROJECTS_ENDPOINT")) + builder.endpoint(Configuration.getGlobalConfiguration().get("FOUNDRY_PROJECT_ENDPOINT")) .credential(new DefaultAzureCredentialBuilder().build()); } diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsAsyncClientTest.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsAsyncClientTest.java index b35de9c8b7a9..2a8f34bcd321 100644 --- a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsAsyncClientTest.java +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsAsyncClientTest.java @@ -6,6 +6,7 @@ import com.azure.ai.projects.models.ConnectionType; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.RequestOptions; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -76,6 +77,28 @@ public void testGetConnectionWithoutCredentialsAsync(HttpClient httpClient, }).verifyComplete(); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testGetConnectionWithResponseWithoutCredentialsAsync(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + ConnectionsAsyncClient connectionsAsyncClient = getConnectionsAsyncClient(httpClient, serviceVersion); + + // Discover a real connection name from the list + String connectionName + = connectionsAsyncClient.listConnections().next().map(Connection::getName).block(Duration.ofSeconds(20)); + Assertions.assertNotNull(connectionName, "Expected at least one connection"); + + StepVerifier + .create(connectionsAsyncClient.getConnectionWithResponse(connectionName, false, new RequestOptions())) + .assertNext(response -> { + Connection connection = response.getValue().toObject(Connection.class); + assertValidConnection(connection, connectionName, null, null); + Assertions.assertNotNull(connection.getCredential().getType()); + System.out.println("Connection retrieved successfully: " + connection.getName()); + }) + .verifyComplete(); + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void testGetConnectionWithCredentialsAsync(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { @@ -96,6 +119,29 @@ public void testGetConnectionWithCredentialsAsync(HttpClient httpClient, AIProje .verifyComplete(); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testGetConnectionWithResponseWithCredentialsAsync(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + ConnectionsAsyncClient connectionsAsyncClient = getConnectionsAsyncClient(httpClient, serviceVersion); + + // Discover a real connection name from the list + String connectionName + = connectionsAsyncClient.listConnections().next().map(Connection::getName).block(Duration.ofSeconds(20)); + Assertions.assertNotNull(connectionName, "Expected at least one connection"); + + StepVerifier + .create(connectionsAsyncClient.getConnectionWithResponse(connectionName, true, new RequestOptions())) + .assertNext(response -> { + Connection connection = response.getValue().toObject(Connection.class); + assertValidConnection(connection, connectionName, null, null); + Assertions.assertNotNull(connection.getCredential().getType()); + System.out.println("Connection with credentials retrieved successfully: " + connection.getName()); + System.out.println("Credential type: " + connection.getCredential().getType()); + }) + .verifyComplete(); + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void testGetDefaultConnectionAsync(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsClientTest.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsClientTest.java index ff234655088e..cd0da788df91 100644 --- a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsClientTest.java +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/ConnectionsClientTest.java @@ -5,6 +5,7 @@ import com.azure.ai.projects.models.Connection; import com.azure.ai.projects.models.ConnectionType; import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.RequestOptions; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -81,6 +82,31 @@ public void testGetConnectionWithoutCredentials(HttpClient httpClient, AIProject System.out.println("Connection retrieved successfully: " + connection.getName()); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testGetConnectionWithResponseWithoutCredentials(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + ConnectionsClient connectionsClient = getConnectionsClient(httpClient, serviceVersion); + + // Discover a real connection name from the list + String connectionName = null; + for (Connection c : connectionsClient.listConnections()) { + connectionName = c.getName(); + break; + } + Assertions.assertNotNull(connectionName, "Expected at least one connection to test getConnection"); + + Connection connection = connectionsClient.getConnectionWithResponse(connectionName, false, new RequestOptions()) + .getValue() + .toObject(Connection.class); + + // Verify the connection properties + assertValidConnection(connection, connectionName, null, null); + Assertions.assertNotNull(connection.getCredential().getType()); + + System.out.println("Connection retrieved successfully: " + connection.getName()); + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void testGetConnectionWithCredentials(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { @@ -105,6 +131,33 @@ public void testGetConnectionWithCredentials(HttpClient httpClient, AIProjectsSe System.out.println("Credential type: " + connection.getCredential().getType()); } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testGetConnectionWithResponseWithCredentials(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + ConnectionsClient connectionsClient = getConnectionsClient(httpClient, serviceVersion); + + // Discover a real connection name from the list + String connectionName = null; + for (Connection c : connectionsClient.listConnections()) { + connectionName = c.getName(); + break; + } + Assertions.assertNotNull(connectionName, + "Expected at least one connection to test getConnectionWithCredentials"); + + Connection connection = connectionsClient.getConnectionWithResponse(connectionName, true, new RequestOptions()) + .getValue() + .toObject(Connection.class); + + // Verify the connection properties + assertValidConnection(connection, connectionName, null, null); + Assertions.assertNotNull(connection.getCredential().getType()); + + System.out.println("Connection with credentials retrieved successfully: " + connection.getName()); + System.out.println("Credential type: " + connection.getCredential().getType()); + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void testGetDefaultConnection(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DataGenerationJobsAsyncClientTests.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DataGenerationJobsAsyncClientTests.java new file mode 100644 index 000000000000..3d521682d1d0 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DataGenerationJobsAsyncClientTests.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.models.ApiError; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.DatasetDataGenerationJobOutput; +import com.azure.ai.projects.models.DatasetVersion; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.JobStatus; +import com.azure.core.http.HttpClient; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.util.Configuration; +import com.openai.client.OpenAIClientAsync; +import com.openai.models.evals.EvalCreateResponse; +import com.openai.models.evals.EvalDeleteParams; +import com.openai.models.evals.runs.RunCreateResponse; +import com.openai.models.evals.runs.RunRetrieveParams; +import com.openai.models.evals.runs.RunRetrieveResponse; +import com.openai.models.evals.runs.outputitems.OutputItemListParams; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.test.StepVerifier; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; + +import static com.azure.ai.projects.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; + +public class DataGenerationJobsAsyncClientTests extends ClientTestBase { + private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW + = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationJobsListAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { + DataGenerationJobsAsyncClient dataGenerationJobsAsyncClient + = getClientBuilder(httpClient, serviceVersion).buildDataGenerationJobsAsyncClient(); + + StepVerifier.create( + dataGenerationJobsAsyncClient.listGenerationJobs(DATA_GENERATION_PREVIEW, 5, PageOrder.DESC, null, null) + .take(5) + .doOnNext(job -> { + Assertions.assertNotNull(job); + Assertions.assertNotNull(job.getId()); + }) + .then()) + .verifyComplete(); + } + + @Timeout(value = 20, unit = TimeUnit.MINUTES) + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationJobWithEvaluationAsyncSample(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + AIProjectClientBuilder projectClientBuilder = getClientBuilder(httpClient, serviceVersion); + DataGenerationJobsAsyncClient dataGenerationJobsAsyncClient + = projectClientBuilder.buildDataGenerationJobsAsyncClient(); + DatasetsAsyncClient datasetsAsyncClient = projectClientBuilder.buildDatasetsAsyncClient(); + OpenAIClientAsync openAIAsyncClient = projectClientBuilder.buildOpenAIAsyncClient(); + + String modelName = getRecordedConfig("FOUNDRY_MODEL_NAME"); + String datasetName = testResourceNamer.randomName("dataset-generation-eval-", 64); + + Mono scenario = dataGenerationJobsAsyncClient + .createGenerationJob(DataGenerationJobWithEvaluationSample.createDataGenerationJob(modelName, datasetName), + DATA_GENERATION_PREVIEW, testResourceNamer.randomUuid()) + .flatMap(job -> waitForDataGenerationJob(dataGenerationJobsAsyncClient, job.getId(), 5, 180) + .flatMap(completedJob -> { + if (!JobStatus.SUCCEEDED.equals(completedJob.getStatus())) { + ApiError error = completedJob.getError(); + String message = error == null ? "" : error.getMessage(); + return Mono.error(new AssertionError(String.format("Job `%s` ended with status `%s`: %s", + completedJob.getId(), completedJob.getStatus(), message))); + } + + DatasetDataGenerationJobOutput output + = DataGenerationJobWithEvaluationSample.findDatasetOutput(completedJob); + return datasetsAsyncClient.getDatasetVersion(output.getName(), output.getVersion()) + .flatMap(dataset -> runEvaluation(openAIAsyncClient, dataset, modelName)) + .then(dataGenerationJobsAsyncClient.deleteGenerationJob(completedJob.getId(), + DATA_GENERATION_PREVIEW)); + })); + + StepVerifier.create(scenario).verifyComplete(); + } + + private Mono runEvaluation(OpenAIClientAsync openAIAsyncClient, DatasetVersion dataset, String modelName) { + Assertions.assertNotNull(dataset); + Assertions.assertNotNull(dataset.getId()); + + return deferFuture(() -> openAIAsyncClient.evals() + .create(DataGenerationJobWithEvaluationSample.createEvaluationParams(modelName))).flatMap(eval -> { + Assertions.assertNotNull(eval); + + Mono createRun = deferFuture(() -> openAIAsyncClient.evals() + .runs() + .create(DataGenerationJobWithEvaluationSample.createEvaluationRunParams(eval.id(), dataset.getId(), + modelName))); + + return createRun.flatMap(evalRun -> assertEvaluationRunCompleted(openAIAsyncClient, eval, evalRun)) + .then(deferFuture( + () -> openAIAsyncClient.evals().delete(EvalDeleteParams.builder().evalId(eval.id()).build()))) + .then(); + }); + } + + private Mono assertEvaluationRunCompleted(OpenAIClientAsync openAIAsyncClient, EvalCreateResponse eval, + RunCreateResponse evalRun) { + Assertions.assertNotNull(evalRun); + + return waitForEvaluationRun(openAIAsyncClient, eval.id(), evalRun.id(), 5, 180).flatMap(completedRun -> { + Assertions.assertEquals("completed", completedRun.status()); + Assertions.assertNotNull(completedRun.resultCounts()); + + OutputItemListParams outputItemsParams + = OutputItemListParams.builder().evalId(eval.id()).runId(evalRun.id()).build(); + return deferFuture(() -> openAIAsyncClient.evals().runs().outputItems().list(outputItemsParams)) + .flatMapMany(page -> Flux.fromIterable(page.items())) + .count() + .doOnNext(outputItemCount -> Assertions.assertTrue(outputItemCount > 0)) + .then(); + }); + } + + private Mono waitForDataGenerationJob( + DataGenerationJobsAsyncClient dataGenerationJobsAsyncClient, String jobId, int pollIntervalSeconds, + int maxAttempts) { + return pollDataGenerationJob(dataGenerationJobsAsyncClient, jobId, pollIntervalSeconds, maxAttempts, 0); + } + + private Mono pollDataGenerationJob(DataGenerationJobsAsyncClient dataGenerationJobsAsyncClient, + String jobId, int pollIntervalSeconds, int maxAttempts, int attempts) { + return sleepBeforePolling(pollIntervalSeconds, attempts) + .then(dataGenerationJobsAsyncClient.getGenerationJob(jobId, DATA_GENERATION_PREVIEW)) + .flatMap(job -> DataGenerationJobWithEvaluationSample.isTerminalStatus(job.getStatus()) + || attempts >= maxAttempts + ? Mono.just(job) + : pollDataGenerationJob(dataGenerationJobsAsyncClient, jobId, pollIntervalSeconds, maxAttempts, + attempts + 1)); + } + + private Mono waitForEvaluationRun(OpenAIClientAsync openAIAsyncClient, String evalId, + String runId, int pollIntervalSeconds, int maxAttempts) { + return pollEvaluationRun(openAIAsyncClient, evalId, runId, pollIntervalSeconds, maxAttempts, 0); + } + + private Mono pollEvaluationRun(OpenAIClientAsync openAIAsyncClient, String evalId, + String runId, int pollIntervalSeconds, int maxAttempts, int attempts) { + return sleepBeforePolling(pollIntervalSeconds, attempts) + .then(deferFuture(() -> openAIAsyncClient.evals() + .runs() + .retrieve(RunRetrieveParams.builder().evalId(evalId).runId(runId).build()))) + .flatMap(evalRun -> "completed".equals(evalRun.status()) + || "failed".equals(evalRun.status()) + || attempts >= maxAttempts + ? Mono.just(evalRun) + : pollEvaluationRun(openAIAsyncClient, evalId, runId, pollIntervalSeconds, maxAttempts, + attempts + 1)); + } + + private Mono sleepBeforePolling(int pollIntervalSeconds, int attempts) { + if (attempts == 0) { + return Mono.empty(); + } + + return Mono.fromRunnable(() -> sleepIfRunningAgainstService(pollIntervalSeconds * 1000L)); + } + + private Mono deferFuture(Supplier> futureSupplier) { + return Mono.defer(() -> Mono.fromFuture(futureSupplier.get())); + } + + private String getRecordedConfig(String name) { + if (getTestMode() == TestMode.PLAYBACK) { + return testResourceNamer.recordValueFromConfig(name); + } + + String value = Configuration.getGlobalConfiguration().get(name); + if (getTestMode() == TestMode.RECORD) { + testResourceNamer.recordValueFromConfig(name); + } + return value; + } +} diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DataGenerationJobsClientTests.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DataGenerationJobsClientTests.java new file mode 100644 index 000000000000..22d76ef979c6 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DataGenerationJobsClientTests.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.models.ApiError; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.DatasetDataGenerationJobOutput; +import com.azure.ai.projects.models.DatasetVersion; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.JobStatus; +import com.azure.core.http.HttpClient; +import com.azure.core.test.TestMode; +import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.util.Configuration; +import com.openai.client.OpenAIClient; +import com.openai.models.evals.EvalCreateResponse; +import com.openai.models.evals.EvalDeleteParams; +import com.openai.models.evals.runs.RunCreateResponse; +import com.openai.models.evals.runs.RunRetrieveParams; +import com.openai.models.evals.runs.RunRetrieveResponse; +import com.openai.models.evals.runs.outputitems.OutputItemListParams; +import com.openai.models.evals.runs.outputitems.OutputItemListResponse; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.concurrent.TimeUnit; + +import static com.azure.ai.projects.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; + +public class DataGenerationJobsClientTests extends ClientTestBase { + private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW + = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationJobsListSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { + DataGenerationJobsClient dataGenerationJobsClient + = getClientBuilder(httpClient, serviceVersion).buildDataGenerationJobsClient(); + + Iterable jobs + = dataGenerationJobsClient.listGenerationJobs(DATA_GENERATION_PREVIEW, 5, PageOrder.DESC, null, null); + Assertions.assertNotNull(jobs); + + int count = 0; + for (DataGenerationJob job : jobs) { + Assertions.assertNotNull(job); + Assertions.assertNotNull(job.getId()); + count++; + if (count >= 5) { + break; + } + } + } + + @Timeout(value = 20, unit = TimeUnit.MINUTES) + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationJobWithEvaluationSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) + throws InterruptedException { + AIProjectClientBuilder projectClientBuilder = getClientBuilder(httpClient, serviceVersion); + DataGenerationJobsClient dataGenerationJobsClient = projectClientBuilder.buildDataGenerationJobsClient(); + DatasetsClient datasetsClient = projectClientBuilder.buildDatasetsClient(); + OpenAIClient openAIClient = projectClientBuilder.buildOpenAIClient(); + + String modelName = getRecordedConfig("FOUNDRY_MODEL_NAME"); + String datasetName = testResourceNamer.randomName("dataset-generation-eval-", 64); + + DataGenerationJob job = dataGenerationJobsClient.createGenerationJob( + DataGenerationJobWithEvaluationSample.createDataGenerationJob(modelName, datasetName), + DATA_GENERATION_PREVIEW, testResourceNamer.randomUuid()); + + job = waitForDataGenerationJob(dataGenerationJobsClient, job.getId(), 5, 180); + if (!JobStatus.SUCCEEDED.equals(job.getStatus())) { + ApiError error = job.getError(); + String message = error == null ? "" : error.getMessage(); + Assertions + .fail(String.format("Job `%s` ended with status `%s`: %s", job.getId(), job.getStatus(), message)); + } + + DatasetDataGenerationJobOutput output = DataGenerationJobWithEvaluationSample.findDatasetOutput(job); + DatasetVersion dataset = datasetsClient.getDatasetVersion(output.getName(), output.getVersion()); + Assertions.assertNotNull(dataset); + Assertions.assertNotNull(dataset.getId()); + + EvalCreateResponse eval + = openAIClient.evals().create(DataGenerationJobWithEvaluationSample.createEvaluationParams(modelName)); + Assertions.assertNotNull(eval); + + RunCreateResponse evalRun = openAIClient.evals() + .runs() + .create( + DataGenerationJobWithEvaluationSample.createEvaluationRunParams(eval.id(), dataset.getId(), modelName)); + Assertions.assertNotNull(evalRun); + + RunRetrieveResponse completedRun = waitForEvaluationRun(openAIClient, eval.id(), evalRun.id(), 5, 180); + Assertions.assertEquals("completed", completedRun.status()); + Assertions.assertNotNull(completedRun.resultCounts()); + + int outputItemCount = 0; + for (OutputItemListResponse ignored : openAIClient.evals() + .runs() + .outputItems() + .list(OutputItemListParams.builder().evalId(eval.id()).runId(evalRun.id()).build()) + .autoPager()) { + outputItemCount++; + } + Assertions.assertTrue(outputItemCount > 0); + + openAIClient.evals().delete(EvalDeleteParams.builder().evalId(eval.id()).build()); + dataGenerationJobsClient.deleteGenerationJob(job.getId(), DATA_GENERATION_PREVIEW); + } + + private DataGenerationJob waitForDataGenerationJob(DataGenerationJobsClient dataGenerationJobsClient, String jobId, + int pollIntervalSeconds, int maxAttempts) throws InterruptedException { + DataGenerationJob job; + int attempts = 0; + do { + sleepIfRunningAgainstService(pollIntervalSeconds * 1000L); + job = dataGenerationJobsClient.getGenerationJob(jobId, DATA_GENERATION_PREVIEW); + attempts++; + } while (!DataGenerationJobWithEvaluationSample.isTerminalStatus(job.getStatus()) && attempts < maxAttempts); + return job; + } + + private RunRetrieveResponse waitForEvaluationRun(OpenAIClient openAIClient, String evalId, String runId, + int pollIntervalSeconds, int maxAttempts) throws InterruptedException { + RunRetrieveResponse evalRun + = openAIClient.evals().runs().retrieve(RunRetrieveParams.builder().evalId(evalId).runId(runId).build()); + int attempts = 0; + while (!"completed".equals(evalRun.status()) && !"failed".equals(evalRun.status()) && attempts < maxAttempts) { + sleepIfRunningAgainstService(pollIntervalSeconds * 1000L); + evalRun + = openAIClient.evals().runs().retrieve(RunRetrieveParams.builder().evalId(evalId).runId(runId).build()); + attempts++; + } + return evalRun; + } + + private String getRecordedConfig(String name) { + if (getTestMode() == TestMode.PLAYBACK) { + return testResourceNamer.recordValueFromConfig(name); + } + + String value = Configuration.getGlobalConfiguration().get(name); + if (getTestMode() == TestMode.RECORD) { + testResourceNamer.recordValueFromConfig(name); + } + return value; + } +} diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsAsyncClientTest.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsAsyncClientTest.java index d39bf0aef747..fd04e6b57ffa 100644 --- a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsAsyncClientTest.java +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsAsyncClientTest.java @@ -3,8 +3,11 @@ package com.azure.ai.projects; import com.azure.ai.projects.models.DatasetVersion; +import com.azure.ai.projects.models.FileDatasetVersion; +import com.azure.ai.projects.models.FolderDatasetVersion; import com.azure.ai.projects.models.PendingUploadRequest; import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.test.annotation.LiveOnly; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; @@ -45,6 +48,28 @@ public void testCreateDatasetWithFile(HttpClient httpClient, AIProjectsServiceVe .verifyComplete(); } + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testCreateDatasetWithFileWithResponse(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) + throws FileNotFoundException, URISyntaxException { + DatasetsAsyncClient datasetsAsyncClient = getDatasetsAsyncClient(httpClient, serviceVersion); + + String datasetName = "java-test-async-file-response-" + UUID.randomUUID().toString().substring(0, 8); + String datasetVersionString = "1"; + + Path filePath = getPath("product_info.md"); + + StepVerifier.create(datasetsAsyncClient.createDatasetWithFileWithResponse(datasetName, datasetVersionString, + filePath, new RequestOptions())).assertNext(response -> { + FileDatasetVersion createdDatasetVersion = response.getValue().toObject(FileDatasetVersion.class); + assertFileDatasetVersion(createdDatasetVersion, datasetName, datasetVersionString, null); + }).verifyComplete(); + + StepVerifier.create(datasetsAsyncClient.deleteDatasetVersion(datasetName, datasetVersionString)) + .verifyComplete(); + } + @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") @@ -77,6 +102,42 @@ public void testCreateDatasetWithFolder(HttpClient httpClient, AIProjectsService } } + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testCreateDatasetWithFolderWithResponse(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) + throws IOException { + DatasetsAsyncClient datasetsAsyncClient = getDatasetsAsyncClient(httpClient, serviceVersion); + + String datasetName = "java-test-async-folder-response-" + UUID.randomUUID().toString().substring(0, 8); + String datasetVersionString = "1"; + + Path tempFolder = Files.createTempDirectory("test-folder-dataset"); + Path file1 = tempFolder.resolve("file1.txt"); + Path file2 = tempFolder.resolve("file2.txt"); + Files.write(file1, "Test content 1".getBytes()); + Files.write(file2, "Test content 2".getBytes()); + + try { + StepVerifier + .create(datasetsAsyncClient.createDatasetWithFolderWithResponse(datasetName, datasetVersionString, + tempFolder, new RequestOptions())) + .assertNext(response -> { + FolderDatasetVersion createdDatasetVersion + = response.getValue().toObject(FolderDatasetVersion.class); + assertDatasetVersion(createdDatasetVersion, datasetName, datasetVersionString); + }) + .verifyComplete(); + + StepVerifier.create(datasetsAsyncClient.deleteDatasetVersion(datasetName, datasetVersionString)) + .verifyComplete(); + } finally { + Files.deleteIfExists(file1); + Files.deleteIfExists(file2); + Files.deleteIfExists(tempFolder); + } + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void testListDatasets(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsClientTest.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsClientTest.java index 33b4e4276806..7bcd4ee5f82b 100644 --- a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsClientTest.java +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/DatasetsClientTest.java @@ -8,6 +8,7 @@ import com.azure.ai.projects.models.PendingUploadRequest; import com.azure.ai.projects.models.PendingUploadResponse; import com.azure.core.http.HttpClient; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.test.annotation.LiveOnly; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; @@ -43,6 +44,28 @@ public void testCreateDatasetWithFile(HttpClient httpClient, AIProjectsServiceVe datasetsClient.deleteDatasetVersion(datasetName, datasetVersionString); } + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testCreateDatasetWithFileWithResponse(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) + throws FileNotFoundException, URISyntaxException { + DatasetsClient datasetsClient = getDatasetsClient(httpClient, serviceVersion); + + String datasetName = "java-test-file-response-" + UUID.randomUUID().toString().substring(0, 8); + String datasetVersionString = "1"; + + Path filePath = getPath("product_info.md"); + + FileDatasetVersion createdDatasetVersion = datasetsClient + .createDatasetWithFileWithResponse(datasetName, datasetVersionString, filePath, new RequestOptions()) + .getValue() + .toObject(FileDatasetVersion.class); + + assertFileDatasetVersion(createdDatasetVersion, datasetName, datasetVersionString, null); + + datasetsClient.deleteDatasetVersion(datasetName, datasetVersionString); + } + @LiveOnly @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") @@ -73,6 +96,40 @@ public void testCreateDatasetWithFolder(HttpClient httpClient, AIProjectsService } } + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void testCreateDatasetWithFolderWithResponse(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) + throws IOException { + DatasetsClient datasetsClient = getDatasetsClient(httpClient, serviceVersion); + + String datasetName = "java-test-folder-response-" + UUID.randomUUID().toString().substring(0, 8); + String datasetVersionString = "1"; + + Path tempFolder = Files.createTempDirectory("test-folder-dataset"); + Path file1 = tempFolder.resolve("file1.txt"); + Path file2 = tempFolder.resolve("file2.txt"); + Files.write(file1, "Test content 1".getBytes()); + Files.write(file2, "Test content 2".getBytes()); + + try { + FolderDatasetVersion createdDatasetVersion + = datasetsClient + .createDatasetWithFolderWithResponse(datasetName, datasetVersionString, tempFolder, + new RequestOptions()) + .getValue() + .toObject(FolderDatasetVersion.class); + + assertDatasetVersion(createdDatasetVersion, datasetName, datasetVersionString); + + datasetsClient.deleteDatasetVersion(datasetName, datasetVersionString); + } finally { + Files.deleteIfExists(file1); + Files.deleteIfExists(file2); + Files.deleteIfExists(tempFolder); + } + } + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") public void testListDatasets(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/EvaluationsHelperTests.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/EvaluationsHelperTests.java new file mode 100644 index 000000000000..30fa05e7fa5d --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/EvaluationsHelperTests.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.projects; + +import com.azure.ai.projects.models.TestingCriterionAzureAIEvaluator; +import com.azure.core.util.BinaryData; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.openai.core.ObjectMappers; +import com.openai.models.evals.EvalCreateParams; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +import java.util.Collections; + +public class EvaluationsHelperTests { + @Test + public void convertsAzureAIEvaluatorToTestingCriterion() throws JsonProcessingException { + TestingCriterionAzureAIEvaluator evaluator + = new TestingCriterionAzureAIEvaluator("coherence", "builtin.coherence") + .setInitializationParameters( + Collections.singletonMap("deployment_name", BinaryData.fromObject("gpt-4o-mini"))) + .setDataMapping(Collections.singletonMap("response", "{{sample.output_text}}")); + + EvalCreateParams.TestingCriterion testingCriterion = EvaluationsHelper.toTestingCriterion(evaluator); + + Assertions.assertNotNull(testingCriterion); + String json = ObjectMappers.jsonMapper().writeValueAsString(testingCriterion); + Assertions.assertTrue(json.contains("\"type\":\"azure_ai_evaluator\"")); + Assertions.assertTrue(json.contains("\"evaluator_name\":\"builtin.coherence\"")); + Assertions.assertTrue(json.contains("\"deployment_name\":\"gpt-4o-mini\"")); + Assertions.assertTrue(json.contains("\"response\":\"{{sample.output_text}}\"")); + } + + @Test + public void toTestingCriterionRequiresEvaluator() { + Assertions.assertThrows(NullPointerException.class, () -> EvaluationsHelper.toTestingCriterion(null)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java new file mode 100644 index 000000000000..6c2ea9114b4e --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/SamplesTests.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects; + +import com.azure.ai.agents.models.PageOrder; +import com.azure.ai.projects.models.CreateSkillVersionFromFilesBody; +import com.azure.ai.projects.models.DataGenerationJob; +import com.azure.ai.projects.models.FoundryFeaturesOptInKeys; +import com.azure.ai.projects.models.SkillFileDetails; +import com.azure.ai.projects.models.ModelVersion; +import com.azure.ai.projects.models.Skill; +import com.azure.ai.projects.models.SkillVersion; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpClient; +import com.azure.core.test.annotation.LiveOnly; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import reactor.test.StepVerifier; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +import static com.azure.ai.projects.TestUtils.DISPLAY_NAME_WITH_ARGUMENTS; + +public class SamplesTests extends ClientTestBase { + private static final String SAMPLE_SKILL_NAME = "java-sample-skill-package-test"; + private static final String SAMPLE_SKILL_ASYNC_NAME = "java-sample-skill-package-async-test"; + private static final FoundryFeaturesOptInKeys DATA_GENERATION_PREVIEW + = FoundryFeaturesOptInKeys.DATA_GENERATION_JOBS_V1_PREVIEW; + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void skillsPackageSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) throws IOException { + SkillsClient skillsClient = getClientBuilder(httpClient, serviceVersion).buildSkillsClient(); + String skillName = SAMPLE_SKILL_NAME; + + try { + skillsClient.deleteSkill(skillName); + } catch (ResourceNotFoundException ignored) { + // The sample skill does not already exist. + } + + SkillVersion imported = null; + try { + imported = skillsClient.createSkillVersionFromFiles(skillName, createSkillPackageBody(skillName)); + Assertions.assertNotNull(imported); + Assertions.assertEquals(skillName, imported.getName()); + + Skill fetched = skillsClient.getSkill(imported.getName()); + Assertions.assertNotNull(fetched); + Assertions.assertEquals(imported.getName(), fetched.getName()); + + BinaryData downloaded = skillsClient.getSkillContent(fetched.getName()); + Assertions.assertNotNull(downloaded); + Assertions.assertTrue(downloaded.toBytes().length > 0); + } finally { + String importedSkillName = imported == null ? skillName : imported.getName(); + try { + skillsClient.deleteSkill(importedSkillName); + } catch (ResourceNotFoundException ignored) { + // The skill may not have been created. + } + } + } + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void skillsPackageAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) + throws IOException { + SkillsAsyncClient skillsAsyncClient = getClientBuilder(httpClient, serviceVersion).buildSkillsAsyncClient(); + String skillName = SAMPLE_SKILL_ASYNC_NAME; + + StepVerifier.create(skillsAsyncClient.deleteSkill(skillName) + .onErrorResume(ResourceNotFoundException.class, ignored -> reactor.core.publisher.Mono.empty()) + .then(skillsAsyncClient.createSkillVersionFromFiles(skillName, createSkillPackageBody(skillName))) + .flatMap(imported -> { + Assertions.assertNotNull(imported); + Assertions.assertEquals(skillName, imported.getName()); + + return skillsAsyncClient.getSkill(imported.getName()).doOnNext(fetched -> { + Assertions.assertEquals(imported.getName(), fetched.getName()); + }).then(skillsAsyncClient.getSkillContent(imported.getName())).doOnNext(downloaded -> { + Assertions.assertNotNull(downloaded); + Assertions.assertTrue(downloaded.toBytes().length > 0); + }).then(skillsAsyncClient.deleteSkill(imported.getName())); + })).verifyComplete(); + } + + @Disabled("The live service returns 400: API operation not supported for token authentication.") + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationJobsListSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { + DataGenerationJobsClient dataGenerationJobsClient + = getClientBuilder(httpClient, serviceVersion).buildDataGenerationJobsClient(); + + Iterable jobs + = dataGenerationJobsClient.listGenerationJobs(DATA_GENERATION_PREVIEW, 5, PageOrder.DESC, null, null); + Assertions.assertNotNull(jobs); + + int count = 0; + for (DataGenerationJob job : jobs) { + Assertions.assertNotNull(job); + Assertions.assertNotNull(job.getId()); + count++; + if (count >= 5) { + break; + } + } + } + + @Disabled("The live service returns 400: API operation not supported for token authentication.") + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationJobsListAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { + DataGenerationJobsAsyncClient dataGenerationJobsAsyncClient + = getClientBuilder(httpClient, serviceVersion).buildDataGenerationJobsAsyncClient(); + + StepVerifier.create( + dataGenerationJobsAsyncClient.listGenerationJobs(DATA_GENERATION_PREVIEW, 5, PageOrder.DESC, null, null) + .take(5) + .doOnNext(job -> { + Assertions.assertNotNull(job); + Assertions.assertNotNull(job.getId()); + }) + .then()) + .verifyComplete(); + } + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void modelsListLatestSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { + ModelsClient modelsClient = getClientBuilder(httpClient, serviceVersion).buildModelsClient(); + + Iterable modelVersions = modelsClient.listLatestModelVersions(); + Assertions.assertNotNull(modelVersions); + + int count = 0; + for (ModelVersion modelVersion : modelVersions) { + Assertions.assertNotNull(modelVersion); + Assertions.assertNotNull(modelVersion.getName()); + Assertions.assertNotNull(modelVersion.getVersion()); + count++; + if (count >= 5) { + break; + } + } + } + + @LiveOnly + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void modelsListLatestAsyncSample(HttpClient httpClient, AIProjectsServiceVersion serviceVersion) { + ModelsAsyncClient modelsAsyncClient = getClientBuilder(httpClient, serviceVersion).buildModelsAsyncClient(); + + AtomicBoolean sawModel = new AtomicBoolean(false); + StepVerifier.create(modelsAsyncClient.listLatestModelVersions().take(5).doOnNext(modelVersion -> { + sawModel.set(true); + Assertions.assertNotNull(modelVersion); + Assertions.assertNotNull(modelVersion.getName()); + Assertions.assertNotNull(modelVersion.getVersion()); + }).then()).verifyComplete(); + // Empty model lists are valid for projects that have no model assets. + Assertions.assertNotNull(sawModel); + } + + @Disabled("Data generation live validation is blocked by 400: API operation not supported for token authentication; " + + "the create flow is also a long-running preview operation.") + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void dataGenerationCreateGetCancelDeleteSample(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + Assertions.fail("Enable after token-auth support is available for data generation jobs."); + } + + @Disabled("Requires FOUNDRY_MODEL_ASSET_NAME, FOUNDRY_MODEL_ASSET_VERSION, and FOUNDRY_MODEL_BLOB_URI.") + @ParameterizedTest(name = DISPLAY_NAME_WITH_ARGUMENTS) + @MethodSource("com.azure.ai.projects.TestUtils#getTestParameters") + public void modelVersionCreateGetUpdateDeleteSample(HttpClient httpClient, + AIProjectsServiceVersion serviceVersion) { + Assertions.fail("Enable after providing model asset environment variables."); + } + + private static CreateSkillVersionFromFilesBody createSkillPackageBody(String skillName) throws IOException { + String skillMarkdown = "---\n" + "name: " + skillName + "\n" + + "description: Answers product support questions using company policy and product guidance.\n" + "---\n\n" + + "You help answer product support questions using company policy and product guidance.\n"; + + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) { + ZipEntry skillEntry = new ZipEntry(skillName + "/SKILL.md"); + skillEntry.setTime(0); + zipOutputStream.putNextEntry(skillEntry); + zipOutputStream.write(skillMarkdown.getBytes(StandardCharsets.UTF_8)); + zipOutputStream.closeEntry(); + } + + SkillFileDetails fileDetails = new SkillFileDetails(BinaryData.fromBytes(outputStream.toByteArray())) + .setFilename(SAMPLE_SKILL_NAME + ".zip"); + return new CreateSkillVersionFromFilesBody(Arrays.asList(fileDetails)); + } +} diff --git a/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/models/AzureAIAgentTargetToolsTest.java b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/models/AzureAIAgentTargetToolsTest.java new file mode 100644 index 000000000000..7949b42434c1 --- /dev/null +++ b/sdk/ai/azure-ai-projects/src/test/java/com/azure/ai/projects/models/AzureAIAgentTargetToolsTest.java @@ -0,0 +1,303 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +package com.azure.ai.projects.models; + +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import com.azure.json.JsonWriter; +import com.openai.models.responses.Tool; +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; + +/** + * Tests for AzureAIAgentTarget tools typed getters/setters using + * {@link com.openai.models.responses.Tool} (openai-java Stainless SDK). + */ +public class AzureAIAgentTargetToolsTest { + + private static final String AGENT_NAME = "test-agent"; + + // ===== Deserialization tests ===== + + /** + * Tests deserialization with a function tool in the tools array. + */ + @Test + public void testDeserializationWithFunctionTool() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\"," + + "\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}}}}]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + assertEquals(AGENT_NAME, target.getName()); + + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isFunction()); + assertEquals("get_weather", tools.get(0).asFunction().name()); + } + + /** + * Tests deserialization with a file_search tool in the tools array. + */ + @Test + public void testDeserializationWithFileSearchTool() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"file_search\",\"vector_store_ids\":[\"vs_abc123\"]}]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isFileSearch()); + } + + /** + * Tests deserialization with a web_search tool in the tools array. + */ + @Test + public void testDeserializationWithWebSearchTool() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"web_search\",\"search_context_size\":\"medium\"}]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isWebSearch()); + } + + /** + * Tests deserialization with multiple tools of different types. + */ + @Test + public void testDeserializationWithMultipleTools() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + "\"tools\":[" + + "{\"type\":\"function\",\"name\":\"calculate\",\"parameters\":{\"type\":\"object\"}}," + + "{\"type\":\"file_search\",\"vector_store_ids\":[\"vs_1\",\"vs_2\"]}," + + "{\"type\":\"web_search\",\"search_context_size\":\"low\"}" + "]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(3, tools.size()); + assertTrue(tools.get(0).isFunction()); + assertTrue(tools.get(1).isFileSearch()); + assertTrue(tools.get(2).isWebSearch()); + assertEquals("calculate", tools.get(0).asFunction().name()); + } + + /** + * Tests deserialization with an empty tools array. + */ + @Test + public void testDeserializationWithEmptyTools() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\",\"tools\":[]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertTrue(tools.isEmpty()); + } + + /** + * Tests deserialization without tools field (null). + */ + @Test + public void testDeserializationWithoutTools() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + assertNull(target.getToolsAsOpenAITools()); + } + + // ===== Serialization tests ===== + + /** + * Tests serialization after setting tools via setToolsAsOpenAITools with a function tool. + */ + @Test + public void testSerializationWithFunctionTool() throws IOException { + // Build via deserialization first (avoids builder complexity) + String inputJson = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"function\",\"name\":\"lookup\"," + + "\"parameters\":{\"type\":\"object\",\"properties\":{}}}]}"; + + AzureAIAgentTarget target = deserializeFromJson(inputJson); + List tools = target.getToolsAsOpenAITools(); + + // Create a new target and set the tools + AzureAIAgentTarget newTarget = new AzureAIAgentTarget("new-agent").setToolsAsOpenAITools(tools); + + String json = serializeToJson(newTarget); + + assertNotNull(json); + assertTrue(json.contains("\"tools\""), "JSON should contain tools field"); + assertTrue(json.contains("\"name\":\"new-agent\"")); + assertTrue(json.contains("\"lookup\""), "JSON should contain function tool name"); + } + + /** + * Tests serialization without tools produces no tools field. + */ + @Test + public void testSerializationWithoutTools() throws IOException { + AzureAIAgentTarget target = new AzureAIAgentTarget(AGENT_NAME); + + String json = serializeToJson(target); + + assertNotNull(json); + assertTrue(json.contains("\"name\":\"test-agent\"")); + // tools should not appear when null + assertFalse(json.contains("\"tools\"")); + } + + // ===== Round-trip tests ===== + + /** + * Tests that a function tool survives a full serialize-deserialize round-trip. + */ + @Test + public void testRoundTripWithFunctionTool() throws IOException { + String originalJson = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"function\",\"name\":\"get_weather\"," + + "\"parameters\":{\"type\":\"object\",\"properties\":{\"city\":{\"type\":\"string\"}}}}]}"; + + AzureAIAgentTarget original = deserializeFromJson(originalJson); + String serialized = serializeToJson(original); + AzureAIAgentTarget deserialized = deserializeFromJson(serialized); + + assertNotNull(deserialized); + assertEquals("test-agent", deserialized.getName()); + List tools = deserialized.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isFunction()); + assertEquals("get_weather", tools.get(0).asFunction().name()); + } + + /** + * Tests that multiple tools survive a full round-trip through setToolsAsOpenAITools. + */ + @Test + public void testRoundTripViaTypedSetter() throws IOException { + String inputJson = "{\"name\":\"agent\",\"type\":\"azure_ai_agent\"," + "\"tools\":[" + + "{\"type\":\"function\",\"name\":\"func1\",\"parameters\":{\"type\":\"object\"}}," + + "{\"type\":\"file_search\",\"vector_store_ids\":[\"vs_x\"]}" + "]}"; + + // Deserialize, get typed tools, set on new target, serialize, deserialize again + AzureAIAgentTarget source = deserializeFromJson(inputJson); + List tools = source.getToolsAsOpenAITools(); + + AzureAIAgentTarget newTarget = new AzureAIAgentTarget("new-agent").setToolsAsOpenAITools(tools); + + String serialized = serializeToJson(newTarget); + AzureAIAgentTarget result = deserializeFromJson(serialized); + + assertNotNull(result); + assertEquals("new-agent", result.getName()); + List resultTools = result.getToolsAsOpenAITools(); + assertNotNull(resultTools); + assertEquals(2, resultTools.size()); + assertTrue(resultTools.get(0).isFunction()); + assertTrue(resultTools.get(1).isFileSearch()); + } + + /** + * Tests that other AzureAIAgentTarget properties (version, toolDescriptions) are + * preserved alongside typed tools. + */ + @Test + public void testOtherPropertiesPreserved() throws IOException { + String json = "{\"name\":\"agent-v2\",\"type\":\"azure_ai_agent\",\"version\":\"2.0\"," + + "\"tool_descriptions\":[{\"name\":\"my_tool\",\"description\":\"Does stuff\"}]," + + "\"tools\":[{\"type\":\"function\",\"name\":\"calc\",\"parameters\":{\"type\":\"object\"}}]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + assertEquals("agent-v2", target.getName()); + assertEquals("2.0", target.getVersion()); + assertNotNull(target.getToolDescriptions()); + assertEquals(1, target.getToolDescriptions().size()); + assertEquals("my_tool", target.getToolDescriptions().get(0).getName()); + + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isFunction()); + } + + /** + * Tests deserialization with an MCP tool. + */ + @Test + public void testDeserializationWithMcpTool() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"mcp\",\"server_label\":\"my-mcp\"," + + "\"server_url\":\"https://mcp.example.com\"}]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isMcp()); + } + + /** + * Tests deserialization with a code_interpreter tool. + */ + @Test + public void testDeserializationWithCodeInterpreterTool() throws IOException { + String json = "{\"name\":\"test-agent\",\"type\":\"azure_ai_agent\"," + + "\"tools\":[{\"type\":\"code_interpreter\",\"container\":\"ctr_abc123\"}]}"; + + AzureAIAgentTarget target = deserializeFromJson(json); + + assertNotNull(target); + List tools = target.getToolsAsOpenAITools(); + assertNotNull(tools); + assertEquals(1, tools.size()); + assertTrue(tools.get(0).isCodeInterpreter()); + } + + // ===== Helper methods ===== + + private String serializeToJson(AzureAIAgentTarget target) throws IOException { + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try (JsonWriter writer = JsonProviders.createWriter(outputStream)) { + target.toJson(writer); + } + return outputStream.toString("UTF-8"); + } + + private AzureAIAgentTarget deserializeFromJson(String json) throws IOException { + try (JsonReader reader = JsonProviders.createReader(json)) { + return AzureAIAgentTarget.fromJson(reader); + } + } +} diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml.hide b/sdk/ai/azure-ai-projects/tsp-location.yaml similarity index 71% rename from sdk/ai/azure-ai-projects/tsp-location.yaml.hide rename to sdk/ai/azure-ai-projects/tsp-location.yaml index b882d1e77f00..86fa80d8b023 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml.hide +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai-foundry/data-plane/Foundry -commit: 0018a7750744ebf7d78f6c67459c4e40c1967433 +commit: 36ed3f88fbc3da46c831e5f0acd4ff85ed163e1a repo: Azure/azure-rest-api-specs entrypointFile: client.java.tsp
Query Parameters