diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 8630c04a89e6..e110f060f21d 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -8,7 +8,7 @@ "@azure-tools/typespec-java": "0.38.5" }, "devDependencies": { - "@azure-tools/openai-typespec": "^1.7.0", + "@azure-tools/openai-typespec": "^1.7.1", "@azure-tools/typespec-autorest": "0.64.0", "@azure-tools/typespec-azure-core": "0.64.0", "@azure-tools/typespec-azure-resource-manager": "0.64.0", @@ -64,9 +64,9 @@ } }, "node_modules/@azure-tools/openai-typespec": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.7.0.tgz", - "integrity": "sha512-1c/eQNmfxwf1VBgw/mE8v0FGdz9jzQsPqTt4PyTYZxYU9tPOTMwrXOft6344kYRiN3eIq2vBje/rU6RV6Le2LA==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@azure-tools/openai-typespec/-/openai-typespec-1.7.1.tgz", + "integrity": "sha512-DoZLbQPgHyWKbIiUkCz2/9kKxWnZ/fZwvKGnjo3AJkZ8Si3QOHXR3JBp9LWiErsWPujg6k7NkTocqBXxih8pqQ==", "license": "MIT", "peerDependencies": { "@typespec/http": "*", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index cbe3b053dbd2..2a3934fff545 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -4,7 +4,7 @@ "@azure-tools/typespec-java": "0.38.5" }, "devDependencies": { - "@azure-tools/openai-typespec": "^1.7.0", + "@azure-tools/openai-typespec": "^1.7.1", "@azure-tools/typespec-autorest": "0.64.0", "@azure-tools/typespec-azure-core": "0.64.0", "@azure-tools/typespec-azure-resource-manager": "0.64.0", diff --git a/sdk/ai/azure-ai-agents/_tsp-location.yaml b/sdk/ai/azure-ai-agents/_tsp-location.yaml deleted file mode 100644 index 63abffbdc08c..000000000000 --- a/sdk/ai/azure-ai-agents/_tsp-location.yaml +++ /dev/null @@ -1,5 +0,0 @@ -directory: specification/ai/Azure.AI.Agents.V2.java -commit: 203d09050acd4d23496c0da4aaff9c6bb83097aa -repo: Azure/azure-rest-api-specs-pr -additionalDirectories: - - specification/ai/Azure.AI.Projects diff --git a/sdk/ai/azure-ai-agents/customizations/src/main/java/AgentsCustomizations.java b/sdk/ai/azure-ai-agents/customizations/src/main/java/AgentsCustomizations.java index 558cd98dbf7c..a3af16b6970d 100644 --- a/sdk/ai/azure-ai-agents/customizations/src/main/java/AgentsCustomizations.java +++ b/sdk/ai/azure-ai-agents/customizations/src/main/java/AgentsCustomizations.java @@ -11,44 +11,6 @@ public class AgentsCustomizations extends Customization { @Override public void customize(LibraryCustomization libraryCustomization, Logger logger) { - renameImageGenSizeEnums(libraryCustomization, logger); - } - - /** - * Customization for enum values that are originally numbers and get transliterated by the emitter. - * @param customization - * @param logger - */ - private void renameImageGenSizeEnums(LibraryCustomization customization, Logger logger) { - logger.info("Renaming enum ImageGenToolSize variants"); - customization.getClass("com.azure.ai.agents.models", "ImageGenToolSize").customizeAst(ast -> ast.getEnumByName("ImageGenToolSize") - .ifPresent(clazz -> clazz.getEntries().stream() - .filter(entry -> "ONE_ZERO_TWO_FOURX_ONE_ZERO_TWO_FOUR".equals(entry.getName().getIdentifier())) - .forEach(entry -> entry.setName("SIZE_1024X1024")))); - - customization.getClass("com.azure.ai.agents.models", "ImageGenToolSize").customizeAst(ast -> ast.getEnumByName("ImageGenToolSize") - .ifPresent(clazz -> clazz.getEntries().stream() - .filter(entry -> "ONE_ZERO_TWO_FOURX_ONE_FIVE_THREE_SIX".equals(entry.getName().getIdentifier())) - .forEach(entry -> entry.setName("SIZE_1024X1536")))); - - customization.getClass("com.azure.ai.agents.models", "ImageGenToolSize").customizeAst(ast -> ast.getEnumByName("ImageGenToolSize") - .ifPresent(clazz -> clazz.getEntries().stream() - .filter(entry -> "ONE_FIVE_THREE_SIXX_ONE_ZERO_TWO_FOUR".equals(entry.getName().getIdentifier())) - .forEach(entry -> entry.setName("SIZE_1536X1024")))); - - customization.getClass("com.azure.ai.agents.models", "ComputerActionType").customizeAst(ast -> ast.getEnumByName("ComputerActionType") - .ifPresent(clazz -> clazz.getEntries().stream() - .filter(entry -> "KEYPRESS".equals(entry.getName().getIdentifier())) - .forEach(entry -> entry.setName("KEY_PRESS")))); - - customization.getClass("com.azure.ai.agents.models", "ComputerActionKeyPress") - .customizeAst(ast -> ast.getClassByName("ComputerActionKeyPress") - .flatMap(clazz -> clazz.getFieldByName("type")) - .ifPresent(barField -> - barField.getVariables().forEach(var -> { - if (var.getNameAsString().equals("type")) { - var.setInitializer("ComputerActionType.KEY_PRESS"); - } - }))); + // no-op: reserved for future use } } \ No newline at end of file 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 6b0dd13a5f06..a9fc634c5fc9 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 @@ -14,9 +14,10 @@ import com.azure.ai.agents.models.AgentDetails; import com.azure.ai.agents.models.AgentKind; import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.ContainerLogKind; import com.azure.ai.agents.models.DeleteAgentResponse; import com.azure.ai.agents.models.DeleteAgentVersionResponse; -import com.azure.ai.agents.models.ListAgentsRequestOrder; +import com.azure.ai.agents.models.PageOrder; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -472,120 +473,6 @@ public PagedFlux listAgentVersions(String agentName) { }); } - /** - * Returns the list of all agents. - * - * @param kind Filter agents by kind. If not provided, all agents are returned. - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAgents(AgentKind kind, Integer limit, ListAgentsRequestOrder order, String after, - String before) { - // Generated convenience method for listAgents - RequestOptions requestOptions = new RequestOptions(); - if (kind != null) { - requestOptions.addQueryParam("kind", kind.toString(), false); - } - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - PagedFlux pagedFluxResponse = listAgents(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - - /** - * Returns the list of versions of an agent. - * - * @param agentName The name of the agent to retrieve versions for. - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAgentVersions(String agentName, Integer limit, - ListAgentsRequestOrder order, String after, String before) { - // Generated convenience method for listAgentVersions - RequestOptions requestOptions = new RequestOptions(); - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - PagedFlux pagedFluxResponse = listAgentVersions(agentName, requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux - .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * Create a new agent version. * @@ -1389,4 +1276,263 @@ public Mono getAgentVersionDetails(String agentName, String return getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions).flatMap(FluxUtil::toMono) .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class)); } + + /** + * Returns the list of all agents. + * + * @param kind Filter agents by kind. If not provided, all agents are returned. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAgents(AgentKind kind, Integer limit, PageOrder order, String after, + String before) { + // Generated convenience method for listAgents + RequestOptions requestOptions = new RequestOptions(); + if (kind != null) { + requestOptions.addQueryParam("kind", kind.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listAgents(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AgentDetails.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Returns the list of versions of an agent. + * + * @param agentName The name of the agent to retrieve versions for. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAgentVersions(String agentName, Integer limit, PageOrder order, + String after, String before) { + // Generated convenience method for listAgentVersions + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listAgentVersions(agentName, requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux + .map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoconsole returns container stdout/stderr, system returns container + * app event stream. defaults to console. Allowed values: "console", "system".
replica_nameStringNoWhen omitted, the server chooses the first replica for + * console logs. Required to target a specific replica.
tailIntegerNoNumber of trailing lines returned. Enforced to 1-300. Defaults to + * 20
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param agentName The name of the agent. + * @param agentVersion The version 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 {@link Response} on successful completion of {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> streamAgentContainerLogsWithResponse(String agentName, String agentVersion, + RequestOptions requestOptions) { + return this.serviceClient.streamAgentContainerLogsWithResponseAsync(agentName, agentVersion, requestOptions); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + * + * @param agentName The name of the agent. + * @param agentVersion The version of the agent. + * @param kind console returns container stdout/stderr, system returns container app event stream. defaults to + * console. + * @param replicaName When omitted, the server chooses the first replica for console logs. Required to target a + * specific replica. + * @param tail Number of trailing lines returned. Enforced to 1-300. Defaults to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if 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 streamAgentContainerLogs(String agentName, String agentVersion, ContainerLogKind kind, + String replicaName, Integer tail) { + // Generated convenience method for streamAgentContainerLogsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (kind != null) { + requestOptions.addQueryParam("kind", kind.toString(), false); + } + if (replicaName != null) { + requestOptions.addQueryParam("replica_name", replicaName, false); + } + if (tail != null) { + requestOptions.addQueryParam("tail", String.valueOf(tail), false); + } + return streamAgentContainerLogsWithResponse(agentName, agentVersion, requestOptions).flatMap(FluxUtil::toMono); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + * + * @param agentName The name of the agent. + * @param agentVersion The version 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 A {@link Mono} that completes when a successful response is received. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono streamAgentContainerLogs(String agentName, String agentVersion) { + // Generated convenience method for streamAgentContainerLogsWithResponse + RequestOptions requestOptions = new RequestOptions(); + return streamAgentContainerLogsWithResponse(agentName, agentVersion, requestOptions).flatMap(FluxUtil::toMono); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClient.java index 9b3d92f09365..be67d883ee76 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 @@ -14,9 +14,10 @@ import com.azure.ai.agents.models.AgentDetails; import com.azure.ai.agents.models.AgentKind; import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.ContainerLogKind; import com.azure.ai.agents.models.DeleteAgentResponse; import com.azure.ai.agents.models.DeleteAgentVersionResponse; -import com.azure.ai.agents.models.ListAgentsRequestOrder; +import com.azure.ai.agents.models.PageOrder; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -440,97 +441,6 @@ public PagedIterable listAgentVersions(String agentName) { .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentVersionDetails.class)); } - /** - * Returns the list of all agents. - * - * @param kind Filter agents by kind. If not provided, all agents are returned. - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAgents(AgentKind kind, Integer limit, ListAgentsRequestOrder order, - String after, String before) { - // Generated convenience method for listAgents - RequestOptions requestOptions = new RequestOptions(); - if (kind != null) { - requestOptions.addQueryParam("kind", kind.toString(), false); - } - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - return serviceClient.listAgents(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentDetails.class)); - } - - /** - * Returns the list of versions of an agent. - * - * @param agentName The name of the agent to retrieve versions for. - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAgentVersions(String agentName, Integer limit, - ListAgentsRequestOrder order, String after, String before) { - // Generated convenience method for listAgentVersions - RequestOptions requestOptions = new RequestOptions(); - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - return serviceClient.listAgentVersions(agentName, requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentVersionDetails.class)); - } - /** * Create a new agent version. * @@ -1324,4 +1234,238 @@ public AgentVersionDetails getAgentVersionDetails(String agentName, String agent return getAgentVersionDetailsWithResponse(agentName, agentVersion, requestOptions).getValue() .toObject(AgentVersionDetails.class); } + + /** + * Returns the list of all agents. + * + * @param kind Filter agents by kind. If not provided, all agents are returned. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAgents(AgentKind kind, Integer limit, PageOrder order, String after, + String before) { + // Generated convenience method for listAgents + RequestOptions requestOptions = new RequestOptions(); + if (kind != null) { + requestOptions.addQueryParam("kind", kind.toString(), false); + } + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listAgents(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentDetails.class)); + } + + /** + * Returns the list of versions of an agent. + * + * @param agentName The name of the agent to retrieve versions for. + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listAgentVersions(String agentName, Integer limit, PageOrder order, + String after, String before) { + // Generated convenience method for listAgentVersions + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listAgentVersions(agentName, requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(AgentVersionDetails.class)); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoconsole returns container stdout/stderr, system returns container + * app event stream. defaults to console. Allowed values: "console", "system".
replica_nameStringNoWhen omitted, the server chooses the first replica for + * console logs. Required to target a specific replica.
tailIntegerNoNumber of trailing lines returned. Enforced to 1-300. Defaults to + * 20
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param agentName The name of the agent. + * @param agentVersion The version 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 {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public Response streamAgentContainerLogsWithResponse(String agentName, String agentVersion, + RequestOptions requestOptions) { + return this.serviceClient.streamAgentContainerLogsWithResponse(agentName, agentVersion, requestOptions); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + * + * @param agentName The name of the agent. + * @param agentVersion The version of the agent. + * @param kind console returns container stdout/stderr, system returns container app event stream. defaults to + * console. + * @param replicaName When omitted, the server chooses the first replica for console logs. Required to target a + * specific replica. + * @param tail Number of trailing lines returned. Enforced to 1-300. Defaults to 20. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if 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 streamAgentContainerLogs(String agentName, String agentVersion, ContainerLogKind kind, + String replicaName, Integer tail) { + // Generated convenience method for streamAgentContainerLogsWithResponse + RequestOptions requestOptions = new RequestOptions(); + if (kind != null) { + requestOptions.addQueryParam("kind", kind.toString(), false); + } + if (replicaName != null) { + requestOptions.addQueryParam("replica_name", replicaName, false); + } + if (tail != null) { + requestOptions.addQueryParam("tail", String.valueOf(tail), false); + } + streamAgentContainerLogsWithResponse(agentName, agentVersion, requestOptions).getValue(); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + * + * @param agentName The name of the agent. + * @param agentVersion The version 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. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + public void streamAgentContainerLogs(String agentName, String agentVersion) { + // Generated convenience method for streamAgentContainerLogsWithResponse + RequestOptions requestOptions = new RequestOptions(); + streamAgentContainerLogsWithResponse(agentName, agentVersion, requestOptions).getValue(); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java index cd1e70bb3a1c..e92c4283f361 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsClientBuilder.java @@ -41,7 +41,6 @@ import com.openai.client.okhttp.OpenAIOkHttpClient; import com.openai.client.okhttp.OpenAIOkHttpClientAsync; import com.openai.credential.BearerTokenCredential; - import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java index 828ce8b686f9..b38aa35d5c09 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/AgentsServiceVersion.java @@ -10,16 +10,6 @@ * Service version of AgentsClient. */ public enum AgentsServiceVersion implements ServiceVersion { - /** - * Enum value 2025-05-01. - */ - V2025_05_01("2025-05-01"), - - /** - * Enum value 2025-05-15-preview. - */ - V2025_05_15_PREVIEW("2025-05-15-preview"), - /** * Enum value 2025-11-15-preview. */ diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java index cb6b0f3b54a4..ea0c6d64ac16 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresAsyncClient.java @@ -4,14 +4,14 @@ package com.azure.ai.agents; import com.azure.ai.agents.implementation.MemoryStoresImpl; +import com.azure.ai.agents.implementation.OpenAIJsonHelper; import com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest; import com.azure.ai.agents.implementation.models.DeleteScopeRequest; import com.azure.ai.agents.implementation.models.SearchMemoriesRequest; import com.azure.ai.agents.implementation.models.UpdateMemoriesRequest; import com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest; import com.azure.ai.agents.models.DeleteMemoryStoreResponse; -import com.azure.ai.agents.models.ItemParam; -import com.azure.ai.agents.models.ListAgentsRequestOrder; +import com.azure.ai.agents.models.InputItem; import com.azure.ai.agents.models.MemorySearchOptions; import com.azure.ai.agents.models.MemoryStoreDefinition; import com.azure.ai.agents.models.MemoryStoreDeleteScopeResponse; @@ -19,6 +19,7 @@ import com.azure.ai.agents.models.MemoryStoreSearchResponse; import com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult; import com.azure.ai.agents.models.MemoryStoreUpdateResponse; +import com.azure.ai.agents.models.PageOrder; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -35,6 +36,7 @@ import com.azure.core.util.BinaryData; import com.azure.core.util.FluxUtil; import com.azure.core.util.polling.PollerFlux; +import com.openai.models.responses.ResponseInputItem; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -301,7 +303,7 @@ public Mono> deleteMemoryStoreWithResponse(String name, Req * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_search_id: String (Optional) @@ -331,15 +333,15 @@ public Mono> deleteMemoryStoreWithResponse(String name, Req * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * } @@ -371,7 +373,7 @@ public Mono> searchMemoriesWithResponse(String name, Binary * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -403,15 +405,15 @@ public Mono> searchMemoriesWithResponse(String name, Binary * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -474,15 +476,15 @@ public PollerFlux beginUpdateMemories(String name, Binar * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -593,60 +595,6 @@ public Mono getMemoryStore(String name) { .map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class)); } - /** - * List all memory stores. - * - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMemoryStores(Integer limit, ListAgentsRequestOrder order, String after, - String before) { - // Generated convenience method for listMemoryStores - RequestOptions requestOptions = new RequestOptions(); - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - PagedFlux pagedFluxResponse = listMemoryStores(requestOptions); - return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { - Flux> flux = (continuationTokenParam == null) - ? pagedFluxResponse.byPage().take(1) - : pagedFluxResponse.byPage(continuationTokenParam).take(1); - return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), - pagedResponse.getStatusCode(), pagedResponse.getHeaders(), - pagedResponse.getValue() - .stream() - .map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class)) - .collect(Collectors.toList()), - pagedResponse.getContinuationToken(), null)); - }); - } - /** * List all memory stores. * @@ -900,9 +848,8 @@ public Mono deleteScope(String name, String scop * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return memory search response on successful completion of {@link Mono}. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public Mono searchMemories(String name, String scope, List items, + Mono _searchMemories(String name, String scope, List items, String previousSearchId, MemorySearchOptions options) { // Generated convenience method for searchMemoriesWithResponse RequestOptions requestOptions = new RequestOptions(); @@ -914,6 +861,31 @@ public Mono searchMemories(String name, String scope, .map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreSearchResponse.class)); } + /** + * Search for relevant memories from a memory store based on conversation context. + * + * @param name The name of the memory store to search. + * @param scope The namespace that logically groups and isolates memories, such as a user ID. + * @param items Items for which to search for relevant memories. + * @param previousSearchId The unique ID of the previous search request, enabling incremental memory search from + * where the last operation left off. + * @param options Memory search options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return memory search response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono searchMemories(String name, String scope, List items, + String previousSearchId, MemorySearchOptions options) { + // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list + List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson); + return _searchMemories(name, scope, inputItems, previousSearchId, options); + } + /** * Update memory store with conversation memories. * @@ -934,10 +906,9 @@ public Mono searchMemories(String name, String scope, * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of provides the status of a memory store update operation. */ - @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux beginUpdateMemories(String name, - String scope, List items, String previousUpdateId, Integer updateDelay) { + PollerFlux _beginUpdateMemories(String name, + String scope, List items, String previousUpdateId, Integer updateDelay) { // Generated convenience method for beginUpdateMemoriesWithModel RequestOptions requestOptions = new RequestOptions(); UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items) @@ -946,4 +917,85 @@ public PollerFlux b BinaryData updateMemoriesRequest = BinaryData.fromObject(updateMemoriesRequestObj); return serviceClient.beginUpdateMemoriesWithModelAsync(name, updateMemoriesRequest, requestOptions); } + + /** + * Update memory store with conversation memories. + * + * @param name The name of the memory store to update. + * @param scope The namespace that logically groups and isolates memories, such as a user ID. + * @param items Conversation items from which to extract memories (OpenAI SDK type). + * @param previousUpdateId The unique ID of the previous update request, enabling incremental memory updates from + * where the last operation left off. + * @param updateDelay Timeout period before processing the memory update in seconds. + * If a new update request is received during this period, it will cancel the current request and reset the timeout. + * Set to 0 to immediately trigger the update without delay. + * Defaults to 300 (5 minutes). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of provides the status of a memory store update operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginUpdateMemories(String name, + String scope, List items, String previousUpdateId, int updateDelay) { + // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list + List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson); + return _beginUpdateMemories(name, scope, inputItems, previousUpdateId, updateDelay); + } + + /** + * List all memory stores. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedFlux}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMemoryStores(Integer limit, PageOrder order, String after, String before) { + // Generated convenience method for listMemoryStores + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + PagedFlux pagedFluxResponse = listMemoryStores(requestOptions); + return PagedFlux.create(() -> (continuationTokenParam, pageSizeParam) -> { + Flux> flux = (continuationTokenParam == null) + ? pagedFluxResponse.byPage().take(1) + : pagedFluxResponse.byPage(continuationTokenParam).take(1); + return flux.map(pagedResponse -> new PagedResponseBase(pagedResponse.getRequest(), + pagedResponse.getStatusCode(), pagedResponse.getHeaders(), + pagedResponse.getValue() + .stream() + .map(protocolMethodData -> protocolMethodData.toObject(MemoryStoreDetails.class)) + .collect(Collectors.toList()), + pagedResponse.getContinuationToken(), null)); + }); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java index dda6f861558a..d973f11d56cb 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/MemoryStoresClient.java @@ -4,14 +4,14 @@ package com.azure.ai.agents; import com.azure.ai.agents.implementation.MemoryStoresImpl; +import com.azure.ai.agents.implementation.OpenAIJsonHelper; import com.azure.ai.agents.implementation.models.CreateMemoryStoreRequest; import com.azure.ai.agents.implementation.models.DeleteScopeRequest; import com.azure.ai.agents.implementation.models.SearchMemoriesRequest; import com.azure.ai.agents.implementation.models.UpdateMemoriesRequest; import com.azure.ai.agents.implementation.models.UpdateMemoryStoreRequest; import com.azure.ai.agents.models.DeleteMemoryStoreResponse; -import com.azure.ai.agents.models.ItemParam; -import com.azure.ai.agents.models.ListAgentsRequestOrder; +import com.azure.ai.agents.models.InputItem; import com.azure.ai.agents.models.MemorySearchOptions; import com.azure.ai.agents.models.MemoryStoreDefinition; import com.azure.ai.agents.models.MemoryStoreDeleteScopeResponse; @@ -19,6 +19,7 @@ import com.azure.ai.agents.models.MemoryStoreSearchResponse; import com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult; import com.azure.ai.agents.models.MemoryStoreUpdateResponse; +import com.azure.ai.agents.models.PageOrder; import com.azure.core.annotation.Generated; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceClient; @@ -32,6 +33,7 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.BinaryData; import com.azure.core.util.polling.SyncPoller; +import com.openai.models.responses.ResponseInputItem; import java.util.List; import java.util.Map; @@ -292,7 +294,7 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOp * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_search_id: String (Optional) @@ -322,15 +324,15 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOp * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * } @@ -362,7 +364,7 @@ public Response searchMemoriesWithResponse(String name, BinaryData s * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -394,15 +396,15 @@ public Response searchMemoriesWithResponse(String name, BinaryData s * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -465,15 +467,15 @@ public SyncPoller beginUpdateMemories(String name, Binar * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -583,49 +585,6 @@ public MemoryStoreDetails getMemoryStore(String name) { return getMemoryStoreWithResponse(name, requestOptions).getValue().toObject(MemoryStoreDetails.class); } - /** - * List all memory stores. - * - * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the - * default is 20. - * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` - * for descending order. - * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include after=obj_foo in order to fetch the next page of the list. - * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. - * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your - * subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. - * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. - * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. - */ - @Generated - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMemoryStores(Integer limit, ListAgentsRequestOrder order, String after, - String before) { - // Generated convenience method for listMemoryStores - RequestOptions requestOptions = new RequestOptions(); - if (limit != null) { - requestOptions.addQueryParam("limit", String.valueOf(limit), false); - } - if (order != null) { - requestOptions.addQueryParam("order", order.toString(), false); - } - if (after != null) { - requestOptions.addQueryParam("after", after, false); - } - if (before != null) { - requestOptions.addQueryParam("before", before, false); - } - return serviceClient.listMemoryStores(requestOptions) - .mapPage(bodyItemValue -> bodyItemValue.toObject(MemoryStoreDetails.class)); - } - /** * List all memory stores. * @@ -866,10 +825,9 @@ public MemoryStoreDeleteScopeResponse deleteScope(String name, String scope) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return memory search response. */ - @Generated @ServiceMethod(returns = ReturnType.SINGLE) - public MemoryStoreSearchResponse searchMemories(String name, String scope, List items, - String previousSearchId, MemorySearchOptions options) { + MemoryStoreSearchResponse _searchMemories(String name, String scope, List items, String previousSearchId, + MemorySearchOptions options) { // Generated convenience method for searchMemoriesWithResponse RequestOptions requestOptions = new RequestOptions(); SearchMemoriesRequest searchMemoriesRequestObj = new SearchMemoriesRequest(scope).setItems(items) @@ -880,6 +838,31 @@ public MemoryStoreSearchResponse searchMemories(String name, String scope, List< .toObject(MemoryStoreSearchResponse.class); } + /** + * Search for relevant memories from a memory store based on conversation context. + * + * @param name The name of the memory store to search. + * @param scope The namespace that logically groups and isolates memories, such as a user ID. + * @param items Items for which to search for relevant memories. + * @param previousSearchId The unique ID of the previous search request, enabling incremental memory search from + * where the last operation left off. + * @param options Memory search options. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return memory search response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MemoryStoreSearchResponse searchMemories(String name, String scope, List items, + String previousSearchId, MemorySearchOptions options) { + // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list + List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson); + return _searchMemories(name, scope, inputItems, previousSearchId, options); + } + /** * Update memory store with conversation memories. * @@ -903,7 +886,7 @@ public MemoryStoreSearchResponse searchMemories(String name, String scope, List< @Generated @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller beginUpdateMemories(String name, - String scope, List items, String previousUpdateId, Integer updateDelay) { + String scope, List items, String previousUpdateId, Integer updateDelay) { // Generated convenience method for beginUpdateMemoriesWithModel RequestOptions requestOptions = new RequestOptions(); UpdateMemoriesRequest updateMemoriesRequestObj = new UpdateMemoriesRequest(scope).setItems(items) @@ -912,4 +895,75 @@ public SyncPoller b BinaryData updateMemoriesRequest = BinaryData.fromObject(updateMemoriesRequestObj); return serviceClient.beginUpdateMemoriesWithModel(name, updateMemoriesRequest, requestOptions); } + + /** + * Update memory store with conversation memories. + * + * @param name The name of the memory store to update. + * @param scope The namespace that logically groups and isolates memories, such as a user ID. + * @param items Conversation items from which to extract memories (OpenAI SDK type). + * @param previousUpdateId The unique ID of the previous update request, enabling incremental memory updates from + * where the last operation left off. + * @param updateDelay Timeout period before processing the memory update in seconds. + * If a new update request is received during this period, it will cancel the current request and reset the timeout. + * Set to 0 to immediately trigger the update without delay. + * Defaults to 300 (5 minutes). + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of provides the status of a memory store update operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginUpdateMemories(String name, + String scope, List items, String previousUpdateId, int updateDelay) { + // Convert OpenAI ResponseInputItem list to Azure SDK InputItem list + List inputItems = OpenAIJsonHelper.toAzureTypeList(items, InputItem::fromJson); + return beginUpdateMemories(name, scope, inputItems, previousUpdateId, updateDelay); + } + + /** + * List all memory stores. + * + * @param limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 20. + * @param order Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and`desc` + * for descending order. + * @param after A cursor for use in pagination. `after` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include after=obj_foo in order to fetch the next page of the list. + * @param before A cursor for use in pagination. `before` is an object ID that defines your place in the list. + * For instance, if you make a list request and receive 100 objects, ending with obj_foo, your + * subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response data for a requested list of items as paginated response with {@link PagedIterable}. + */ + @Generated + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMemoryStores(Integer limit, PageOrder order, String after, + String before) { + // Generated convenience method for listMemoryStores + RequestOptions requestOptions = new RequestOptions(); + if (limit != null) { + requestOptions.addQueryParam("limit", String.valueOf(limit), false); + } + if (order != null) { + requestOptions.addQueryParam("order", order.toString(), false); + } + if (after != null) { + requestOptions.addQueryParam("after", after, false); + } + if (before != null) { + requestOptions.addQueryParam("before", before, false); + } + return serviceClient.listMemoryStores(requestOptions) + .mapPage(bodyItemValue -> bodyItemValue.toObject(MemoryStoreDetails.class)); + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/AgentsImpl.java index 8b378141f73b..ef632a9fea54 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 @@ -343,6 +343,26 @@ Mono> listAgentVersions(@HostParam("endpoint") String endpo Response listAgentVersionsSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName, @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); + + @Post("/agents/{agent_name}/versions/{agent_version}/containers/default:logstream") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> streamAgentContainerLogs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName, + @PathParam("agent_version") String agentVersion, RequestOptions requestOptions, Context context); + + @Post("/agents/{agent_name}/versions/{agent_version}/containers/default:logstream") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response streamAgentContainerLogsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("agent_name") String agentName, + @PathParam("agent_version") String agentVersion, RequestOptions requestOptions, Context context); } /** @@ -1999,6 +2019,106 @@ public PagedIterable listAgentVersions(String agentName, RequestOpti return new PagedIterable<>(() -> listAgentVersionsSinglePage(agentName, requestOptions)); } + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoconsole returns container stdout/stderr, system returns container + * app event stream. defaults to console. Allowed values: "console", "system".
replica_nameStringNoWhen omitted, the server chooses the first replica for + * console logs. Required to target a specific replica.
tailIntegerNoNumber of trailing lines returned. Enforced to 1-300. Defaults to + * 20
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param agentName The name of the agent. + * @param agentVersion The version 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> streamAgentContainerLogsWithResponseAsync(String agentName, String agentVersion, + RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.streamAgentContainerLogs(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), agentName, agentVersion, requestOptions, context)); + } + + /** + * Container log entry streamed from the container as text chunks. + * Each chunk is a UTF-8 string that may be either a plain text log line + * or a JSON-formatted log entry, depending on the type of container log being streamed. + * Clients should treat each chunk as opaque text and, if needed, attempt + * to parse it as JSON based on their logging requirements. + * + * For system logs, the format is JSON with the following structure: + * {"TimeStamp":"2025-12-15T16:51:33Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Connecting + * to the events collector...","Reason":"StartingGettingEvents","EventSource":"ContainerAppController","Count":1} + * {"TimeStamp":"2025-12-15T16:51:34Z","Type":"Normal","ContainerAppName":null,"RevisionName":null,"ReplicaName":null,"Msg":"Successfully + * connected to events server","Reason":"ConnectedToEventsServer","EventSource":"ContainerAppController","Count":1} + * + * For console logs, the format is plain text as emitted by the container's stdout/stderr. + * 2025-12-15T08:43:48.72656 Connecting to the container 'agent-container'... + * 2025-12-15T08:43:48.75451 Successfully Connected to container: 'agent-container' [Revision: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b', Replica: + * 'je90fe655aa742ef9a188b9fd14d6764--7tca06b-6898b9c89f-mpkjc'] + * 2025-12-15T08:33:59.0671054Z stdout F INFO: 127.0.0.1:42588 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:29.0649033Z stdout F INFO: 127.0.0.1:60246 - "GET /readiness HTTP/1.1" 200 OK + * 2025-12-15T08:34:59.0644467Z stdout F INFO: 127.0.0.1:43994 - "GET /readiness HTTP/1.1" 200 OK. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
kindStringNoconsole returns container stdout/stderr, system returns container + * app event stream. defaults to console. Allowed values: "console", "system".
replica_nameStringNoWhen omitted, the server chooses the first replica for + * console logs. Required to target a specific replica.
tailIntegerNoNumber of trailing lines returned. Enforced to 1-300. Defaults to + * 20
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + * + * @param agentName The name of the agent. + * @param agentVersion The version 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 {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response streamAgentContainerLogsWithResponse(String agentName, String agentVersion, + RequestOptions requestOptions) { + return service.streamAgentContainerLogsSync(this.client.getEndpoint(), + this.client.getServiceVersion().getVersion(), agentName, agentVersion, 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/MemoryStoresImpl.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/MemoryStoresImpl.java index ae1176073eaf..7be7b2f3467c 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 @@ -888,7 +888,7 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOp * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_search_id: String (Optional) @@ -918,15 +918,15 @@ public Response deleteMemoryStoreWithResponse(String name, RequestOp * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * } @@ -961,7 +961,7 @@ public Mono> searchMemoriesWithResponseAsync(String name, B * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_search_id: String (Optional) @@ -991,15 +991,15 @@ public Mono> searchMemoriesWithResponseAsync(String name, B * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * } @@ -1033,7 +1033,7 @@ public Response searchMemoriesWithResponse(String name, BinaryData s * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -1065,15 +1065,15 @@ public Response searchMemoriesWithResponse(String name, BinaryData s * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1125,7 +1125,7 @@ private Mono> updateMemoriesWithResponseAsync(String name, * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -1157,15 +1157,15 @@ private Mono> updateMemoriesWithResponseAsync(String name, * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1215,7 +1215,7 @@ private Response updateMemoriesWithResponse(String name, BinaryData * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -1247,15 +1247,15 @@ private Response updateMemoriesWithResponse(String name, BinaryData * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1313,7 +1313,7 @@ public PollerFlux b * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -1345,15 +1345,15 @@ public PollerFlux b * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1411,7 +1411,7 @@ public PollerFlux b * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -1443,15 +1443,15 @@ public PollerFlux b * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1508,7 +1508,7 @@ public PollerFlux beginUpdateMemoriesAsync(String name, * scope: String (Required) * items (Optional): [ * (Optional){ - * type: String(message/file_search_call/function_call/function_call_output/computer_call/computer_call_output/web_search_call/reasoning/item_reference/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/structured_outputs/workflow_action/memory_search_call/oauth_consent_request) (Required) + * type: String(message/output_message/file_search_call/computer_call/computer_call_output/web_search_call/function_call/function_call_output/reasoning/compaction/image_generation_call/code_interpreter_call/local_shell_call/local_shell_call_output/shell_call/shell_call_output/apply_patch_call/apply_patch_call_output/mcp_list_tools/mcp_approval_request/mcp_approval_response/mcp_call/custom_tool_call_output/custom_tool_call/item_reference) (Required) * } * ] * previous_update_id: String (Optional) @@ -1540,15 +1540,15 @@ public PollerFlux beginUpdateMemoriesAsync(String name, * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1620,15 +1620,15 @@ public SyncPoller beginUpdateMemories(String name, Binar * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { @@ -1692,15 +1692,15 @@ public Mono> getUpdateResultWithResponseAsync(String name, * ] * usage (Required): { * embedding_tokens: int (Required) - * input_tokens: int (Required) + * input_tokens: long (Required) * input_tokens_details (Required): { - * cached_tokens: int (Required) + * cached_tokens: long (Required) * } - * output_tokens: int (Required) + * output_tokens: long (Required) * output_tokens_details (Required): { - * reasoning_tokens: int (Required) + * reasoning_tokens: long (Required) * } - * total_tokens: int (Required) + * total_tokens: long (Required) * } * } * error (Optional): { 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 31f05f58e948..6e5c63e7f83d 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 @@ -3,13 +3,21 @@ package com.azure.ai.agents.implementation; +import com.azure.json.JsonProviders; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.openai.core.JsonValue; import com.openai.core.ObjectMappers; +import java.io.IOException; +import java.io.StringReader; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public final class OpenAIJsonHelper { @@ -21,8 +29,67 @@ public final class OpenAIJsonHelper { .configure(MapperFeature.AUTO_DETECT_SETTERS, true) .build(); + /** + * Functional interface for deserializing JSON to an Azure SDK type. + * This is needed because {@link JsonSerializable#fromJson(JsonReader)} is static + * and cannot be called via generics. + * + * @param The target Azure SDK type. + */ + @FunctionalInterface + public interface JsonDeserializer { + T deserialize(JsonReader reader) throws IOException; + } + public static JsonValue toJsonValue(T obj) { return JsonValue.from(MAPPER.convertValue(obj, new TypeReference>() { })); } + + /** + * Converts an OpenAI SDK type to an Azure SDK type that implements {@link JsonSerializable}. + * This method serializes the OpenAI type to JSON and then deserializes it as the Azure SDK type, + * leveraging the fact that both types share the same JSON schema. + * + * @param The source OpenAI SDK type. + * @param The target Azure SDK type that implements {@link JsonSerializable}. + * @param openAIObject The OpenAI SDK object to convert. + * @param fromJson The deserializer function, typically a method reference to the static fromJson method + * (e.g., {@code InputItem::fromJson}). + * @return The equivalent Azure SDK object, or null if the input is null. + * @throws RuntimeException if the conversion fails due to serialization/deserialization errors. + */ + public static > T toAzureType(S openAIObject, JsonDeserializer fromJson) { + if (openAIObject == null) { + return null; + } + try { + String json = MAPPER.writeValueAsString(openAIObject); + try (JsonReader jsonReader = JsonProviders.createReader(new StringReader(json))) { + return fromJson.deserialize(jsonReader); + } + } catch (JsonProcessingException e) { + throw new RuntimeException("Failed to serialize OpenAI type to JSON", e); + } catch (IOException e) { + throw new RuntimeException("Failed to deserialize JSON to Azure SDK type", e); + } + } + + /** + * Converts a list of OpenAI SDK types to a list of Azure SDK types. + * + * @param The source OpenAI SDK type. + * @param The target Azure SDK type that implements {@link JsonSerializable}. + * @param openAIObjects The list of OpenAI SDK objects to convert. + * @param fromJson The deserializer function, typically a method reference to the static fromJson method + * (e.g., {@code InputItem::fromJson}). + * @return The equivalent list of Azure SDK objects, or null if the input is null. + */ + public static > List toAzureTypeList(List openAIObjects, + JsonDeserializer fromJson) { + if (openAIObjects == null) { + return null; + } + return openAIObjects.stream().map(obj -> toAzureType(obj, fromJson)).collect(Collectors.toList()); + } } 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 new file mode 100644 index 000000000000..faad28cfb938 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessage.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.implementation.models; + +import com.azure.ai.agents.models.InputItem; +import com.azure.ai.agents.models.InputItemType; +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/models/ResponsesMessageRole.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java similarity index 60% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesMessageRole.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java index a72977368806..2f052ab8a2f8 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesMessageRole.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageRole.java @@ -2,53 +2,53 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.ai.agents.models; +package com.azure.ai.agents.implementation.models; /** - * The collection of valid roles for responses message items. + * Defines values for EasyInputMessageRole. */ -public enum ResponsesMessageRole { +public enum EasyInputMessageRole { /** - * Enum value system. + * Enum value user. */ - SYSTEM("system"), + USER("user"), /** - * Enum value developer. + * Enum value assistant. */ - DEVELOPER("developer"), + ASSISTANT("assistant"), /** - * Enum value user. + * Enum value system. */ - USER("user"), + SYSTEM("system"), /** - * Enum value assistant. + * Enum value developer. */ - ASSISTANT("assistant"); + DEVELOPER("developer"); /** - * The actual serialized value for a ResponsesMessageRole instance. + * The actual serialized value for a EasyInputMessageRole instance. */ private final String value; - ResponsesMessageRole(String value) { + EasyInputMessageRole(String value) { this.value = value; } /** - * Parses a serialized value to a ResponsesMessageRole instance. + * Parses a serialized value to a EasyInputMessageRole instance. * * @param value the serialized value to parse. - * @return the parsed ResponsesMessageRole object, or null if unable to parse. + * @return the parsed EasyInputMessageRole object, or null if unable to parse. */ - public static ResponsesMessageRole fromString(String value) { + public static EasyInputMessageRole fromString(String value) { if (value == null) { return null; } - ResponsesMessageRole[] items = ResponsesMessageRole.values(); - for (ResponsesMessageRole item : items) { + EasyInputMessageRole[] items = EasyInputMessageRole.values(); + for (EasyInputMessageRole item : items) { if (item.toString().equalsIgnoreCase(value)) { return item; } 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 new file mode 100644 index 000000000000..59fc1a7846a1 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/EasyInputMessageStatus.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; + +/** + * 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/models/ItemReferenceItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java similarity index 63% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemReferenceItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java index 04fa240ebc1e..4b5f73c6406e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemReferenceItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/ItemReferenceParam.java @@ -1,8 +1,10 @@ // 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; +package com.azure.ai.agents.implementation.models; +import com.azure.ai.agents.models.InputItem; +import com.azure.ai.agents.models.InputItemType; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -11,30 +13,32 @@ import java.io.IOException; /** + * Item reference + * * An internal identifier for an item to reference. */ @Immutable -public final class ItemReferenceItemParam extends ItemParam { +public final class ItemReferenceParam extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.ITEM_REFERENCE; + private InputItemType type = InputItemType.ITEM_REFERENCE; /* - * The service-originated ID of the previously generated response item being referenced. + * The ID of the item to reference. */ @Generated private final String id; /** - * Creates an instance of ItemReferenceItemParam class. + * Creates an instance of ItemReferenceParam class. * * @param id the id value to set. */ @Generated - public ItemReferenceItemParam(String id) { + public ItemReferenceParam(String id) { this.id = id; } @@ -45,12 +49,12 @@ public ItemReferenceItemParam(String id) { */ @Generated @Override - public ItemType getType() { + public InputItemType getType() { return this.type; } /** - * Get the id property: The service-originated ID of the previously generated response item being referenced. + * Get the id property: The ID of the item to reference. * * @return the id value. */ @@ -72,33 +76,33 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ItemReferenceItemParam from the JsonReader. + * Reads an instance of ItemReferenceParam from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemReferenceItemParam if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @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 ItemReferenceItemParam. + * @throws IOException If an error occurs while reading the ItemReferenceParam. */ @Generated - public static ItemReferenceItemParam fromJson(JsonReader jsonReader) throws IOException { + public static ItemReferenceParam fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String id = null; - ItemType type = ItemType.ITEM_REFERENCE; + 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 = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ItemReferenceItemParam deserializedItemReferenceItemParam = new ItemReferenceItemParam(id); - deserializedItemReferenceItemParam.type = type; - return deserializedItemReferenceItemParam; + 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/SearchMemoriesRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java index cd4c8633e58e..fda62db2c40d 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.implementation.models; -import com.azure.ai.agents.models.ItemParam; +import com.azure.ai.agents.models.InputItem; import com.azure.ai.agents.models.MemorySearchOptions; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; @@ -30,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 @@ -71,7 +71,7 @@ public String getScope() { * @return the items value. */ @Generated - public List getItems() { + public List getItems() { return this.items; } @@ -82,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; } @@ -160,7 +160,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) { @@ -169,7 +169,7 @@ public static SearchMemoriesRequest fromJson(JsonReader jsonReader) throws IOExc if ("scope".equals(fieldName)) { scope = reader.getString(); } else if ("items".equals(fieldName)) { - items = reader.readArray(reader1 -> ItemParam.fromJson(reader1)); + items = reader.readArray(reader1 -> InputItem.fromJson(reader1)); } 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/UpdateMemoriesRequest.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/models/UpdateMemoriesRequest.java index d66116097850..b645808e2b86 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 @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.implementation.models; -import com.azure.ai.agents.models.ItemParam; +import com.azure.ai.agents.models.InputItem; import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.json.JsonReader; @@ -29,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 @@ -73,7 +73,7 @@ public String getScope() { * @return the items value. */ @Generated - public List getItems() { + public List getItems() { return this.items; } @@ -84,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; } @@ -168,7 +168,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) { @@ -177,7 +177,7 @@ public static UpdateMemoriesRequest fromJson(JsonReader jsonReader) throws IOExc if ("scope".equals(fieldName)) { scope = reader.getString(); } else if ("items".equals(fieldName)) { - items = reader.readArray(reader1 -> ItemParam.fromJson(reader1)); + items = reader.readArray(reader1 -> InputItem.fromJson(reader1)); } 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/models/A2ATool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java similarity index 77% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2ATool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java index 333e8c890f1b..0d87544cb110 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2ATool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/A2APreviewTool.java @@ -14,7 +14,7 @@ * An agent implementing the A2A protocol. */ @Fluent -public final class A2ATool extends Tool { +public final class A2APreviewTool extends Tool { /* * The type property. @@ -43,10 +43,10 @@ public final class A2ATool extends Tool { private String projectConnectionId; /** - * Creates an instance of A2ATool class. + * Creates an instance of A2APreviewTool class. */ @Generated - public A2ATool() { + public A2APreviewTool() { } /** @@ -74,10 +74,10 @@ public String getBaseUrl() { * Set the baseUrl property: Base URL of the agent. * * @param baseUrl the baseUrl value to set. - * @return the A2ATool object itself. + * @return the A2APreviewTool object itself. */ @Generated - public A2ATool setBaseUrl(String baseUrl) { + public A2APreviewTool setBaseUrl(String baseUrl) { this.baseUrl = baseUrl; return this; } @@ -98,10 +98,10 @@ public String getAgentCardPath() { * If not provided, defaults to `/.well-known/agent-card.json`. * * @param agentCardPath the agentCardPath value to set. - * @return the A2ATool object itself. + * @return the A2APreviewTool object itself. */ @Generated - public A2ATool setAgentCardPath(String agentCardPath) { + public A2APreviewTool setAgentCardPath(String agentCardPath) { this.agentCardPath = agentCardPath; return this; } @@ -122,10 +122,10 @@ public String getProjectConnectionId() { * The connection stores authentication and other connection details needed to connect to the A2A server. * * @param projectConnectionId the projectConnectionId value to set. - * @return the A2ATool object itself. + * @return the A2APreviewTool object itself. */ @Generated - public A2ATool setProjectConnectionId(String projectConnectionId) { + public A2APreviewTool setProjectConnectionId(String projectConnectionId) { this.projectConnectionId = projectConnectionId; return this; } @@ -145,33 +145,33 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of A2ATool from the JsonReader. + * Reads an instance of A2APreviewTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of A2ATool 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 A2ATool. + * @return An instance of A2APreviewTool 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 A2APreviewTool. */ @Generated - public static A2ATool fromJson(JsonReader jsonReader) throws IOException { + public static A2APreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - A2ATool deserializedA2ATool = new A2ATool(); + A2APreviewTool deserializedA2APreviewTool = new A2APreviewTool(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedA2ATool.type = ToolType.fromString(reader.getString()); + deserializedA2APreviewTool.type = ToolType.fromString(reader.getString()); } else if ("base_url".equals(fieldName)) { - deserializedA2ATool.baseUrl = reader.getString(); + deserializedA2APreviewTool.baseUrl = reader.getString(); } else if ("agent_card_path".equals(fieldName)) { - deserializedA2ATool.agentCardPath = reader.getString(); + deserializedA2APreviewTool.agentCardPath = reader.getString(); } else if ("project_connection_id".equals(fieldName)) { - deserializedA2ATool.projectConnectionId = reader.getString(); + deserializedA2APreviewTool.projectConnectionId = reader.getString(); } else { reader.skipChildren(); } } - return deserializedA2ATool; + return deserializedA2APreviewTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Annotation.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Annotation.java index 84363ef938f1..00f96af8ce9b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Annotation.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Annotation.java @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The Annotation model. + * An annotation that applies to a span of output text. */ @Immutable public class Annotation implements JsonSerializable { @@ -78,11 +78,13 @@ 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 AnnotationFileCitation.fromJson(readerToUse.reset()); + return FileCitationBody.fromJson(readerToUse.reset()); } else if ("url_citation".equals(discriminatorValue)) { - return AnnotationUrlCitation.fromJson(readerToUse.reset()); + return UrlCitationBody.fromJson(readerToUse.reset()); + } else if ("container_file_citation".equals(discriminatorValue)) { + return ContainerFileCitationBody.fromJson(readerToUse.reset()); } else if ("file_path".equals(discriminatorValue)) { - return AnnotationFilePath.fromJson(readerToUse.reset()); + return FilePath.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCallOutputStatusParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCallOutputStatusParam.java new file mode 100644 index 000000000000..572bc9fc7499 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCallOutputStatusParam.java @@ -0,0 +1,58 @@ +// 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; + +/** + * 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/models/CodeInterpreterOutputType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCallStatusParam.java similarity index 52% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputType.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCallStatusParam.java index da0b852bd5fa..feedf0b83c44 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputType.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCallStatusParam.java @@ -5,40 +5,42 @@ package com.azure.ai.agents.models; /** - * Defines values for CodeInterpreterOutputType. + * Apply patch call status + * + * Status values reported for apply_patch tool calls. */ -public enum CodeInterpreterOutputType { +public enum ApplyPatchCallStatusParam { /** - * Enum value logs. + * Enum value in_progress. */ - LOGS("logs"), + IN_PROGRESS("in_progress"), /** - * Enum value image. + * Enum value completed. */ - IMAGE("image"); + COMPLETED("completed"); /** - * The actual serialized value for a CodeInterpreterOutputType instance. + * The actual serialized value for a ApplyPatchCallStatusParam instance. */ private final String value; - CodeInterpreterOutputType(String value) { + ApplyPatchCallStatusParam(String value) { this.value = value; } /** - * Parses a serialized value to a CodeInterpreterOutputType instance. + * Parses a serialized value to a ApplyPatchCallStatusParam instance. * * @param value the serialized value to parse. - * @return the parsed CodeInterpreterOutputType object, or null if unable to parse. + * @return the parsed ApplyPatchCallStatusParam object, or null if unable to parse. */ - public static CodeInterpreterOutputType fromString(String value) { + public static ApplyPatchCallStatusParam fromString(String value) { if (value == null) { return null; } - CodeInterpreterOutputType[] items = CodeInterpreterOutputType.values(); - for (CodeInterpreterOutputType item : items) { + ApplyPatchCallStatusParam[] items = ApplyPatchCallStatusParam.values(); + for (ApplyPatchCallStatusParam 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/ApplyPatchCreateFileOperationParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCreateFileOperationParam.java new file mode 100644 index 000000000000..56d4b37476d4 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchCreateFileOperationParam.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.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/models/ApplyPatchDeleteFileOperationParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchDeleteFileOperationParam.java new file mode 100644 index 000000000000..3d4ec13da793 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchDeleteFileOperationParam.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.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; + +/** + * Apply patch delete file operation + * + * Instruction for deleting an existing file via the apply_patch tool. + */ +@Immutable +public final class ApplyPatchDeleteFileOperationParam extends ApplyPatchOperationParam { + + /* + * The type property. + */ + @Generated + private ApplyPatchOperationParamType type = ApplyPatchOperationParamType.DELETE_FILE; + + /* + * Path of the file to delete relative to the workspace root. + */ + @Generated + private final String path; + + /** + * Creates an instance of ApplyPatchDeleteFileOperationParam class. + * + * @param path the path value to set. + */ + @Generated + public ApplyPatchDeleteFileOperationParam(String path) { + this.path = path; + } + + /** + * 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 delete relative to the workspace root. + * + * @return the path value. + */ + @Generated + public String getPath() { + return this.path; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ApplyPatchDeleteFileOperationParam 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. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ApplyPatchDeleteFileOperationParam. + */ + @Generated + public static ApplyPatchDeleteFileOperationParam fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String path = null; + ApplyPatchOperationParamType type = ApplyPatchOperationParamType.DELETE_FILE; + 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()); + } else { + reader.skipChildren(); + } + } + ApplyPatchDeleteFileOperationParam deserializedApplyPatchDeleteFileOperationParam + = new ApplyPatchDeleteFileOperationParam(path); + deserializedApplyPatchDeleteFileOperationParam.type = type; + return deserializedApplyPatchDeleteFileOperationParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParam.java similarity index 59% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutput.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParam.java index a618b078e107..9e964801cde2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParam.java @@ -12,23 +12,24 @@ import java.io.IOException; /** - * The ComputerToolCallOutputItemOutput model. + * Apply patch operation + * + * One of the create_file, delete_file, or update_file operations supplied to the apply_patch tool. */ @Immutable -public class ComputerToolCallOutputItemOutput implements JsonSerializable { +public class ApplyPatchOperationParam implements JsonSerializable { /* * The type property. */ @Generated - private ComputerToolCallOutputItemOutputType type - = ComputerToolCallOutputItemOutputType.fromString("ComputerToolCallOutputItemOutput"); + private ApplyPatchOperationParamType type = ApplyPatchOperationParamType.fromString("ApplyPatchOperationParam"); /** - * Creates an instance of ComputerToolCallOutputItemOutput class. + * Creates an instance of ApplyPatchOperationParam class. */ @Generated - public ComputerToolCallOutputItemOutput() { + public ApplyPatchOperationParam() { } /** @@ -37,7 +38,7 @@ public ComputerToolCallOutputItemOutput() { * @return the type value. */ @Generated - public ComputerToolCallOutputItemOutputType getType() { + public ApplyPatchOperationParamType getType() { return this.type; } @@ -53,15 +54,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ComputerToolCallOutputItemOutput from the JsonReader. + * Reads an instance of ApplyPatchOperationParam from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerToolCallOutputItemOutput 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 ComputerToolCallOutputItemOutput. + * @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. */ @Generated - public static ComputerToolCallOutputItemOutput fromJson(JsonReader jsonReader) throws IOException { + public static ApplyPatchOperationParam fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -78,8 +79,12 @@ public static ComputerToolCallOutputItemOutput fromJson(JsonReader jsonReader) t } } // Use the discriminator value to determine which subtype should be deserialized. - if ("computer_screenshot".equals(discriminatorValue)) { - return ComputerToolCallOutputItemOutputComputerScreenshot.fromJson(readerToUse.reset()); + 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()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -88,21 +93,20 @@ public static ComputerToolCallOutputItemOutput fromJson(JsonReader jsonReader) t } @Generated - static ComputerToolCallOutputItemOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static ApplyPatchOperationParam fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ComputerToolCallOutputItemOutput deserializedComputerToolCallOutputItemOutput - = new ComputerToolCallOutputItemOutput(); + ApplyPatchOperationParam deserializedApplyPatchOperationParam = new ApplyPatchOperationParam(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedComputerToolCallOutputItemOutput.type - = ComputerToolCallOutputItemOutputType.fromString(reader.getString()); + deserializedApplyPatchOperationParam.type + = ApplyPatchOperationParamType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedComputerToolCallOutputItemOutput; + return deserializedApplyPatchOperationParam; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParamType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParamType.java new file mode 100644 index 000000000000..e07a9a04b9c5 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParamType.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; + +/** + * 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/models/ResponseTextFormatConfigurationText.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParam.java similarity index 55% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationText.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParam.java index 4f7fb49232f2..3732b76933d1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationText.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchToolParam.java @@ -11,22 +11,24 @@ import java.io.IOException; /** - * The ResponseTextFormatConfigurationText model. + * Apply patch tool + * + * Allows the assistant to create, delete, or update files using unified diffs. */ @Immutable -public final class ResponseTextFormatConfigurationText extends ResponseTextFormatConfiguration { +public final class ApplyPatchToolParam extends Tool { /* * The type property. */ @Generated - private ResponseTextFormatConfigurationType type = ResponseTextFormatConfigurationType.TEXT; + private ToolType type = ToolType.APPLY_PATCH; /** - * Creates an instance of ResponseTextFormatConfigurationText class. + * Creates an instance of ApplyPatchToolParam class. */ @Generated - public ResponseTextFormatConfigurationText() { + public ApplyPatchToolParam() { } /** @@ -36,7 +38,7 @@ public ResponseTextFormatConfigurationText() { */ @Generated @Override - public ResponseTextFormatConfigurationType getType() { + public ToolType getType() { return this.type; } @@ -52,29 +54,27 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResponseTextFormatConfigurationText from the JsonReader. + * Reads an instance of ApplyPatchToolParam from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResponseTextFormatConfigurationText 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 ResponseTextFormatConfigurationText. + * @return An instance of ApplyPatchToolParam 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 ApplyPatchToolParam. */ @Generated - public static ResponseTextFormatConfigurationText fromJson(JsonReader jsonReader) throws IOException { + public static ApplyPatchToolParam fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ResponseTextFormatConfigurationText deserializedResponseTextFormatConfigurationText - = new ResponseTextFormatConfigurationText(); + ApplyPatchToolParam deserializedApplyPatchToolParam = new ApplyPatchToolParam(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedResponseTextFormatConfigurationText.type - = ResponseTextFormatConfigurationType.fromString(reader.getString()); + deserializedApplyPatchToolParam.type = ToolType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedResponseTextFormatConfigurationText; + return deserializedApplyPatchToolParam; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchUpdateFileOperationParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchUpdateFileOperationParam.java new file mode 100644 index 000000000000..ffe1cae9e618 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApplyPatchUpdateFileOperationParam.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.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/models/ApproximateLocation.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApproximateLocation.java index 2543930f2cb2..2c258f414eaa 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApproximateLocation.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ApproximateLocation.java @@ -6,6 +6,7 @@ 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; @@ -14,13 +15,13 @@ * The ApproximateLocation model. */ @Fluent -public final class ApproximateLocation extends Location { +public final class ApproximateLocation implements JsonSerializable { /* - * The type property. + * The type of location approximation. Always `approximate`. */ @Generated - private LocationType type = LocationType.APPROXIMATE; + private final String type = "approximate"; /* * The country property. @@ -54,13 +55,12 @@ public ApproximateLocation() { } /** - * Get the type property: The type property. + * Get the type property: The type of location approximation. Always `approximate`. * * @return the type value. */ @Generated - @Override - public LocationType getType() { + public String getType() { return this.type; } @@ -159,7 +159,7 @@ public ApproximateLocation setTimezone(String timezone) { @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); jsonWriter.writeStringField("country", this.country); jsonWriter.writeStringField("region", this.region); jsonWriter.writeStringField("city", this.city); @@ -173,6 +173,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ApproximateLocation 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 ApproximateLocation. */ @Generated @@ -182,9 +183,7 @@ public static ApproximateLocation fromJson(JsonReader jsonReader) throws IOExcep while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedApproximateLocation.type = LocationType.fromString(reader.getString()); - } else if ("country".equals(fieldName)) { + if ("country".equals(fieldName)) { deserializedApproximateLocation.country = reader.getString(); } else if ("region".equals(fieldName)) { deserializedApproximateLocation.region = reader.getString(); diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java similarity index 78% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java index 0e37ecf8c119..19435e12d288 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureAISearchTool.java @@ -14,7 +14,7 @@ * The input definition information for an Azure AI search tool as used to configure an agent. */ @Immutable -public final class AzureAISearchAgentTool extends Tool { +public final class AzureAISearchTool extends Tool { /* * The type property. @@ -22,13 +22,19 @@ public final class AzureAISearchAgentTool extends Tool { @Generated private ToolType type = ToolType.AZURE_AI_SEARCH; + /* + * The azure ai search index resource. + */ + @Generated + private final AzureAISearchToolResource azureAISearch; + /** - * Creates an instance of AzureAISearchAgentTool class. + * Creates an instance of AzureAISearchTool class. * * @param azureAISearch the azureAISearch value to set. */ @Generated - public AzureAISearchAgentTool(AzureAISearchToolResource azureAISearch) { + public AzureAISearchTool(AzureAISearchToolResource azureAISearch) { this.azureAISearch = azureAISearch; } @@ -43,6 +49,16 @@ public ToolType getType() { return this.type; } + /** + * Get the azureAISearch property: The azure ai search index resource. + * + * @return the azureAISearch value. + */ + @Generated + public AzureAISearchToolResource getAzureAISearch() { + return this.azureAISearch; + } + /** * {@inheritDoc} */ @@ -56,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AzureAISearchAgentTool from the JsonReader. + * Reads an instance of AzureAISearchTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AzureAISearchAgentTool if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of AzureAISearchTool 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 AzureAISearchAgentTool. + * @throws IOException If an error occurs while reading the AzureAISearchTool. */ @Generated - public static AzureAISearchAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static AzureAISearchTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { AzureAISearchToolResource azureAISearch = null; ToolType type = ToolType.AZURE_AI_SEARCH; @@ -80,25 +96,9 @@ public static AzureAISearchAgentTool fromJson(JsonReader jsonReader) throws IOEx reader.skipChildren(); } } - AzureAISearchAgentTool deserializedAzureAISearchAgentTool = new AzureAISearchAgentTool(azureAISearch); - deserializedAzureAISearchAgentTool.type = type; - return deserializedAzureAISearchAgentTool; + AzureAISearchTool deserializedAzureAISearchTool = new AzureAISearchTool(azureAISearch); + deserializedAzureAISearchTool.type = type; + return deserializedAzureAISearchTool; }); } - - /* - * The azure ai search index resource. - */ - @Generated - private final AzureAISearchToolResource azureAISearch; - - /** - * Get the azureAISearch property: The azure ai search index resource. - * - * @return the azureAISearch value. - */ - @Generated - public AzureAISearchToolResource getAzureAISearch() { - return this.azureAISearch; - } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java similarity index 78% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java index 20068df4b37c..30b2d0f8b489 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AzureFunctionTool.java @@ -14,7 +14,7 @@ * The input definition information for an Azure Function Tool, as used to configure an Agent. */ @Immutable -public final class AzureFunctionAgentTool extends Tool { +public final class AzureFunctionTool extends Tool { /* * The type property. @@ -29,12 +29,12 @@ public final class AzureFunctionAgentTool extends Tool { private final AzureFunctionDefinition azureFunction; /** - * Creates an instance of AzureFunctionAgentTool class. + * Creates an instance of AzureFunctionTool class. * * @param azureFunction the azureFunction value to set. */ @Generated - public AzureFunctionAgentTool(AzureFunctionDefinition azureFunction) { + public AzureFunctionTool(AzureFunctionDefinition azureFunction) { this.azureFunction = azureFunction; } @@ -72,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of AzureFunctionAgentTool from the JsonReader. + * Reads an instance of AzureFunctionTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AzureFunctionAgentTool if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of AzureFunctionTool 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 AzureFunctionAgentTool. + * @throws IOException If an error occurs while reading the AzureFunctionTool. */ @Generated - public static AzureFunctionAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static AzureFunctionTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { AzureFunctionDefinition azureFunction = null; ToolType type = ToolType.AZURE_FUNCTION; @@ -96,9 +96,9 @@ public static AzureFunctionAgentTool fromJson(JsonReader jsonReader) throws IOEx reader.skipChildren(); } } - AzureFunctionAgentTool deserializedAzureFunctionAgentTool = new AzureFunctionAgentTool(azureFunction); - deserializedAzureFunctionAgentTool.type = type; - return deserializedAzureFunctionAgentTool; + AzureFunctionTool deserializedAzureFunctionTool = new AzureFunctionTool(azureFunction); + deserializedAzureFunctionTool.type = type; + return deserializedAzureFunctionTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java similarity index 77% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java index bddb074548e3..624f62aa3864 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingCustomSearchPreviewTool.java @@ -14,7 +14,7 @@ * The input definition information for a Bing custom search tool as used to configure an agent. */ @Immutable -public final class BingCustomSearchAgentTool extends Tool { +public final class BingCustomSearchPreviewTool extends Tool { /* * The type property. @@ -29,12 +29,12 @@ public final class BingCustomSearchAgentTool extends Tool { private final BingCustomSearchToolParameters bingCustomSearchPreview; /** - * Creates an instance of BingCustomSearchAgentTool class. + * Creates an instance of BingCustomSearchPreviewTool class. * * @param bingCustomSearchPreview the bingCustomSearchPreview value to set. */ @Generated - public BingCustomSearchAgentTool(BingCustomSearchToolParameters bingCustomSearchPreview) { + public BingCustomSearchPreviewTool(BingCustomSearchToolParameters bingCustomSearchPreview) { this.bingCustomSearchPreview = bingCustomSearchPreview; } @@ -72,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of BingCustomSearchAgentTool from the JsonReader. + * Reads an instance of BingCustomSearchPreviewTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of BingCustomSearchAgentTool if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. + * @return An instance of BingCustomSearchPreviewTool 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 BingCustomSearchAgentTool. + * @throws IOException If an error occurs while reading the BingCustomSearchPreviewTool. */ @Generated - public static BingCustomSearchAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static BingCustomSearchPreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { BingCustomSearchToolParameters bingCustomSearchPreview = null; ToolType type = ToolType.BING_CUSTOM_SEARCH_PREVIEW; @@ -96,10 +96,10 @@ public static BingCustomSearchAgentTool fromJson(JsonReader jsonReader) throws I reader.skipChildren(); } } - BingCustomSearchAgentTool deserializedBingCustomSearchAgentTool - = new BingCustomSearchAgentTool(bingCustomSearchPreview); - deserializedBingCustomSearchAgentTool.type = type; - return deserializedBingCustomSearchAgentTool; + BingCustomSearchPreviewTool deserializedBingCustomSearchPreviewTool + = new BingCustomSearchPreviewTool(bingCustomSearchPreview); + deserializedBingCustomSearchPreviewTool.type = type; + return deserializedBingCustomSearchPreviewTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java similarity index 78% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java index 7d8312ee0d36..aa18a2a874c4 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BingGroundingTool.java @@ -14,7 +14,7 @@ * The input definition information for a bing grounding search tool as used to configure an agent. */ @Immutable -public final class BingGroundingAgentTool extends Tool { +public final class BingGroundingTool extends Tool { /* * The type property. @@ -29,12 +29,12 @@ public final class BingGroundingAgentTool extends Tool { private final BingGroundingSearchToolParameters bingGrounding; /** - * Creates an instance of BingGroundingAgentTool class. + * Creates an instance of BingGroundingTool class. * * @param bingGrounding the bingGrounding value to set. */ @Generated - public BingGroundingAgentTool(BingGroundingSearchToolParameters bingGrounding) { + public BingGroundingTool(BingGroundingSearchToolParameters bingGrounding) { this.bingGrounding = bingGrounding; } @@ -72,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of BingGroundingAgentTool from the JsonReader. + * Reads an instance of BingGroundingTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of BingGroundingAgentTool if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of BingGroundingTool 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 BingGroundingAgentTool. + * @throws IOException If an error occurs while reading the BingGroundingTool. */ @Generated - public static BingGroundingAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static BingGroundingTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { BingGroundingSearchToolParameters bingGrounding = null; ToolType type = ToolType.BING_GROUNDING; @@ -96,9 +96,9 @@ public static BingGroundingAgentTool fromJson(JsonReader jsonReader) throws IOEx reader.skipChildren(); } } - BingGroundingAgentTool deserializedBingGroundingAgentTool = new BingGroundingAgentTool(bingGrounding); - deserializedBingGroundingAgentTool.type = type; - return deserializedBingGroundingAgentTool; + BingGroundingTool deserializedBingGroundingTool = new BingGroundingTool(bingGrounding); + deserializedBingGroundingTool.type = type; + return deserializedBingGroundingTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java similarity index 76% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java index a3b04e7895c6..5e5867c33e7b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/BrowserAutomationPreviewTool.java @@ -14,7 +14,7 @@ * The input definition information for a Browser Automation Tool, as used to configure an Agent. */ @Immutable -public final class BrowserAutomationAgentTool extends Tool { +public final class BrowserAutomationPreviewTool extends Tool { /* * The type property. @@ -29,12 +29,12 @@ public final class BrowserAutomationAgentTool extends Tool { private final BrowserAutomationToolParameters browserAutomationPreview; /** - * Creates an instance of BrowserAutomationAgentTool class. + * Creates an instance of BrowserAutomationPreviewTool class. * * @param browserAutomationPreview the browserAutomationPreview value to set. */ @Generated - public BrowserAutomationAgentTool(BrowserAutomationToolParameters browserAutomationPreview) { + public BrowserAutomationPreviewTool(BrowserAutomationToolParameters browserAutomationPreview) { this.browserAutomationPreview = browserAutomationPreview; } @@ -72,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of BrowserAutomationAgentTool from the JsonReader. + * Reads an instance of BrowserAutomationPreviewTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of BrowserAutomationAgentTool if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. + * @return An instance of BrowserAutomationPreviewTool 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 BrowserAutomationAgentTool. + * @throws IOException If an error occurs while reading the BrowserAutomationPreviewTool. */ @Generated - public static BrowserAutomationAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static BrowserAutomationPreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { BrowserAutomationToolParameters browserAutomationPreview = null; ToolType type = ToolType.BROWSER_AUTOMATION_PREVIEW; @@ -96,10 +96,10 @@ public static BrowserAutomationAgentTool fromJson(JsonReader jsonReader) throws reader.skipChildren(); } } - BrowserAutomationAgentTool deserializedBrowserAutomationAgentTool - = new BrowserAutomationAgentTool(browserAutomationPreview); - deserializedBrowserAutomationAgentTool.type = type; - return deserializedBrowserAutomationAgentTool; + BrowserAutomationPreviewTool deserializedBrowserAutomationPreviewTool + = new BrowserAutomationPreviewTool(browserAutomationPreview); + deserializedBrowserAutomationPreviewTool.type = type; + return deserializedBrowserAutomationPreviewTool; }); } } 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 93360d50d4be..9eafc353a349 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 - public ChatSummaryMemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { + private 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/ComputerActionClickButton.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ClickButtonType.java similarity index 63% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionClickButton.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ClickButtonType.java index 12ecfdad5e8a..75e3a39e95d1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionClickButton.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ClickButtonType.java @@ -5,9 +5,9 @@ package com.azure.ai.agents.models; /** - * Defines values for ComputerActionClickButton. + * Defines values for ClickButtonType. */ -public enum ComputerActionClickButton { +public enum ClickButtonType { /** * Enum value left. */ @@ -34,26 +34,26 @@ public enum ComputerActionClickButton { FORWARD("forward"); /** - * The actual serialized value for a ComputerActionClickButton instance. + * The actual serialized value for a ClickButtonType instance. */ private final String value; - ComputerActionClickButton(String value) { + ClickButtonType(String value) { this.value = value; } /** - * Parses a serialized value to a ComputerActionClickButton instance. + * Parses a serialized value to a ClickButtonType instance. * * @param value the serialized value to parse. - * @return the parsed ComputerActionClickButton object, or null if unable to parse. + * @return the parsed ClickButtonType object, or null if unable to parse. */ - public static ComputerActionClickButton fromString(String value) { + public static ClickButtonType fromString(String value) { if (value == null) { return null; } - ComputerActionClickButton[] items = ComputerActionClickButton.values(); - for (ComputerActionClickButton item : items) { + ClickButtonType[] items = ClickButtonType.values(); + for (ClickButtonType 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/ComputerActionClick.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ClickParam.java similarity index 71% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionClick.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ClickParam.java index e5bac5acc587..0fc92d60f77f 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionClick.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ClickParam.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Click + * * A click action. */ @Immutable -public final class ComputerActionClick extends ComputerAction { +public final class ClickParam extends ComputerAction { /* * The type property. @@ -26,29 +28,29 @@ public final class ComputerActionClick extends ComputerAction { * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. */ @Generated - private final ComputerActionClickButton button; + private final ClickButtonType button; /* * The x-coordinate where the click occurred. */ @Generated - private final int x; + private final long x; /* * The y-coordinate where the click occurred. */ @Generated - private final int y; + private final long y; /** - * Creates an instance of ComputerActionClick class. + * 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 ComputerActionClick(ComputerActionClickButton button, int x, int y) { + public ClickParam(ClickButtonType button, long x, long y) { this.button = button; this.x = x; this.y = y; @@ -72,7 +74,7 @@ public ComputerActionType getType() { * @return the button value. */ @Generated - public ComputerActionClickButton getButton() { + public ClickButtonType getButton() { return this.button; } @@ -82,7 +84,7 @@ public ComputerActionClickButton getButton() { * @return the x value. */ @Generated - public int getX() { + public long getX() { return this.x; } @@ -92,7 +94,7 @@ public int getX() { * @return the y value. */ @Generated - public int getY() { + public long getY() { return this.y; } @@ -104,46 +106,46 @@ public int getY() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("button", this.button == null ? null : this.button.toString()); - jsonWriter.writeIntField("x", this.x); - jsonWriter.writeIntField("y", this.y); + 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 ComputerActionClick from the JsonReader. + * Reads an instance of ClickParam from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionClick if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @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 ComputerActionClick. + * @throws IOException If an error occurs while reading the ClickParam. */ @Generated - public static ComputerActionClick fromJson(JsonReader jsonReader) throws IOException { + public static ClickParam fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ComputerActionClickButton button = null; - int x = 0; - int y = 0; + 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 = ComputerActionClickButton.fromString(reader.getString()); + button = ClickButtonType.fromString(reader.getString()); } else if ("x".equals(fieldName)) { - x = reader.getInt(); + x = reader.getLong(); } else if ("y".equals(fieldName)) { - y = reader.getInt(); + y = reader.getLong(); } else if ("type".equals(fieldName)) { type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ComputerActionClick deserializedComputerActionClick = new ComputerActionClick(button, x, y); - deserializedComputerActionClick.type = type; - return deserializedComputerActionClick; + 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/models/CodeInterpreterToolAuto.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterContainerAuto.java similarity index 55% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolAuto.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterContainerAuto.java index 8070bd2c5472..51c542e2512a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolAuto.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterContainerAuto.java @@ -13,11 +13,12 @@ import java.util.List; /** - * Configuration for a code interpreter container. Optionally specify the IDs - * of the files to run the code on. + * CodeInterpreterToolAuto + * + * Configuration for a code interpreter container. Optionally specify the IDs of the files to run the code on. */ @Fluent -public final class CodeInterpreterToolAuto implements JsonSerializable { +public final class CodeInterpreterContainerAuto implements JsonSerializable { /* * Always `auto`. @@ -31,11 +32,17 @@ public final class CodeInterpreterToolAuto implements JsonSerializable fileIds; + /* + * The memory_limit property. + */ + @Generated + private ContainerMemoryLimit memoryLimit; + /** - * Creates an instance of CodeInterpreterToolAuto class. + * Creates an instance of CodeInterpreterContainerAuto class. */ @Generated - public CodeInterpreterToolAuto() { + public CodeInterpreterContainerAuto() { } /** @@ -62,14 +69,36 @@ public List getFileIds() { * Set the fileIds property: An optional list of uploaded files to make available to your code. * * @param fileIds the fileIds value to set. - * @return the CodeInterpreterToolAuto object itself. + * @return the CodeInterpreterContainerAuto object itself. */ @Generated - public CodeInterpreterToolAuto setFileIds(List fileIds) { + public CodeInterpreterContainerAuto setFileIds(List fileIds) { this.fileIds = fileIds; return this; } + /** + * Get the memoryLimit property: The memory_limit property. + * + * @return the memoryLimit value. + */ + @Generated + public ContainerMemoryLimit getMemoryLimit() { + return this.memoryLimit; + } + + /** + * Set the memoryLimit property: The memory_limit property. + * + * @param memoryLimit the memoryLimit value to set. + * @return the CodeInterpreterContainerAuto object itself. + */ + @Generated + public CodeInterpreterContainerAuto setMemoryLimit(ContainerMemoryLimit memoryLimit) { + this.memoryLimit = memoryLimit; + return this; + } + /** * {@inheritDoc} */ @@ -79,33 +108,37 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("type", this.type); jsonWriter.writeArrayField("file_ids", this.fileIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("memory_limit", this.memoryLimit == null ? null : this.memoryLimit.toString()); return jsonWriter.writeEndObject(); } /** - * Reads an instance of CodeInterpreterToolAuto from the JsonReader. + * Reads an instance of CodeInterpreterContainerAuto from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of CodeInterpreterToolAuto if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of CodeInterpreterContainerAuto 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 CodeInterpreterToolAuto. + * @throws IOException If an error occurs while reading the CodeInterpreterContainerAuto. */ @Generated - public static CodeInterpreterToolAuto fromJson(JsonReader jsonReader) throws IOException { + public static CodeInterpreterContainerAuto fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - CodeInterpreterToolAuto deserializedCodeInterpreterToolAuto = new CodeInterpreterToolAuto(); + CodeInterpreterContainerAuto deserializedCodeInterpreterContainerAuto = new CodeInterpreterContainerAuto(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("file_ids".equals(fieldName)) { List fileIds = reader.readArray(reader1 -> reader1.getString()); - deserializedCodeInterpreterToolAuto.fileIds = fileIds; + deserializedCodeInterpreterContainerAuto.fileIds = fileIds; + } else if ("memory_limit".equals(fieldName)) { + deserializedCodeInterpreterContainerAuto.memoryLimit + = ContainerMemoryLimit.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedCodeInterpreterToolAuto; + return deserializedCodeInterpreterContainerAuto; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputImage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputImage.java index 897e01f4feb4..cd0844e97dfd 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputImage.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputImage.java @@ -6,21 +6,24 @@ 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 image + * * The image output from the code interpreter. */ @Immutable -public final class CodeInterpreterOutputImage extends CodeInterpreterOutput { +public final class CodeInterpreterOutputImage implements JsonSerializable { /* - * The type property. + * The type of the output. Always `image`. */ @Generated - private CodeInterpreterOutputType type = CodeInterpreterOutputType.IMAGE; + private final String type = "image"; /* * The URL of the image output from the code interpreter. @@ -39,13 +42,12 @@ public CodeInterpreterOutputImage(String url) { } /** - * Get the type property: The type property. + * Get the type property: The type of the output. Always `image`. * * @return the type value. */ @Generated - @Override - public CodeInterpreterOutputType getType() { + public String getType() { return this.type; } @@ -66,8 +68,8 @@ 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("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -84,21 +86,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static CodeInterpreterOutputImage fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String url = null; - CodeInterpreterOutputType type = CodeInterpreterOutputType.IMAGE; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("url".equals(fieldName)) { url = reader.getString(); - } else if ("type".equals(fieldName)) { - type = CodeInterpreterOutputType.fromString(reader.getString()); } else { reader.skipChildren(); } } - CodeInterpreterOutputImage deserializedCodeInterpreterOutputImage = new CodeInterpreterOutputImage(url); - deserializedCodeInterpreterOutputImage.type = type; - return deserializedCodeInterpreterOutputImage; + return new CodeInterpreterOutputImage(url); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputLogs.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputLogs.java index 05661f15bb50..cb71e651984e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputLogs.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputLogs.java @@ -6,21 +6,24 @@ 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 extends CodeInterpreterOutput { +public final class CodeInterpreterOutputLogs implements JsonSerializable { /* - * The type property. + * The type of the output. Always `logs`. */ @Generated - private CodeInterpreterOutputType type = CodeInterpreterOutputType.LOGS; + private final String type = "logs"; /* * The logs output from the code interpreter. @@ -39,13 +42,12 @@ public CodeInterpreterOutputLogs(String logs) { } /** - * Get the type property: The type property. + * Get the type property: The type of the output. Always `logs`. * * @return the type value. */ @Generated - @Override - public CodeInterpreterOutputType getType() { + public String getType() { return this.type; } @@ -66,8 +68,8 @@ public String getLogs() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); jsonWriter.writeStringField("logs", this.logs); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -84,21 +86,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static CodeInterpreterOutputLogs fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String logs = null; - CodeInterpreterOutputType type = CodeInterpreterOutputType.LOGS; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("logs".equals(fieldName)) { logs = reader.getString(); - } else if ("type".equals(fieldName)) { - type = CodeInterpreterOutputType.fromString(reader.getString()); } else { reader.skipChildren(); } } - CodeInterpreterOutputLogs deserializedCodeInterpreterOutputLogs = new CodeInterpreterOutputLogs(logs); - deserializedCodeInterpreterOutputLogs.type = type; - return deserializedCodeInterpreterOutputLogs; + return new CodeInterpreterOutputLogs(logs); }); } } 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 953ebbf41fd4..5cfc0f5c9a1d 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 @@ -12,6 +12,8 @@ import java.io.IOException; /** + * Code interpreter + * * A tool that runs Python code to help generate a response to a prompt. */ @Immutable @@ -25,7 +27,8 @@ public final class CodeInterpreterTool extends Tool { /* * The code interpreter container. Can be a container ID or an object that - * specifies uploaded file IDs to make available to your code. + * specifies uploaded file IDs to make available to your code, along with an + * optional `memory_limit` setting. */ @Generated private final BinaryData container; @@ -53,7 +56,8 @@ public ToolType getType() { /** * Get the container property: The code interpreter container. Can be a container ID or an object that - * specifies uploaded file IDs to make available to your code. + * specifies uploaded file IDs to make available to your code, along with an + * optional `memory_limit` setting. * * @return the container value. */ diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolCallItemParam.java deleted file mode 100644 index 2cabf2629501..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterToolCallItemParam.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.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; - -/** - * A tool call to run code. - */ -@Immutable -public final class CodeInterpreterToolCallItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.CODE_INTERPRETER_CALL; - - /* - * The ID of the container used to run the code. - */ - @Generated - private final String containerId; - - /* - * The code to run, or null if not available. - */ - @Generated - private final String code; - - /* - * The outputs generated by the code interpreter, such as logs or images. - * Can be null if no outputs are available. - */ - @Generated - private final List outputs; - - /** - * Creates an instance of CodeInterpreterToolCallItemParam class. - * - * @param containerId the containerId value to set. - * @param code the code value to set. - * @param outputs the outputs value to set. - */ - @Generated - public CodeInterpreterToolCallItemParam(String containerId, String code, List outputs) { - this.containerId = containerId; - this.code = code; - this.outputs = outputs; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * 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 to run, or null if not available. - * - * @return the code value. - */ - @Generated - public String getCode() { - return this.code; - } - - /** - * Get the outputs property: The outputs generated by the code interpreter, such as logs or images. - * Can be null if no outputs are available. - * - * @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("container_id", this.containerId); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeArrayField("outputs", this.outputs, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of CodeInterpreterToolCallItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of CodeInterpreterToolCallItemParam 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 CodeInterpreterToolCallItemParam. - */ - @Generated - public static CodeInterpreterToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String containerId = null; - String code = null; - List outputs = null; - ItemType type = ItemType.CODE_INTERPRETER_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - 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 -> CodeInterpreterOutput.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - CodeInterpreterToolCallItemParam deserializedCodeInterpreterToolCallItemParam - = new CodeInterpreterToolCallItemParam(containerId, code, outputs); - deserializedCodeInterpreterToolCallItemParam.type = type; - return deserializedCodeInterpreterToolCallItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComparisonFilter.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComparisonFilter.java index c71368aabf77..f9badc8c2861 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComparisonFilter.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComparisonFilter.java @@ -13,15 +13,23 @@ import java.io.IOException; /** + * Comparison Filter + * * A filter used to compare a specified attribute key to a given value using a defined comparison operation. */ @Immutable public final class ComparisonFilter implements JsonSerializable { /* - * Specifies the comparison operator: - * `eq` (equal), `ne` (not equal), `gt` (greater than), `gte` (greater than or equal), `lt` (less than), `lte` (less - * than or equal). + * Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + * - `eq`: equals + * - `ne`: not equal + * - `gt`: greater than + * - `gte`: greater than or equal + * - `lt`: less than + * - `lte`: less than or equal + * - `in`: in + * - `nin`: not in */ @Generated private final ComparisonFilterType type; @@ -53,9 +61,15 @@ public ComparisonFilter(ComparisonFilterType type, String key, BinaryData value) } /** - * Get the type property: Specifies the comparison operator: - * `eq` (equal), `ne` (not equal), `gt` (greater than), `gte` (greater than or equal), `lt` (less than), `lte` (less - * than or equal). + * Get the type property: Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`, `nin`. + * - `eq`: equals + * - `ne`: not equal + * - `gt`: greater than + * - `gte`: greater than or equal + * - `lt`: less than + * - `lte`: less than or equal + * - `in`: in + * - `nin`: not in. * * @return the type value. */ diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CompoundFilter.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CompoundFilter.java index 431206efa7e5..c97fa959921b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CompoundFilter.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CompoundFilter.java @@ -14,6 +14,8 @@ import java.util.List; /** + * Compound Filter + * * Combine multiple filters using `and` or `or`. */ @Immutable diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerAction.java index c2c1ec3d01c0..d0f7f18e7d44 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerAction.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerAction.java @@ -21,7 +21,7 @@ public class ComputerAction implements JsonSerializable { * The type property. */ @Generated - private ComputerActionType type; + private ComputerActionType type = ComputerActionType.fromString("ComputerAction"); /** * Creates an instance of ComputerAction class. @@ -78,23 +78,23 @@ public static ComputerAction fromJson(JsonReader jsonReader) throws IOException } // Use the discriminator value to determine which subtype should be deserialized. if ("click".equals(discriminatorValue)) { - return ComputerActionClick.fromJson(readerToUse.reset()); + return ClickParam.fromJson(readerToUse.reset()); } else if ("double_click".equals(discriminatorValue)) { - return ComputerActionDoubleClick.fromJson(readerToUse.reset()); + return DoubleClickAction.fromJson(readerToUse.reset()); } else if ("drag".equals(discriminatorValue)) { - return ComputerActionDrag.fromJson(readerToUse.reset()); + return Drag.fromJson(readerToUse.reset()); + } else if ("keypress".equals(discriminatorValue)) { + return KeyPressAction.fromJson(readerToUse.reset()); } else if ("move".equals(discriminatorValue)) { - return ComputerActionMove.fromJson(readerToUse.reset()); + return Move.fromJson(readerToUse.reset()); } else if ("screenshot".equals(discriminatorValue)) { - return ComputerActionScreenshot.fromJson(readerToUse.reset()); + return Screenshot.fromJson(readerToUse.reset()); } else if ("scroll".equals(discriminatorValue)) { - return ComputerActionScroll.fromJson(readerToUse.reset()); + return Scroll.fromJson(readerToUse.reset()); } else if ("type".equals(discriminatorValue)) { - return ComputerActionTypeKeys.fromJson(readerToUse.reset()); + return Type.fromJson(readerToUse.reset()); } else if ("wait".equals(discriminatorValue)) { - return ComputerActionWait.fromJson(readerToUse.reset()); - } else if ("keypress".equals(discriminatorValue)) { - return ComputerActionKeyPress.fromJson(readerToUse.reset()); + return Wait.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionType.java index 925502bf7331..0ce68f817e9c 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionType.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionType.java @@ -3,81 +3,97 @@ // 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; + /** * Defines values for ComputerActionType. */ -public enum ComputerActionType { +public final class ComputerActionType extends ExpandableStringEnum { /** - * Enum value screenshot. + * Static value click for ComputerActionType. */ - SCREENSHOT("screenshot"), + @Generated + public static final ComputerActionType CLICK = fromString("click"); + /** - * Enum value click. + * Static value double_click for ComputerActionType. */ - CLICK("click"), + @Generated + public static final ComputerActionType DOUBLE_CLICK = fromString("double_click"); + /** - * Enum value double_click. + * Static value drag for ComputerActionType. */ - DOUBLE_CLICK("double_click"), + @Generated + public static final ComputerActionType DRAG = fromString("drag"); + /** - * Enum value scroll. + * Static value keypress for ComputerActionType. */ - SCROLL("scroll"), + @Generated + public static final ComputerActionType KEYPRESS = fromString("keypress"); + /** - * Enum value type. + * Static value move for ComputerActionType. */ - TYPE("type"), + @Generated + public static final ComputerActionType MOVE = fromString("move"); + /** - * Enum value wait. + * Static value screenshot for ComputerActionType. */ - WAIT("wait"), + @Generated + public static final ComputerActionType SCREENSHOT = fromString("screenshot"); + /** - * Enum value keypress. + * Static value scroll for ComputerActionType. */ - KEY_PRESS("keypress"), + @Generated + public static final ComputerActionType SCROLL = fromString("scroll"); + /** - * Enum value drag. + * Static value type for ComputerActionType. */ - DRAG("drag"), + @Generated + public static final ComputerActionType TYPE = fromString("type"); + /** - * Enum value move. + * Static value wait for ComputerActionType. */ - MOVE("move"); + @Generated + public static final ComputerActionType WAIT = fromString("wait"); /** - * The actual serialized value for a ComputerActionType instance. + * Creates a new instance of ComputerActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. */ - private final String value; - - ComputerActionType(String value) { - this.value = value; + @Generated + @Deprecated + public ComputerActionType() { } /** - * Parses a serialized value to a ComputerActionType instance. + * Creates or finds a ComputerActionType from its string representation. * - * @param value the serialized value to parse. - * @return the parsed ComputerActionType object, or null if unable to parse. + * @param name a name to look for. + * @return the corresponding ComputerActionType. */ - public static ComputerActionType fromString(String value) { - if (value == null) { - return null; - } - ComputerActionType[] items = ComputerActionType.values(); - for (ComputerActionType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + @Generated + public static ComputerActionType fromString(String name) { + return fromString(name, ComputerActionType.class); } /** - * {@inheritDoc} + * Gets known ComputerActionType values. + * + * @return known ComputerActionType values. */ - @Override - public String toString() { - return this.value; + @Generated + public static Collection values() { + return values(ComputerActionType.class); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallSafetyCheck.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerCallSafetyCheckParam.java similarity index 62% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallSafetyCheck.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerCallSafetyCheckParam.java index 66a5266dc99c..14a39db60714 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallSafetyCheck.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerCallSafetyCheckParam.java @@ -3,8 +3,8 @@ // 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.JsonSerializable; import com.azure.json.JsonToken; @@ -14,8 +14,8 @@ /** * A pending safety check for the computer call. */ -@Immutable -public final class ComputerToolCallSafetyCheck implements JsonSerializable { +@Fluent +public final class ComputerCallSafetyCheckParam implements JsonSerializable { /* * The ID of the pending safety check. @@ -24,29 +24,25 @@ public final class ComputerToolCallSafetyCheck implements JsonSerializable { String id = null; String code = null; @@ -120,7 +140,11 @@ public static ComputerToolCallSafetyCheck fromJson(JsonReader jsonReader) throws reader.skipChildren(); } } - return new ComputerToolCallSafetyCheck(id, code, message); + 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/models/ComputerUsePreviewToolEnvironment.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerEnvironment.java similarity index 60% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerUsePreviewToolEnvironment.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerEnvironment.java index 19f0ffd79711..2ed13602deee 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerUsePreviewToolEnvironment.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerEnvironment.java @@ -5,9 +5,9 @@ package com.azure.ai.agents.models; /** - * Defines values for ComputerUsePreviewToolEnvironment. + * Defines values for ComputerEnvironment. */ -public enum ComputerUsePreviewToolEnvironment { +public enum ComputerEnvironment { /** * Enum value windows. */ @@ -34,26 +34,26 @@ public enum ComputerUsePreviewToolEnvironment { BROWSER("browser"); /** - * The actual serialized value for a ComputerUsePreviewToolEnvironment instance. + * The actual serialized value for a ComputerEnvironment instance. */ private final String value; - ComputerUsePreviewToolEnvironment(String value) { + ComputerEnvironment(String value) { this.value = value; } /** - * Parses a serialized value to a ComputerUsePreviewToolEnvironment instance. + * Parses a serialized value to a ComputerEnvironment instance. * * @param value the serialized value to parse. - * @return the parsed ComputerUsePreviewToolEnvironment object, or null if unable to parse. + * @return the parsed ComputerEnvironment object, or null if unable to parse. */ - public static ComputerUsePreviewToolEnvironment fromString(String value) { + public static ComputerEnvironment fromString(String value) { if (value == null) { return null; } - ComputerUsePreviewToolEnvironment[] items = ComputerUsePreviewToolEnvironment.values(); - for (ComputerUsePreviewToolEnvironment item : items) { + ComputerEnvironment[] items = ComputerEnvironment.values(); + for (ComputerEnvironment 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/ComputerScreenshotImage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerScreenshotImage.java new file mode 100644 index 000000000000..307bbd43a38a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerScreenshotImage.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.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; + +/** + * 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/models/ComputerToolCallOutputItemOutputComputerScreenshot.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputComputerScreenshot.java deleted file mode 100644 index 66aa4c2190b5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputComputerScreenshot.java +++ /dev/null @@ -1,143 +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.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 ComputerToolCallOutputItemOutputComputerScreenshot model. - */ -@Fluent -public final class ComputerToolCallOutputItemOutputComputerScreenshot extends ComputerToolCallOutputItemOutput { - - /* - * The type property. - */ - @Generated - private ComputerToolCallOutputItemOutputType type = ComputerToolCallOutputItemOutputType.SCREENSHOT; - - /* - * The image_url property. - */ - @Generated - private String imageUrl; - - /* - * The file_id property. - */ - @Generated - private String fileId; - - /** - * Creates an instance of ComputerToolCallOutputItemOutputComputerScreenshot class. - */ - @Generated - public ComputerToolCallOutputItemOutputComputerScreenshot() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ComputerToolCallOutputItemOutputType 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 ComputerToolCallOutputItemOutputComputerScreenshot object itself. - */ - @Generated - public ComputerToolCallOutputItemOutputComputerScreenshot 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 ComputerToolCallOutputItemOutputComputerScreenshot object itself. - */ - @Generated - public ComputerToolCallOutputItemOutputComputerScreenshot 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 == null ? null : this.type.toString()); - jsonWriter.writeStringField("image_url", this.imageUrl); - jsonWriter.writeStringField("file_id", this.fileId); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputerToolCallOutputItemOutputComputerScreenshot from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputerToolCallOutputItemOutputComputerScreenshot 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 ComputerToolCallOutputItemOutputComputerScreenshot. - */ - @Generated - public static ComputerToolCallOutputItemOutputComputerScreenshot fromJson(JsonReader jsonReader) - throws IOException { - return jsonReader.readObject(reader -> { - ComputerToolCallOutputItemOutputComputerScreenshot deserializedComputerToolCallOutputItemOutputComputerScreenshot - = new ComputerToolCallOutputItemOutputComputerScreenshot(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedComputerToolCallOutputItemOutputComputerScreenshot.type - = ComputerToolCallOutputItemOutputType.fromString(reader.getString()); - } else if ("image_url".equals(fieldName)) { - deserializedComputerToolCallOutputItemOutputComputerScreenshot.imageUrl = reader.getString(); - } else if ("file_id".equals(fieldName)) { - deserializedComputerToolCallOutputItemOutputComputerScreenshot.fileId = reader.getString(); - } else { - reader.skipChildren(); - } - } - return deserializedComputerToolCallOutputItemOutputComputerScreenshot; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputType.java deleted file mode 100644 index bc495306e3bc..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputType.java +++ /dev/null @@ -1,52 +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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * A computer screenshot image used with the computer use tool. - */ -public final class ComputerToolCallOutputItemOutputType - extends ExpandableStringEnum { - - /** - * Static value computer_screenshot for ComputerToolCallOutputItemOutputType. - */ - @Generated - public static final ComputerToolCallOutputItemOutputType SCREENSHOT = fromString("computer_screenshot"); - - /** - * Creates a new instance of ComputerToolCallOutputItemOutputType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ComputerToolCallOutputItemOutputType() { - } - - /** - * Creates or finds a ComputerToolCallOutputItemOutputType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ComputerToolCallOutputItemOutputType. - */ - @Generated - public static ComputerToolCallOutputItemOutputType fromString(String name) { - return fromString(name, ComputerToolCallOutputItemOutputType.class); - } - - /** - * Gets known ComputerToolCallOutputItemOutputType values. - * - * @return known ComputerToolCallOutputItemOutputType values. - */ - @Generated - public static Collection values() { - return values(ComputerToolCallOutputItemOutputType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemParam.java deleted file mode 100644 index 1cd0513fe2e8..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemParam.java +++ /dev/null @@ -1,169 +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.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 output of a computer tool call. - */ -@Fluent -public final class ComputerToolCallOutputItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.COMPUTER_CALL_OUTPUT; - - /* - * The ID of the computer tool call that produced the output. - */ - @Generated - private final String callId; - - /* - * The safety checks reported by the API that have been acknowledged by the - * developer. - */ - @Generated - private List acknowledgedSafetyChecks; - - /* - * The output property. - */ - @Generated - private final ComputerToolCallOutputItemOutput output; - - /** - * Creates an instance of ComputerToolCallOutputItemParam class. - * - * @param callId the callId value to set. - * @param output the output value to set. - */ - @Generated - public ComputerToolCallOutputItemParam(String callId, ComputerToolCallOutputItemOutput output) { - this.callId = callId; - this.output = output; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * 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 acknowledgedSafetyChecks property: The safety checks reported by the API that have been acknowledged by - * the - * developer. - * - * @return the acknowledgedSafetyChecks value. - */ - @Generated - public List getAcknowledgedSafetyChecks() { - return this.acknowledgedSafetyChecks; - } - - /** - * Set the acknowledgedSafetyChecks property: The safety checks reported by the API that have been acknowledged by - * the - * developer. - * - * @param acknowledgedSafetyChecks the acknowledgedSafetyChecks value to set. - * @return the ComputerToolCallOutputItemParam object itself. - */ - @Generated - public ComputerToolCallOutputItemParam - setAcknowledgedSafetyChecks(List acknowledgedSafetyChecks) { - this.acknowledgedSafetyChecks = acknowledgedSafetyChecks; - return this; - } - - /** - * Get the output property: The output property. - * - * @return the output value. - */ - @Generated - public ComputerToolCallOutputItemOutput getOutput() { - return this.output; - } - - /** - * {@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.writeArrayField("acknowledged_safety_checks", this.acknowledgedSafetyChecks, - (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ComputerToolCallOutputItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ComputerToolCallOutputItemParam 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 ComputerToolCallOutputItemParam. - */ - @Generated - public static ComputerToolCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - ComputerToolCallOutputItemOutput output = null; - ItemType type = ItemType.COMPUTER_CALL_OUTPUT; - List acknowledgedSafetyChecks = 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 = ComputerToolCallOutputItemOutput.fromJson(reader); - } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); - } else if ("acknowledged_safety_checks".equals(fieldName)) { - acknowledgedSafetyChecks - = reader.readArray(reader1 -> ComputerToolCallSafetyCheck.fromJson(reader1)); - } else { - reader.skipChildren(); - } - } - ComputerToolCallOutputItemParam deserializedComputerToolCallOutputItemParam - = new ComputerToolCallOutputItemParam(callId, output); - deserializedComputerToolCallOutputItemParam.type = type; - deserializedComputerToolCallOutputItemParam.acknowledgedSafetyChecks = acknowledgedSafetyChecks; - return deserializedComputerToolCallOutputItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java index 38654643253e..50ff966cc006 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java @@ -11,6 +11,8 @@ import java.io.IOException; /** + * Computer use preview + * * A tool that controls a virtual computer. Learn more about the [computer * tool](https://platform.openai.com/docs/guides/tools-computer-use). */ @@ -27,33 +29,19 @@ public final class ComputerUsePreviewTool extends Tool { * The type of computer environment to control. */ @Generated - private final ComputerUsePreviewToolEnvironment environment; + private final ComputerEnvironment environment; /* * The width of the computer display. */ @Generated - private final int displayWidth; + private final long displayWidth; /* * The height of the computer display. */ @Generated - private final int displayHeight; - - /** - * Creates an instance of ComputerUsePreviewTool class. - * - * @param environment the environment value to set. - * @param displayWidth the displayWidth value to set. - * @param displayHeight the displayHeight value to set. - */ - @Generated - public ComputerUsePreviewTool(ComputerUsePreviewToolEnvironment environment, int displayWidth, int displayHeight) { - this.environment = environment; - this.displayWidth = displayWidth; - this.displayHeight = displayHeight; - } + private final long displayHeight; /** * Get the type property: The type property. @@ -72,7 +60,7 @@ public ToolType getType() { * @return the environment value. */ @Generated - public ComputerUsePreviewToolEnvironment getEnvironment() { + public ComputerEnvironment getEnvironment() { return this.environment; } @@ -82,7 +70,7 @@ public ComputerUsePreviewToolEnvironment getEnvironment() { * @return the displayWidth value. */ @Generated - public int getDisplayWidth() { + public long getDisplayWidth() { return this.displayWidth; } @@ -92,7 +80,7 @@ public int getDisplayWidth() { * @return the displayHeight value. */ @Generated - public int getDisplayHeight() { + public long getDisplayHeight() { return this.displayHeight; } @@ -104,8 +92,8 @@ public int getDisplayHeight() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("environment", this.environment == null ? null : this.environment.toString()); - jsonWriter.writeIntField("display_width", this.displayWidth); - jsonWriter.writeIntField("display_height", this.displayHeight); + jsonWriter.writeLongField("display_width", this.displayWidth); + jsonWriter.writeLongField("display_height", this.displayHeight); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -122,19 +110,19 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { @Generated public static ComputerUsePreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ComputerUsePreviewToolEnvironment environment = null; - int displayWidth = 0; - int displayHeight = 0; + ComputerEnvironment environment = null; + long displayWidth = 0L; + long displayHeight = 0L; ToolType type = ToolType.COMPUTER_USE_PREVIEW; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("environment".equals(fieldName)) { - environment = ComputerUsePreviewToolEnvironment.fromString(reader.getString()); + environment = ComputerEnvironment.fromString(reader.getString()); } else if ("display_width".equals(fieldName)) { - displayWidth = reader.getInt(); + displayWidth = reader.getLong(); } else if ("display_height".equals(fieldName)) { - displayHeight = reader.getInt(); + displayHeight = reader.getLong(); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); } else { @@ -147,4 +135,18 @@ public static ComputerUsePreviewTool fromJson(JsonReader jsonReader) throws IOEx return deserializedComputerUsePreviewTool; }); } + + /** + * Creates an instance of ComputerUsePreviewTool class. + * + * @param environment the environment value to set. + * @param displayWidth the displayWidth value to set. + * @param displayHeight the displayHeight value to set. + */ + @Generated + public ComputerUsePreviewTool(ComputerEnvironment environment, long displayWidth, long displayHeight) { + this.environment = environment; + this.displayWidth = displayWidth; + this.displayHeight = displayHeight; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerFileCitationBody.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerFileCitationBody.java new file mode 100644 index 000000000000..c0d016f314cf --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerFileCitationBody.java @@ -0,0 +1,196 @@ +// 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; + +/** + * 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/models/ContainerLogKind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerLogKind.java new file mode 100644 index 000000000000..940888a57f24 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerLogKind.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.agents.models; + +/** + * The type of logs to stream from a container. + */ +public enum ContainerLogKind { + /** + * Console logs from the container. + */ + CONSOLE("console"), + + /** + * System logs from the container. + */ + SYSTEM("system"); + + /** + * The actual serialized value for a ContainerLogKind instance. + */ + private final String value; + + ContainerLogKind(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContainerLogKind instance. + * + * @param value the serialized value to parse. + * @return the parsed ContainerLogKind object, or null if unable to parse. + */ + public static ContainerLogKind fromString(String value) { + if (value == null) { + return null; + } + ContainerLogKind[] items = ContainerLogKind.values(); + for (ContainerLogKind 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/ContainerMemoryLimit.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerMemoryLimit.java new file mode 100644 index 000000000000..7342676159c5 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ContainerMemoryLimit.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.agents.models; + +/** + * Defines values for ContainerMemoryLimit. + */ +public enum ContainerMemoryLimit { + /** + * Enum value 1g. + */ + ONEG("1g"), + + /** + * Enum value 4g. + */ + FOURG("4g"), + + /** + * Enum value 16g. + */ + ONE_SIXG("16g"), + + /** + * Enum value 64g. + */ + SIX_FOURG("64g"); + + /** + * The actual serialized value for a ContainerMemoryLimit instance. + */ + private final String value; + + ContainerMemoryLimit(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ContainerMemoryLimit instance. + * + * @param value the serialized value to parse. + * @return the parsed ContainerMemoryLimit object, or null if unable to parse. + */ + public static ContainerMemoryLimit fromString(String value) { + if (value == null) { + return null; + } + ContainerMemoryLimit[] items = ContainerMemoryLimit.values(); + for (ContainerMemoryLimit 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/CustomGrammarFormatParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomGrammarFormatParam.java new file mode 100644 index 000000000000..2ee74aff892d --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomGrammarFormatParam.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.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; + +/** + * Grammar format + * + * A grammar defined by the user. + */ +@Immutable +public final class CustomGrammarFormatParam extends CustomToolParamFormat { + + /* + * The type property. + */ + @Generated + private CustomToolParamFormatType type = CustomToolParamFormatType.GRAMMAR; + + /* + * The syntax of the grammar definition. One of `lark` or `regex`. + */ + @Generated + private final GrammarSyntax syntax; + + /* + * The grammar definition. + */ + @Generated + private final String definition; + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public CustomToolParamFormatType getType() { + return this.type; + } + + /** + * Get the syntax property: The syntax of the grammar definition. One of `lark` or `regex`. + * + * @return the syntax value. + */ + @Generated + public GrammarSyntax getSyntax() { + return this.syntax; + } + + /** + * Get the definition property: The grammar definition. + * + * @return the definition value. + */ + @Generated + public String getDefinition() { + return this.definition; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("syntax", this.syntax == null ? null : this.syntax.toString()); + jsonWriter.writeStringField("definition", this.definition); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomGrammarFormatParam from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomGrammarFormatParam 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 CustomGrammarFormatParam. + */ + @Generated + public static CustomGrammarFormatParam fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GrammarSyntax syntax = null; + String definition = null; + CustomToolParamFormatType type = CustomToolParamFormatType.GRAMMAR; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("syntax".equals(fieldName)) { + syntax = GrammarSyntax.fromString(reader.getString()); + } else if ("definition".equals(fieldName)) { + definition = reader.getString(); + } else if ("type".equals(fieldName)) { + type = CustomToolParamFormatType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + CustomGrammarFormatParam deserializedCustomGrammarFormatParam + = new CustomGrammarFormatParam(syntax, definition); + deserializedCustomGrammarFormatParam.type = type; + return deserializedCustomGrammarFormatParam; + }); + } + + /** + * Creates an instance of CustomGrammarFormatParam class. + * + * @param syntax the syntax value to set. + * @param definition the definition value to set. + */ + @Generated + public CustomGrammarFormatParam(GrammarSyntax syntax, String definition) { + this.syntax = syntax; + this.definition = definition; + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomTextFormatParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomTextFormatParam.java new file mode 100644 index 000000000000..2a15cfecbf42 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomTextFormatParam.java @@ -0,0 +1,80 @@ +// 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; + +/** + * Text format + * + * Unconstrained free-form text. + */ +@Immutable +public final class CustomTextFormatParam extends CustomToolParamFormat { + + /* + * The type property. + */ + @Generated + private CustomToolParamFormatType type = CustomToolParamFormatType.TEXT; + + /** + * Creates an instance of CustomTextFormatParam class. + */ + @Generated + public CustomTextFormatParam() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public CustomToolParamFormatType 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 CustomTextFormatParam from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomTextFormatParam 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 CustomTextFormatParam. + */ + @Generated + public static CustomTextFormatParam fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CustomTextFormatParam deserializedCustomTextFormatParam = new CustomTextFormatParam(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedCustomTextFormatParam.type = CustomToolParamFormatType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedCustomTextFormatParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParam.java new file mode 100644 index 000000000000..4a6bbb2403b5 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParam.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.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; + +/** + * Custom tool + * + * A custom tool that processes input using a specified format. Learn more about [custom + * tools](https://platform.openai.com/docs/guides/function-calling#custom-tools). + */ +@Fluent +public final class CustomToolParam extends Tool { + + /* + * The type property. + */ + @Generated + private ToolType type = ToolType.CUSTOM; + + /* + * The name of the custom tool, used to identify it in tool calls. + */ + @Generated + private final String name; + + /* + * Optional description of the custom tool, used to provide more context. + */ + @Generated + private String description; + + /* + * The input format for the custom tool. Default is unconstrained text. + */ + @Generated + private CustomToolParamFormat format; + + /** + * Creates an instance of CustomToolParam class. + * + * @param name the name value to set. + */ + @Generated + public CustomToolParam(String name) { + this.name = name; + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public ToolType getType() { + return this.type; + } + + /** + * Get the name property: The name of the custom tool, used to identify it in tool calls. + * + * @return the name value. + */ + @Generated + public String getName() { + return this.name; + } + + /** + * Get the description property: Optional description of the custom tool, used to provide more context. + * + * @return the description value. + */ + @Generated + public String getDescription() { + return this.description; + } + + /** + * Set the description property: Optional description of the custom tool, used to provide more context. + * + * @param description the description value to set. + * @return the CustomToolParam object itself. + */ + @Generated + public CustomToolParam setDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the format property: The input format for the custom tool. Default is unconstrained text. + * + * @return the format value. + */ + @Generated + public CustomToolParamFormat getFormat() { + return this.format; + } + + /** + * Set the format property: The input format for the custom tool. Default is unconstrained text. + * + * @param format the format value to set. + * @return the CustomToolParam object itself. + */ + @Generated + public CustomToolParam setFormat(CustomToolParamFormat format) { + this.format = format; + 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.writeJsonField("format", this.format); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CustomToolParam from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CustomToolParam 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 CustomToolParam. + */ + @Generated + public static CustomToolParam fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String name = null; + ToolType type = ToolType.CUSTOM; + String description = null; + CustomToolParamFormat format = 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 = ToolType.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + description = reader.getString(); + } else if ("format".equals(fieldName)) { + format = CustomToolParamFormat.fromJson(reader); + } else { + reader.skipChildren(); + } + } + CustomToolParam deserializedCustomToolParam = new CustomToolParam(name); + deserializedCustomToolParam.type = type; + deserializedCustomToolParam.description = description; + deserializedCustomToolParam.format = format; + return deserializedCustomToolParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParamFormat.java similarity index 68% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutput.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParamFormat.java index c08fc8e78efd..dacbb703ac2e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CodeInterpreterOutput.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParamFormat.java @@ -12,22 +12,22 @@ import java.io.IOException; /** - * The CodeInterpreterOutput model. + * The input format for the custom tool. Default is unconstrained text. */ @Immutable -public class CodeInterpreterOutput implements JsonSerializable { +public class CustomToolParamFormat implements JsonSerializable { /* * The type property. */ @Generated - private CodeInterpreterOutputType type; + private CustomToolParamFormatType type = CustomToolParamFormatType.fromString("CustomToolParamFormat"); /** - * Creates an instance of CodeInterpreterOutput class. + * Creates an instance of CustomToolParamFormat class. */ @Generated - public CodeInterpreterOutput() { + public CustomToolParamFormat() { } /** @@ -36,7 +36,7 @@ public CodeInterpreterOutput() { * @return the type value. */ @Generated - public CodeInterpreterOutputType getType() { + public CustomToolParamFormatType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of CodeInterpreterOutput from the JsonReader. + * Reads an instance of CustomToolParamFormat from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of CodeInterpreterOutput if the JsonReader was pointing to an instance of it, or null if it + * @return An instance of CustomToolParamFormat 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 CodeInterpreterOutput. + * @throws IOException If an error occurs while reading the CustomToolParamFormat. */ @Generated - public static CodeInterpreterOutput fromJson(JsonReader jsonReader) throws IOException { + public static CustomToolParamFormat fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,10 +77,10 @@ public static CodeInterpreterOutput fromJson(JsonReader jsonReader) throws IOExc } } // Use the discriminator value to determine which subtype should be deserialized. - if ("image".equals(discriminatorValue)) { - return CodeInterpreterOutputImage.fromJson(readerToUse.reset()); - } else if ("logs".equals(discriminatorValue)) { - return CodeInterpreterOutputLogs.fromJson(readerToUse.reset()); + if ("text".equals(discriminatorValue)) { + return CustomTextFormatParam.fromJson(readerToUse.reset()); + } else if ("grammar".equals(discriminatorValue)) { + return CustomGrammarFormatParam.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -89,19 +89,19 @@ public static CodeInterpreterOutput fromJson(JsonReader jsonReader) throws IOExc } @Generated - static CodeInterpreterOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static CustomToolParamFormat fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - CodeInterpreterOutput deserializedCodeInterpreterOutput = new CodeInterpreterOutput(); + CustomToolParamFormat deserializedCustomToolParamFormat = new CustomToolParamFormat(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedCodeInterpreterOutput.type = CodeInterpreterOutputType.fromString(reader.getString()); + deserializedCustomToolParamFormat.type = CustomToolParamFormatType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedCodeInterpreterOutput; + return deserializedCustomToolParamFormat; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParamFormatType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParamFormatType.java new file mode 100644 index 000000000000..3b9ace82690b --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/CustomToolParamFormatType.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; + +/** + * Defines values for CustomToolParamFormatType. + */ +public final class CustomToolParamFormatType extends ExpandableStringEnum { + + /** + * Static value text for CustomToolParamFormatType. + */ + @Generated + public static final CustomToolParamFormatType TEXT = fromString("text"); + + /** + * Static value grammar for CustomToolParamFormatType. + */ + @Generated + public static final CustomToolParamFormatType GRAMMAR = fromString("grammar"); + + /** + * Creates a new instance of CustomToolParamFormatType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CustomToolParamFormatType() { + } + + /** + * Creates or finds a CustomToolParamFormatType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CustomToolParamFormatType. + */ + @Generated + public static CustomToolParamFormatType fromString(String name) { + return fromString(name, CustomToolParamFormatType.class); + } + + /** + * Gets known CustomToolParamFormatType values. + * + * @return known CustomToolParamFormatType values. + */ + @Generated + public static Collection values() { + return values(CustomToolParamFormatType.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputImageDetail.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DetailEnum.java similarity index 58% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputImageDetail.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DetailEnum.java index 078b14ec6d20..779826a3478e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputImageDetail.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DetailEnum.java @@ -5,9 +5,9 @@ package com.azure.ai.agents.models; /** - * Defines values for ItemContentInputImageDetail. + * Defines values for DetailEnum. */ -public enum ItemContentInputImageDetail { +public enum DetailEnum { /** * Enum value low. */ @@ -24,26 +24,26 @@ public enum ItemContentInputImageDetail { AUTO("auto"); /** - * The actual serialized value for a ItemContentInputImageDetail instance. + * The actual serialized value for a DetailEnum instance. */ private final String value; - ItemContentInputImageDetail(String value) { + DetailEnum(String value) { this.value = value; } /** - * Parses a serialized value to a ItemContentInputImageDetail instance. + * Parses a serialized value to a DetailEnum instance. * * @param value the serialized value to parse. - * @return the parsed ItemContentInputImageDetail object, or null if unable to parse. + * @return the parsed DetailEnum object, or null if unable to parse. */ - public static ItemContentInputImageDetail fromString(String value) { + public static DetailEnum fromString(String value) { if (value == null) { return null; } - ItemContentInputImageDetail[] items = ItemContentInputImageDetail.values(); - for (ItemContentInputImageDetail item : items) { + DetailEnum[] items = DetailEnum.values(); + for (DetailEnum 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/ComputerActionDoubleClick.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DoubleClickAction.java similarity index 70% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionDoubleClick.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DoubleClickAction.java index c3ed967a880b..0984da154b6c 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionDoubleClick.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DoubleClickAction.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * DoubleClick + * * A double click action. */ @Immutable -public final class ComputerActionDoubleClick extends ComputerAction { +public final class DoubleClickAction extends ComputerAction { /* * The type property. @@ -26,22 +28,22 @@ public final class ComputerActionDoubleClick extends ComputerAction { * The x-coordinate where the double click occurred. */ @Generated - private final int x; + private final long x; /* * The y-coordinate where the double click occurred. */ @Generated - private final int y; + private final long y; /** - * Creates an instance of ComputerActionDoubleClick class. + * Creates an instance of DoubleClickAction class. * * @param x the x value to set. * @param y the y value to set. */ @Generated - public ComputerActionDoubleClick(int x, int y) { + public DoubleClickAction(long x, long y) { this.x = x; this.y = y; } @@ -63,7 +65,7 @@ public ComputerActionType getType() { * @return the x value. */ @Generated - public int getX() { + public long getX() { return this.x; } @@ -73,7 +75,7 @@ public int getX() { * @return the y value. */ @Generated - public int getY() { + public long getY() { return this.y; } @@ -84,43 +86,43 @@ public int getY() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("x", this.x); - jsonWriter.writeIntField("y", this.y); + 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 ComputerActionDoubleClick from the JsonReader. + * Reads an instance of DoubleClickAction from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionDoubleClick if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. + * @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 ComputerActionDoubleClick. + * @throws IOException If an error occurs while reading the DoubleClickAction. */ @Generated - public static ComputerActionDoubleClick fromJson(JsonReader jsonReader) throws IOException { + public static DoubleClickAction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - int x = 0; - int y = 0; + 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.getInt(); + x = reader.getLong(); } else if ("y".equals(fieldName)) { - y = reader.getInt(); + y = reader.getLong(); } else if ("type".equals(fieldName)) { type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ComputerActionDoubleClick deserializedComputerActionDoubleClick = new ComputerActionDoubleClick(x, y); - deserializedComputerActionDoubleClick.type = type; - return deserializedComputerActionDoubleClick; + 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/models/ComputerActionDrag.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Drag.java similarity index 75% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionDrag.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Drag.java index 71f9878cb3dc..fc8acfa89755 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionDrag.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Drag.java @@ -12,10 +12,12 @@ import java.util.List; /** + * Drag + * * A drag action. */ @Immutable -public final class ComputerActionDrag extends ComputerAction { +public final class Drag extends ComputerAction { /* * The type property. @@ -34,15 +36,15 @@ public final class ComputerActionDrag extends ComputerAction { * ``` */ @Generated - private final List path; + private final List path; /** - * Creates an instance of ComputerActionDrag class. + * Creates an instance of Drag class. * * @param path the path value to set. */ @Generated - public ComputerActionDrag(List path) { + public Drag(List path) { this.path = path; } @@ -71,7 +73,7 @@ public ComputerActionType getType() { * @return the path value. */ @Generated - public List getPath() { + public List getPath() { return this.path; } @@ -88,33 +90,33 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ComputerActionDrag from the JsonReader. + * Reads an instance of Drag from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionDrag if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of Drag 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 ComputerActionDrag. + * @throws IOException If an error occurs while reading the Drag. */ @Generated - public static ComputerActionDrag fromJson(JsonReader jsonReader) throws IOException { + public static Drag fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - List path = null; + 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 -> Coordinate.fromJson(reader1)); + path = reader.readArray(reader1 -> DragPoint.fromJson(reader1)); } else if ("type".equals(fieldName)) { type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ComputerActionDrag deserializedComputerActionDrag = new ComputerActionDrag(path); - deserializedComputerActionDrag.type = type; - return deserializedComputerActionDrag; + Drag deserializedDrag = new Drag(path); + deserializedDrag.type = type; + return deserializedDrag; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Coordinate.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DragPoint.java similarity index 71% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Coordinate.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DragPoint.java index 97df1ef86526..220bafc0c267 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Coordinate.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/DragPoint.java @@ -12,31 +12,33 @@ import java.io.IOException; /** + * Coordinate + * * An x/y coordinate pair, e.g. `{ x: 100, y: 200 }`. */ @Immutable -public final class Coordinate implements JsonSerializable { +public final class DragPoint implements JsonSerializable { /* * The x-coordinate. */ @Generated - private final int x; + private final long x; /* * The y-coordinate. */ @Generated - private final int y; + private final long y; /** - * Creates an instance of Coordinate class. + * Creates an instance of DragPoint class. * * @param x the x value to set. * @param y the y value to set. */ @Generated - public Coordinate(int x, int y) { + public DragPoint(long x, long y) { this.x = x; this.y = y; } @@ -47,7 +49,7 @@ public Coordinate(int x, int y) { * @return the x value. */ @Generated - public int getX() { + public long getX() { return this.x; } @@ -57,7 +59,7 @@ public int getX() { * @return the y value. */ @Generated - public int getY() { + public long getY() { return this.y; } @@ -68,37 +70,37 @@ public int getY() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("x", this.x); - jsonWriter.writeIntField("y", this.y); + jsonWriter.writeLongField("x", this.x); + jsonWriter.writeLongField("y", this.y); return jsonWriter.writeEndObject(); } /** - * Reads an instance of Coordinate from the JsonReader. + * Reads an instance of DragPoint from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of Coordinate if the JsonReader was pointing to an instance of it, or null if it was pointing + * @return An instance of DragPoint 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 Coordinate. + * @throws IOException If an error occurs while reading the DragPoint. */ @Generated - public static Coordinate fromJson(JsonReader jsonReader) throws IOException { + public static DragPoint fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - int x = 0; - int y = 0; + long x = 0L; + long y = 0L; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("x".equals(fieldName)) { - x = reader.getInt(); + x = reader.getLong(); } else if ("y".equals(fieldName)) { - y = reader.getInt(); + y = reader.getLong(); } else { reader.skipChildren(); } } - return new Coordinate(x, y); + return new DragPoint(x, y); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationFileCitation.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileCitationBody.java similarity index 77% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationFileCitation.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileCitationBody.java index e997f4b97da9..f527a6f09877 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationFileCitation.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileCitationBody.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * File citation + * * A citation to a file. */ @Immutable -public final class AnnotationFileCitation extends Annotation { +public final class FileCitationBody extends Annotation { /* * The type property. @@ -32,7 +34,7 @@ public final class AnnotationFileCitation extends Annotation { * The index of the file in the list of files. */ @Generated - private final int index; + private final long index; /* * The filename of the file cited. @@ -41,14 +43,14 @@ public final class AnnotationFileCitation extends Annotation { private final String filename; /** - * Creates an instance of AnnotationFileCitation class. + * 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 AnnotationFileCitation(String fileId, int index, String filename) { + public FileCitationBody(String fileId, long index, String filename) { this.fileId = fileId; this.index = index; this.filename = filename; @@ -81,7 +83,7 @@ public String getFileId() { * @return the index value. */ @Generated - public int getIndex() { + public long getIndex() { return this.index; } @@ -103,26 +105,26 @@ public String getFilename() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeIntField("index", this.index); + 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 AnnotationFileCitation from the JsonReader. + * Reads an instance of FileCitationBody from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AnnotationFileCitation if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @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 AnnotationFileCitation. + * @throws IOException If an error occurs while reading the FileCitationBody. */ @Generated - public static AnnotationFileCitation fromJson(JsonReader jsonReader) throws IOException { + public static FileCitationBody fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String fileId = null; - int index = 0; + long index = 0L; String filename = null; AnnotationType type = AnnotationType.FILE_CITATION; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -131,7 +133,7 @@ public static AnnotationFileCitation fromJson(JsonReader jsonReader) throws IOEx if ("file_id".equals(fieldName)) { fileId = reader.getString(); } else if ("index".equals(fieldName)) { - index = reader.getInt(); + index = reader.getLong(); } else if ("filename".equals(fieldName)) { filename = reader.getString(); } else if ("type".equals(fieldName)) { @@ -140,10 +142,9 @@ public static AnnotationFileCitation fromJson(JsonReader jsonReader) throws IOEx reader.skipChildren(); } } - AnnotationFileCitation deserializedAnnotationFileCitation - = new AnnotationFileCitation(fileId, index, filename); - deserializedAnnotationFileCitation.type = type; - return deserializedAnnotationFileCitation; + 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/models/AnnotationFilePath.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FilePath.java similarity index 76% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationFilePath.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FilePath.java index 93d18a94ec95..d5dddff4e0bd 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationFilePath.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FilePath.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * File path + * * A path to a file. */ @Immutable -public final class AnnotationFilePath extends Annotation { +public final class FilePath extends Annotation { /* * The type property. @@ -32,16 +34,16 @@ public final class AnnotationFilePath extends Annotation { * The index of the file in the list of files. */ @Generated - private final int index; + private final long index; /** - * Creates an instance of AnnotationFilePath class. + * Creates an instance of FilePath class. * * @param fileId the fileId value to set. * @param index the index value to set. */ @Generated - public AnnotationFilePath(String fileId, int index) { + public FilePath(String fileId, long index) { this.fileId = fileId; this.index = index; } @@ -73,7 +75,7 @@ public String getFileId() { * @return the index value. */ @Generated - public int getIndex() { + public long getIndex() { return this.index; } @@ -85,25 +87,25 @@ public int getIndex() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("file_id", this.fileId); - jsonWriter.writeIntField("index", this.index); + jsonWriter.writeLongField("index", this.index); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } /** - * Reads an instance of AnnotationFilePath from the JsonReader. + * Reads an instance of FilePath from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AnnotationFilePath if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @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 AnnotationFilePath. + * @throws IOException If an error occurs while reading the FilePath. */ @Generated - public static AnnotationFilePath fromJson(JsonReader jsonReader) throws IOException { + public static FilePath fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String fileId = null; - int index = 0; + long index = 0L; AnnotationType type = AnnotationType.FILE_PATH; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -111,16 +113,16 @@ public static AnnotationFilePath fromJson(JsonReader jsonReader) throws IOExcept if ("file_id".equals(fieldName)) { fileId = reader.getString(); } else if ("index".equals(fieldName)) { - index = reader.getInt(); + index = reader.getLong(); } else if ("type".equals(fieldName)) { type = AnnotationType.fromString(reader.getString()); } else { reader.skipChildren(); } } - AnnotationFilePath deserializedAnnotationFilePath = new AnnotationFilePath(fileId, index); - deserializedAnnotationFilePath.type = type; - return deserializedAnnotationFilePath; + 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/models/FileSearchTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchTool.java index 2812d72c3303..32a38e1c6965 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,8 @@ import java.util.List; /** + * File search + * * A tool that searches for relevant content from uploaded files. Learn more about the [file search * tool](https://platform.openai.com/docs/guides/tools-file-search). */ @@ -38,7 +40,7 @@ public final class FileSearchTool extends Tool { private RankingOptions rankingOptions; /* - * A filter to apply. + * The filters property. */ @Generated private BinaryData filters; @@ -97,7 +99,7 @@ public FileSearchTool setRankingOptions(RankingOptions rankingOptions) { } /** - * Get the filters property: A filter to apply. + * Get the filters property: The filters property. * * @return the filters value. */ @@ -107,7 +109,7 @@ public BinaryData getFilters() { } /** - * Set the filters property: A filter to apply. + * Set the filters property: The filters property. * * @param filters the filters value to set. * @return the FileSearchTool object itself. @@ -151,7 +153,7 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException return jsonReader.readObject(reader -> { List vectorStoreIds = null; ToolType type = ToolType.FILE_SEARCH; - Integer maxResults = null; + Long maxResults = null; RankingOptions rankingOptions = null; BinaryData filters = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -162,7 +164,7 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); } else if ("max_num_results".equals(fieldName)) { - maxResults = reader.getNullable(JsonReader::getInt); + maxResults = reader.getNullable(JsonReader::getLong); } else if ("ranking_options".equals(fieldName)) { rankingOptions = RankingOptions.fromJson(reader); } else if ("filters".equals(fieldName)) { @@ -184,7 +186,7 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException * The maximum number of results to return. This number should be between 1 and 50 inclusive. */ @Generated - private Integer maxResults; + private Long maxResults; /** * Get the maxResults property: The maximum number of results to return. This number should be between 1 and 50 @@ -193,7 +195,7 @@ public static FileSearchTool fromJson(JsonReader jsonReader) throws IOException * @return the maxResults value. */ @Generated - public Integer getMaxResults() { + public Long getMaxResults() { return this.maxResults; } @@ -205,7 +207,7 @@ public Integer getMaxResults() { * @return the FileSearchTool object itself. */ @Generated - public FileSearchTool setMaxResults(Integer maxResults) { + public FileSearchTool setMaxResults(Long maxResults) { this.maxResults = maxResults; return this; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParamResult.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallResults.java similarity index 56% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParamResult.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallResults.java index 37583e033776..e1f668e57588 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParamResult.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallResults.java @@ -12,25 +12,25 @@ import java.io.IOException; /** - * The FileSearchToolCallItemParamResult model. + * The FileSearchToolCallResults model. */ @Fluent -public final class FileSearchToolCallItemParamResult implements JsonSerializable { +public final class FileSearchToolCallResults implements JsonSerializable { /* - * The unique ID of the file. + * The file_id property. */ @Generated private String fileId; /* - * The text that was retrieved from the file. + * The text property. */ @Generated private String text; /* - * The name of the file. + * The filename property. */ @Generated private String filename; @@ -42,20 +42,20 @@ public final class FileSearchToolCallItemParamResult implements JsonSerializable private VectorStoreFileAttributes attributes; /* - * The relevance score of the file - a value between 0 and 1. + * The score property. */ @Generated private Double score; /** - * Creates an instance of FileSearchToolCallItemParamResult class. + * Creates an instance of FileSearchToolCallResults class. */ @Generated - public FileSearchToolCallItemParamResult() { + public FileSearchToolCallResults() { } /** - * Get the fileId property: The unique ID of the file. + * Get the fileId property: The file_id property. * * @return the fileId value. */ @@ -65,19 +65,19 @@ public String getFileId() { } /** - * Set the fileId property: The unique ID of the file. + * Set the fileId property: The file_id property. * * @param fileId the fileId value to set. - * @return the FileSearchToolCallItemParamResult object itself. + * @return the FileSearchToolCallResults object itself. */ @Generated - public FileSearchToolCallItemParamResult setFileId(String fileId) { + public FileSearchToolCallResults setFileId(String fileId) { this.fileId = fileId; return this; } /** - * Get the text property: The text that was retrieved from the file. + * Get the text property: The text property. * * @return the text value. */ @@ -87,19 +87,19 @@ public String getText() { } /** - * Set the text property: The text that was retrieved from the file. + * Set the text property: The text property. * * @param text the text value to set. - * @return the FileSearchToolCallItemParamResult object itself. + * @return the FileSearchToolCallResults object itself. */ @Generated - public FileSearchToolCallItemParamResult setText(String text) { + public FileSearchToolCallResults setText(String text) { this.text = text; return this; } /** - * Get the filename property: The name of the file. + * Get the filename property: The filename property. * * @return the filename value. */ @@ -109,13 +109,13 @@ public String getFilename() { } /** - * Set the filename property: The name of the file. + * Set the filename property: The filename property. * * @param filename the filename value to set. - * @return the FileSearchToolCallItemParamResult object itself. + * @return the FileSearchToolCallResults object itself. */ @Generated - public FileSearchToolCallItemParamResult setFilename(String filename) { + public FileSearchToolCallResults setFilename(String filename) { this.filename = filename; return this; } @@ -134,16 +134,16 @@ public VectorStoreFileAttributes getAttributes() { * Set the attributes property: The attributes property. * * @param attributes the attributes value to set. - * @return the FileSearchToolCallItemParamResult object itself. + * @return the FileSearchToolCallResults object itself. */ @Generated - public FileSearchToolCallItemParamResult setAttributes(VectorStoreFileAttributes attributes) { + public FileSearchToolCallResults setAttributes(VectorStoreFileAttributes attributes) { this.attributes = attributes; return this; } /** - * Get the score property: The relevance score of the file - a value between 0 and 1. + * Get the score property: The score property. * * @return the score value. */ @@ -153,13 +153,13 @@ public Double getScore() { } /** - * Set the score property: The relevance score of the file - a value between 0 and 1. + * Set the score property: The score property. * * @param score the score value to set. - * @return the FileSearchToolCallItemParamResult object itself. + * @return the FileSearchToolCallResults object itself. */ @Generated - public FileSearchToolCallItemParamResult setScore(Double score) { + public FileSearchToolCallResults setScore(Double score) { this.score = score; return this; } @@ -180,37 +180,35 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FileSearchToolCallItemParamResult from the JsonReader. + * Reads an instance of FileSearchToolCallResults from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FileSearchToolCallItemParamResult 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 FileSearchToolCallItemParamResult. + * @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 FileSearchToolCallItemParamResult fromJson(JsonReader jsonReader) throws IOException { + public static FileSearchToolCallResults fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - FileSearchToolCallItemParamResult deserializedFileSearchToolCallItemParamResult - = new FileSearchToolCallItemParamResult(); + FileSearchToolCallResults deserializedFileSearchToolCallResults = new FileSearchToolCallResults(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("file_id".equals(fieldName)) { - deserializedFileSearchToolCallItemParamResult.fileId = reader.getString(); + deserializedFileSearchToolCallResults.fileId = reader.getString(); } else if ("text".equals(fieldName)) { - deserializedFileSearchToolCallItemParamResult.text = reader.getString(); + deserializedFileSearchToolCallResults.text = reader.getString(); } else if ("filename".equals(fieldName)) { - deserializedFileSearchToolCallItemParamResult.filename = reader.getString(); + deserializedFileSearchToolCallResults.filename = reader.getString(); } else if ("attributes".equals(fieldName)) { - deserializedFileSearchToolCallItemParamResult.attributes - = VectorStoreFileAttributes.fromJson(reader); + deserializedFileSearchToolCallResults.attributes = VectorStoreFileAttributes.fromJson(reader); } else if ("score".equals(fieldName)) { - deserializedFileSearchToolCallItemParamResult.score = reader.getNullable(JsonReader::getDouble); + deserializedFileSearchToolCallResults.score = reader.getNullable(JsonReader::getDouble); } else { reader.skipChildren(); } } - return deserializedFileSearchToolCallItemParamResult; + return deserializedFileSearchToolCallResults; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfiguration.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutput.java similarity index 63% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfiguration.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutput.java index 7b3eb53d6408..cdfd86f014a7 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfiguration.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutput.java @@ -12,23 +12,23 @@ import java.io.IOException; /** - * The ResponseTextFormatConfiguration model. + * The FunctionAndCustomToolCallOutput model. */ @Immutable -public class ResponseTextFormatConfiguration implements JsonSerializable { +public class FunctionAndCustomToolCallOutput implements JsonSerializable { /* * The type property. */ @Generated - private ResponseTextFormatConfigurationType type - = ResponseTextFormatConfigurationType.fromString("ResponseTextFormatConfiguration"); + private FunctionAndCustomToolCallOutputType type + = FunctionAndCustomToolCallOutputType.fromString("FunctionAndCustomToolCallOutput"); /** - * Creates an instance of ResponseTextFormatConfiguration class. + * Creates an instance of FunctionAndCustomToolCallOutput class. */ @Generated - public ResponseTextFormatConfiguration() { + public FunctionAndCustomToolCallOutput() { } /** @@ -37,7 +37,7 @@ public ResponseTextFormatConfiguration() { * @return the type value. */ @Generated - public ResponseTextFormatConfigurationType getType() { + public FunctionAndCustomToolCallOutputType getType() { return this.type; } @@ -53,15 +53,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResponseTextFormatConfiguration from the JsonReader. + * Reads an instance of FunctionAndCustomToolCallOutput from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResponseTextFormatConfiguration if the JsonReader was pointing to an instance of it, or + * @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 ResponseTextFormatConfiguration. + * @throws IOException If an error occurs while reading the FunctionAndCustomToolCallOutput. */ @Generated - public static ResponseTextFormatConfiguration fromJson(JsonReader jsonReader) throws IOException { + public static FunctionAndCustomToolCallOutput fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -78,12 +78,12 @@ public static ResponseTextFormatConfiguration fromJson(JsonReader jsonReader) th } } // Use the discriminator value to determine which subtype should be deserialized. - if ("text".equals(discriminatorValue)) { - return ResponseTextFormatConfigurationText.fromJson(readerToUse.reset()); - } else if ("json_object".equals(discriminatorValue)) { - return ResponseTextFormatConfigurationJsonObject.fromJson(readerToUse.reset()); - } else if ("json_schema".equals(discriminatorValue)) { - return ResponseTextFormatConfigurationJsonSchema.fromJson(readerToUse.reset()); + 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()); } @@ -92,21 +92,21 @@ public static ResponseTextFormatConfiguration fromJson(JsonReader jsonReader) th } @Generated - static ResponseTextFormatConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static FunctionAndCustomToolCallOutput fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ResponseTextFormatConfiguration deserializedResponseTextFormatConfiguration - = new ResponseTextFormatConfiguration(); + FunctionAndCustomToolCallOutput deserializedFunctionAndCustomToolCallOutput + = new FunctionAndCustomToolCallOutput(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedResponseTextFormatConfiguration.type - = ResponseTextFormatConfigurationType.fromString(reader.getString()); + deserializedFunctionAndCustomToolCallOutput.type + = FunctionAndCustomToolCallOutputType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedResponseTextFormatConfiguration; + return deserializedFunctionAndCustomToolCallOutput; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputFileContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputFileContent.java new file mode 100644 index 000000000000..cf38b51b9657 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputFileContent.java @@ -0,0 +1,206 @@ +// 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; + +/** + * 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/models/FunctionAndCustomToolCallOutputInputImageContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputImageContent.java new file mode 100644 index 000000000000..0bf81c1fce58 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputImageContent.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.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; + +/** + * Input image + * + * An image input to the model. Learn about [image inputs](https://platform.openai.com/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/models/FunctionAndCustomToolCallOutputInputTextContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputTextContent.java new file mode 100644 index 000000000000..7e1729167a71 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputTextContent.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.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; + +/** + * 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/models/FunctionAndCustomToolCallOutputType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputType.java new file mode 100644 index 000000000000..b6e53d3ffe93 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputType.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.agents.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/models/FunctionCallItemStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionCallItemStatus.java new file mode 100644 index 000000000000..50f3773a1803 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionCallItemStatus.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.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/models/FunctionShellActionParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellActionParam.java new file mode 100644 index 000000000000..ce115fb917b7 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellActionParam.java @@ -0,0 +1,152 @@ +// 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; + +/** + * 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/models/FunctionShellCallItemStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallItemStatus.java new file mode 100644 index 000000000000..e7d176cbbc40 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallItemStatus.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; + +/** + * 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/models/FunctionShellCallOutputContentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputContentParam.java new file mode 100644 index 000000000000..0c71a3bd60e8 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputContentParam.java @@ -0,0 +1,130 @@ +// 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; + +/** + * 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/models/FunctionShellCallOutputExitOutcomeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputExitOutcomeParam.java new file mode 100644 index 000000000000..7ab703ef7962 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputExitOutcomeParam.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.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; + +/** + * 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/models/FunctionShellCallOutputOutcomeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputOutcomeParam.java new file mode 100644 index 000000000000..9eecfcf9a9ea --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputOutcomeParam.java @@ -0,0 +1,112 @@ +// 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; + +/** + * 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/models/FunctionShellCallOutputOutcomeParamType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputOutcomeParamType.java new file mode 100644 index 000000000000..a93aed2da2e8 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputOutcomeParamType.java @@ -0,0 +1,58 @@ +// 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; + +/** + * 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/models/FunctionShellCallOutputTimeoutOutcomeParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputTimeoutOutcomeParam.java new file mode 100644 index 000000000000..e27e57354c09 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputTimeoutOutcomeParam.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.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/models/FunctionShellToolParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellToolParam.java new file mode 100644 index 000000000000..6fa0c5df531f --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionShellToolParam.java @@ -0,0 +1,80 @@ +// 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; + +/** + * Shell tool + * + * A tool that allows the model to execute shell commands. + */ +@Immutable +public final class FunctionShellToolParam extends Tool { + + /* + * The type property. + */ + @Generated + private ToolType type = ToolType.SHELL; + + /** + * Creates an instance of FunctionShellToolParam class. + */ + @Generated + public FunctionShellToolParam() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public ToolType 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 FunctionShellToolParam from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FunctionShellToolParam 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 FunctionShellToolParam. + */ + @Generated + public static FunctionShellToolParam fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FunctionShellToolParam deserializedFunctionShellToolParam = new FunctionShellToolParam(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedFunctionShellToolParam.type = ToolType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedFunctionShellToolParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionTool.java index 9785b161abc5..bebb0725209d 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionTool.java @@ -10,8 +10,11 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.Map; /** + * Function + * * Defines a function in your own code the model can choose to call. Learn more about [function * calling](https://platform.openai.com/docs/guides/function-calling). */ @@ -31,37 +34,23 @@ public final class FunctionTool extends Tool { private final String name; /* - * A description of the function. Used by the model to determine whether or not to call the function. + * The description property. */ @Generated private String description; /* - * A JSON schema object describing the parameters of the function. + * The parameters property. */ @Generated - private final BinaryData parameters; + private final Map parameters; /* - * Whether to enforce strict parameter validation. Default `true`. + * The strict property. */ @Generated private final Boolean strict; - /** - * Creates an instance of FunctionTool class. - * - * @param name the name value to set. - * @param parameters the parameters value to set. - * @param strict the strict value to set. - */ - @Generated - public FunctionTool(String name, BinaryData parameters, Boolean strict) { - this.name = name; - this.parameters = parameters; - this.strict = strict; - } - /** * Get the type property: The type property. * @@ -84,8 +73,7 @@ public String getName() { } /** - * Get the description property: A description of the function. Used by the model to determine whether or not to - * call the function. + * Get the description property: The description property. * * @return the description value. */ @@ -95,8 +83,7 @@ public String getDescription() { } /** - * Set the description property: A description of the function. Used by the model to determine whether or not to - * call the function. + * Set the description property: The description property. * * @param description the description value to set. * @return the FunctionTool object itself. @@ -108,17 +95,17 @@ public FunctionTool setDescription(String description) { } /** - * Get the parameters property: A JSON schema object describing the parameters of the function. + * Get the parameters property: The parameters property. * * @return the parameters value. */ @Generated - public BinaryData getParameters() { + public Map getParameters() { return this.parameters; } /** - * Get the strict property: Whether to enforce strict parameter validation. Default `true`. + * Get the strict property: The strict property. * * @return the strict value. */ @@ -135,8 +122,8 @@ public Boolean isStrict() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); - jsonWriter.writeFieldName("parameters"); - this.parameters.writeTo(jsonWriter); + jsonWriter.writeMapField("parameters", this.parameters, + (writer, element) -> writer.writeUntyped(element == null ? null : element.toObject(Object.class))); jsonWriter.writeBooleanField("strict", this.strict); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("description", this.description); @@ -156,7 +143,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static FunctionTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String name = null; - BinaryData parameters = null; + Map parameters = null; Boolean strict = null; ToolType type = ToolType.FUNCTION; String description = null; @@ -166,8 +153,8 @@ public static FunctionTool fromJson(JsonReader jsonReader) throws IOException { if ("name".equals(fieldName)) { name = reader.getString(); } else if ("parameters".equals(fieldName)) { - parameters - = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + parameters = reader.readMap(reader1 -> reader1 + .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); } else if ("strict".equals(fieldName)) { strict = reader.getNullable(JsonReader::getBoolean); } else if ("type".equals(fieldName)) { @@ -184,4 +171,18 @@ public static FunctionTool fromJson(JsonReader jsonReader) throws IOException { return deserializedFunctionTool; }); } + + /** + * Creates an instance of FunctionTool class. + * + * @param name the name value to set. + * @param parameters the parameters value to set. + * @param strict the strict value to set. + */ + @Generated + public FunctionTool(String name, Map parameters, Boolean strict) { + this.name = name; + this.parameters = parameters; + this.strict = strict; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionToolCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionToolCallOutputItemParam.java deleted file mode 100644 index 4a9e0e3d66c9..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionToolCallOutputItemParam.java +++ /dev/null @@ -1,127 +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.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The output of a function tool call. - */ -@Immutable -public final class FunctionToolCallOutputItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.FUNCTION_CALL_OUTPUT; - - /* - * The unique ID of the function tool call generated by the model. - */ - @Generated - private final String callId; - - /* - * A JSON string of the output of the function tool call. - */ - @Generated - private final String output; - - /** - * Creates an instance of FunctionToolCallOutputItemParam class. - * - * @param callId the callId value to set. - * @param output the output value to set. - */ - @Generated - public FunctionToolCallOutputItemParam(String callId, String output) { - this.callId = callId; - this.output = output; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * 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: A JSON string of the output of the function tool call. - * - * @return the output value. - */ - @Generated - public String getOutput() { - return this.output; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("call_id", this.callId); - jsonWriter.writeStringField("output", this.output); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of FunctionToolCallOutputItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of FunctionToolCallOutputItemParam 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 FunctionToolCallOutputItemParam. - */ - @Generated - public static FunctionToolCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String callId = null; - String output = null; - ItemType type = ItemType.FUNCTION_CALL_OUTPUT; - 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.getString(); - } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - FunctionToolCallOutputItemParam deserializedFunctionToolCallOutputItemParam - = new FunctionToolCallOutputItemParam(callId, output); - deserializedFunctionToolCallOutputItemParam.type = type; - return deserializedFunctionToolCallOutputItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputAudioFormat.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/GrammarSyntax.java similarity index 51% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputAudioFormat.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/GrammarSyntax.java index 3b2c708509cd..4a67d7d46972 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputAudioFormat.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/GrammarSyntax.java @@ -5,40 +5,40 @@ package com.azure.ai.agents.models; /** - * Defines values for ItemContentInputAudioFormat. + * Defines values for GrammarSyntax. */ -public enum ItemContentInputAudioFormat { +public enum GrammarSyntax { /** - * Enum value mp3. + * Enum value lark. */ - MP3("mp3"), + LARK("lark"), /** - * Enum value wav. + * Enum value regex. */ - WAV("wav"); + REGEX("regex"); /** - * The actual serialized value for a ItemContentInputAudioFormat instance. + * The actual serialized value for a GrammarSyntax instance. */ private final String value; - ItemContentInputAudioFormat(String value) { + GrammarSyntax(String value) { this.value = value; } /** - * Parses a serialized value to a ItemContentInputAudioFormat instance. + * Parses a serialized value to a GrammarSyntax instance. * * @param value the serialized value to parse. - * @return the parsed ItemContentInputAudioFormat object, or null if unable to parse. + * @return the parsed GrammarSyntax object, or null if unable to parse. */ - public static ItemContentInputAudioFormat fromString(String value) { + public static GrammarSyntax fromString(String value) { if (value == null) { return null; } - ItemContentInputAudioFormat[] items = ItemContentInputAudioFormat.values(); - for (ItemContentInputAudioFormat item : items) { + GrammarSyntax[] items = GrammarSyntax.values(); + for (GrammarSyntax 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/HybridSearchOptions.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HybridSearchOptions.java new file mode 100644 index 000000000000..5ac73d993aa3 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/HybridSearchOptions.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; + +/** + * The HybridSearchOptions model. + */ +@Immutable +public final class HybridSearchOptions implements JsonSerializable { + + /* + * The weight of the embedding in the reciprocal ranking fusion. + */ + @Generated + private final double embeddingWeight; + + /* + * The weight of the text in the reciprocal ranking fusion. + */ + @Generated + private final double textWeight; + + /** + * Creates an instance of HybridSearchOptions class. + * + * @param embeddingWeight the embeddingWeight value to set. + * @param textWeight the textWeight value to set. + */ + @Generated + public HybridSearchOptions(double embeddingWeight, double textWeight) { + this.embeddingWeight = embeddingWeight; + this.textWeight = textWeight; + } + + /** + * Get the embeddingWeight property: The weight of the embedding in the reciprocal ranking fusion. + * + * @return the embeddingWeight value. + */ + @Generated + public double getEmbeddingWeight() { + return this.embeddingWeight; + } + + /** + * Get the textWeight property: The weight of the text in the reciprocal ranking fusion. + * + * @return the textWeight value. + */ + @Generated + public double getTextWeight() { + return this.textWeight; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeDoubleField("embedding_weight", this.embeddingWeight); + jsonWriter.writeDoubleField("text_weight", this.textWeight); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of HybridSearchOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of HybridSearchOptions 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 HybridSearchOptions. + */ + @Generated + public static HybridSearchOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + double embeddingWeight = 0.0; + double textWeight = 0.0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("embedding_weight".equals(fieldName)) { + embeddingWeight = reader.getDouble(); + } else if ("text_weight".equals(fieldName)) { + textWeight = reader.getDouble(); + } else { + reader.skipChildren(); + } + } + return new HybridSearchOptions(embeddingWeight, textWeight); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageDetail.java similarity index 52% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionType.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageDetail.java index 87dc1ce56775..1c4fc2fb4fbe 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionType.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageDetail.java @@ -5,45 +5,45 @@ package com.azure.ai.agents.models; /** - * Defines values for WebSearchActionType. + * Defines values for ImageDetail. */ -public enum WebSearchActionType { +public enum ImageDetail { /** - * Enum value search. + * Enum value low. */ - SEARCH("search"), + LOW("low"), /** - * Enum value open_page. + * Enum value high. */ - OPEN_PAGE("open_page"), + HIGH("high"), /** - * Enum value find. + * Enum value auto. */ - FIND("find"); + AUTO("auto"); /** - * The actual serialized value for a WebSearchActionType instance. + * The actual serialized value for a ImageDetail instance. */ private final String value; - WebSearchActionType(String value) { + ImageDetail(String value) { this.value = value; } /** - * Parses a serialized value to a WebSearchActionType instance. + * Parses a serialized value to a ImageDetail instance. * * @param value the serialized value to parse. - * @return the parsed WebSearchActionType object, or null if unable to parse. + * @return the parsed ImageDetail object, or null if unable to parse. */ - public static WebSearchActionType fromString(String value) { + public static ImageDetail fromString(String value) { if (value == null) { return null; } - WebSearchActionType[] items = WebSearchActionType.values(); - for (WebSearchActionType item : items) { + ImageDetail[] items = ImageDetail.values(); + for (ImageDetail 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/ImageGenTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenTool.java index b4473f03592b..ffa11fa5c40a 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 @@ -11,7 +11,9 @@ import java.io.IOException; /** - * A tool that generates images using a model like `gpt-image-1`. + * Image generation tool + * + * A tool that generates images using the GPT image models. */ @Fluent public final class ImageGenTool extends Tool { @@ -23,7 +25,7 @@ public final class ImageGenTool extends Tool { private ToolType type = ToolType.IMAGE_GENERATION; /* - * The image generation model to use. Default: `gpt-image-1`. + * The model property. */ @Generated private ImageGenToolModel model; @@ -53,7 +55,7 @@ public final class ImageGenTool extends Tool { * Compression level for the output image. Default: 100. */ @Generated - private Integer outputCompression; + private Long outputCompression; /* * Moderation level for the generated image. Default: `auto`. @@ -79,7 +81,7 @@ public final class ImageGenTool extends Tool { * Number of partial images to generate in streaming mode, from 0 (default value) to 3. */ @Generated - private Integer partialImages; + private Long partialImages; /** * Creates an instance of ImageGenTool class. @@ -100,7 +102,7 @@ public ToolType getType() { } /** - * Get the model property: The image generation model to use. Default: `gpt-image-1`. + * Get the model property: The model property. * * @return the model value. */ @@ -110,7 +112,7 @@ public ImageGenToolModel getModel() { } /** - * Set the model property: The image generation model to use. Default: `gpt-image-1`. + * Set the model property: The model property. * * @param model the model value to set. * @return the ImageGenTool object itself. @@ -199,22 +201,10 @@ public ImageGenTool setOutputFormat(ImageGenToolOutputFormat outputFormat) { * @return the outputCompression value. */ @Generated - public Integer getOutputCompression() { + public Long getOutputCompression() { return this.outputCompression; } - /** - * Set the outputCompression property: Compression level for the output image. Default: 100. - * - * @param outputCompression the outputCompression value to set. - * @return the ImageGenTool object itself. - */ - @Generated - public ImageGenTool setOutputCompression(Integer outputCompression) { - this.outputCompression = outputCompression; - return this; - } - /** * Get the moderation property: Moderation level for the generated image. Default: `auto`. * @@ -292,23 +282,10 @@ public ImageGenTool setInputImageMask(ImageGenToolInputImageMask inputImageMask) * @return the partialImages value. */ @Generated - public Integer getPartialImages() { + public Long getPartialImages() { return this.partialImages; } - /** - * Set the partialImages property: Number of partial images to generate in streaming mode, from 0 (default value) to - * 3. - * - * @param partialImages the partialImages value to set. - * @return the ImageGenTool object itself. - */ - @Generated - public ImageGenTool setPartialImages(Integer partialImages) { - this.partialImages = partialImages; - return this; - } - /** * {@inheritDoc} */ @@ -324,6 +301,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("output_compression", this.outputCompression); jsonWriter.writeStringField("moderation", this.moderation == null ? null : this.moderation.toString()); jsonWriter.writeStringField("background", this.background == null ? null : this.background.toString()); + jsonWriter.writeStringField("input_fidelity", + this.inputFidelity == null ? null : this.inputFidelity.toString()); jsonWriter.writeJsonField("input_image_mask", this.inputImageMask); jsonWriter.writeNumberField("partial_images", this.partialImages); return jsonWriter.writeEndObject(); @@ -355,15 +334,17 @@ public static ImageGenTool fromJson(JsonReader jsonReader) throws IOException { } else if ("output_format".equals(fieldName)) { deserializedImageGenTool.outputFormat = ImageGenToolOutputFormat.fromString(reader.getString()); } else if ("output_compression".equals(fieldName)) { - deserializedImageGenTool.outputCompression = reader.getNullable(JsonReader::getInt); + deserializedImageGenTool.outputCompression = reader.getNullable(JsonReader::getLong); } else if ("moderation".equals(fieldName)) { deserializedImageGenTool.moderation = ImageGenToolModeration.fromString(reader.getString()); } else if ("background".equals(fieldName)) { deserializedImageGenTool.background = ImageGenToolBackground.fromString(reader.getString()); + } else if ("input_fidelity".equals(fieldName)) { + deserializedImageGenTool.inputFidelity = InputFidelity.fromString(reader.getString()); } else if ("input_image_mask".equals(fieldName)) { deserializedImageGenTool.inputImageMask = ImageGenToolInputImageMask.fromJson(reader); } else if ("partial_images".equals(fieldName)) { - deserializedImageGenTool.partialImages = reader.getNullable(JsonReader::getInt); + deserializedImageGenTool.partialImages = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); } @@ -371,4 +352,57 @@ public static ImageGenTool fromJson(JsonReader jsonReader) throws IOException { return deserializedImageGenTool; }); } + + /* + * The input_fidelity property. + */ + @Generated + private InputFidelity inputFidelity; + + /** + * Set the outputCompression property: Compression level for the output image. Default: 100. + * + * @param outputCompression the outputCompression value to set. + * @return the ImageGenTool object itself. + */ + @Generated + public ImageGenTool setOutputCompression(Long outputCompression) { + this.outputCompression = outputCompression; + return this; + } + + /** + * Get the inputFidelity property: The input_fidelity property. + * + * @return the inputFidelity value. + */ + @Generated + public InputFidelity getInputFidelity() { + return this.inputFidelity; + } + + /** + * Set the inputFidelity property: The input_fidelity property. + * + * @param inputFidelity the inputFidelity value to set. + * @return the ImageGenTool object itself. + */ + @Generated + public ImageGenTool setInputFidelity(InputFidelity inputFidelity) { + this.inputFidelity = inputFidelity; + return this; + } + + /** + * Set the partialImages property: Number of partial images to generate in streaming mode, from 0 (default value) to + * 3. + * + * @param partialImages the partialImages value to set. + * @return the ImageGenTool object itself. + */ + @Generated + public ImageGenTool setPartialImages(Long partialImages) { + this.partialImages = partialImages; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolCallItemParam.java deleted file mode 100644 index 199c3ac329b6..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolCallItemParam.java +++ /dev/null @@ -1,104 +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.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An image generation request made by the model. - */ -@Immutable -public final class ImageGenToolCallItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.IMAGE_GENERATION_CALL; - - /* - * The generated image encoded in base64. - */ - @Generated - private final String result; - - /** - * Creates an instance of ImageGenToolCallItemParam class. - * - * @param result the result value to set. - */ - @Generated - public ImageGenToolCallItemParam(String result) { - this.result = result; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the result property: The generated image encoded in base64. - * - * @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("result", this.result); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ImageGenToolCallItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ImageGenToolCallItemParam 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 ImageGenToolCallItemParam. - */ - @Generated - public static ImageGenToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String result = null; - ItemType type = ItemType.IMAGE_GENERATION_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("result".equals(fieldName)) { - result = reader.getString(); - } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ImageGenToolCallItemParam deserializedImageGenToolCallItemParam = new ImageGenToolCallItemParam(result); - deserializedImageGenToolCallItemParam.type = type; - return deserializedImageGenToolCallItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolInputImageMask.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolInputImageMask.java index c462f3de3591..57a84b5f976f 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolInputImageMask.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolInputImageMask.java @@ -18,13 +18,13 @@ public final class ImageGenToolInputImageMask implements JsonSerializable { /* - * Base64-encoded mask image. + * The image_url property. */ @Generated private String imageUrl; /* - * File ID for the mask image. + * The file_id property. */ @Generated private String fileId; @@ -37,7 +37,7 @@ public ImageGenToolInputImageMask() { } /** - * Get the imageUrl property: Base64-encoded mask image. + * Get the imageUrl property: The image_url property. * * @return the imageUrl value. */ @@ -47,7 +47,7 @@ public String getImageUrl() { } /** - * Set the imageUrl property: Base64-encoded mask image. + * Set the imageUrl property: The image_url property. * * @param imageUrl the imageUrl value to set. * @return the ImageGenToolInputImageMask object itself. @@ -59,7 +59,7 @@ public ImageGenToolInputImageMask setImageUrl(String imageUrl) { } /** - * Get the fileId property: File ID for the mask image. + * Get the fileId property: The file_id property. * * @return the fileId value. */ @@ -69,7 +69,7 @@ public String getFileId() { } /** - * Set the fileId property: File ID for the mask image. + * Set the fileId property: The file_id property. * * @param fileId the fileId value to set. * @return the ImageGenToolInputImageMask object itself. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolModel.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolModel.java index 2ab0aa1af072..b4e639e4669b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolModel.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolModel.java @@ -1,51 +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; + /** * Defines values for ImageGenToolModel. */ -public enum ImageGenToolModel { +public final class ImageGenToolModel extends ExpandableStringEnum { + /** - * Enum value gpt-image-1. + * Static value gpt-image-1 for ImageGenToolModel. */ - GPT_IMAGE_1("gpt-image-1"); + @Generated + public static final ImageGenToolModel GPT_IMAGE_1 = fromString("gpt-image-1"); /** - * The actual serialized value for a ImageGenToolModel instance. + * Static value gpt-image-1-mini for ImageGenToolModel. */ - private final String value; + @Generated + public static final ImageGenToolModel GPT_IMAGE_1_MINI = fromString("gpt-image-1-mini"); - ImageGenToolModel(String value) { - this.value = value; + /** + * Creates a new instance of ImageGenToolModel value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ImageGenToolModel() { } /** - * Parses a serialized value to a ImageGenToolModel instance. - * - * @param value the serialized value to parse. - * @return the parsed ImageGenToolModel object, or null if unable to parse. + * Creates or finds a ImageGenToolModel from its string representation. + * + * @param name a name to look for. + * @return the corresponding ImageGenToolModel. */ - public static ImageGenToolModel fromString(String value) { - if (value == null) { - return null; - } - ImageGenToolModel[] items = ImageGenToolModel.values(); - for (ImageGenToolModel item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; + @Generated + public static ImageGenToolModel fromString(String name) { + return fromString(name, ImageGenToolModel.class); } /** - * {@inheritDoc} + * Gets known ImageGenToolModel values. + * + * @return known ImageGenToolModel values. */ - @Override - public String toString() { - return this.value; + @Generated + public static Collection values() { + return values(ImageGenToolModel.class); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolSize.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolSize.java index 432dcf104855..d47af1399a7a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolSize.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ImageGenToolSize.java @@ -1,25 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) TypeSpec Code Generator. + package com.azure.ai.agents.models; /** * Defines values for ImageGenToolSize. */ public enum ImageGenToolSize { - /** * Enum value 1024x1024. */ - SIZE_1024X1024("1024x1024"), + ONE_ZERO_TWO_FOURX_ONE_ZERO_TWO_FOUR("1024x1024"), + /** * Enum value 1024x1536. */ - SIZE_1024X1536("1024x1536"), + ONE_ZERO_TWO_FOURX_ONE_FIVE_THREE_SIX("1024x1536"), + /** * Enum value 1536x1024. */ - SIZE_1536X1024("1536x1024"), + ONE_FIVE_THREE_SIXX_ONE_ZERO_TWO_FOUR("1536x1024"), + /** * Enum value auto. */ @@ -36,7 +39,7 @@ public enum ImageGenToolSize { /** * Parses a serialized value to a ImageGenToolSize instance. - * + * * @param value the serialized value to parse. * @return the parsed ImageGenToolSize object, or null if unable to parse. */ diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/IncludeEnum.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/IncludeEnum.java new file mode 100644 index 000000000000..2bdd1d627ee3 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/IncludeEnum.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.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Specify additional output data to include in the model response. Currently supported values are: + * - `web_search_call.action.sources`: Include the sources of the web search tool call. + * - `code_interpreter_call.outputs`: Includes the outputs of python code execution in code interpreter tool call items. + * - `computer_call_output.output.image_url`: Include image urls from the computer call output. + * - `file_search_call.results`: Include the search results of the file search tool call. + * - `message.input_image.image_url`: Include image urls from the input message. + * - `message.output_text.logprobs`: Include logprobs with assistant messages. + * - `reasoning.encrypted_content`: Includes an encrypted version of reasoning tokens in reasoning item outputs. This + * enables reasoning items to be used in multi-turn conversations when using the Responses API statelessly (like when + * the `store` parameter is set to `false`, or when an organization is enrolled in the zero data retention program). + */ +public final class IncludeEnum extends ExpandableStringEnum { + + /** + * Static value file_search_call.results for IncludeEnum. + */ + @Generated + public static final IncludeEnum FILE_SEARCH_CALL_RESULTS = fromString("file_search_call.results"); + + /** + * Static value web_search_call.results for IncludeEnum. + */ + @Generated + public static final IncludeEnum WEB_SEARCH_CALL_RESULTS = fromString("web_search_call.results"); + + /** + * Static value web_search_call.action.sources for IncludeEnum. + */ + @Generated + public static final IncludeEnum WEB_SEARCH_CALL_ACTION_SOURCES = fromString("web_search_call.action.sources"); + + /** + * Static value message.input_image.image_url for IncludeEnum. + */ + @Generated + public static final IncludeEnum MESSAGE_INPUT_IMAGE_IMAGE_URL = fromString("message.input_image.image_url"); + + /** + * Static value computer_call_output.output.image_url for IncludeEnum. + */ + @Generated + public static final IncludeEnum COMPUTER_CALL_OUTPUT_OUTPUT_IMAGE_URL + = fromString("computer_call_output.output.image_url"); + + /** + * Static value code_interpreter_call.outputs for IncludeEnum. + */ + @Generated + public static final IncludeEnum CODE_INTERPRETER_CALL_OUTPUTS = fromString("code_interpreter_call.outputs"); + + /** + * Static value reasoning.encrypted_content for IncludeEnum. + */ + @Generated + public static final IncludeEnum REASONING_ENCRYPTED_CONTENT = fromString("reasoning.encrypted_content"); + + /** + * Static value message.output_text.logprobs for IncludeEnum. + */ + @Generated + public static final IncludeEnum MESSAGE_OUTPUT_TEXT_LOGPROBS = fromString("message.output_text.logprobs"); + + /** + * Static value memory_search_call.results for IncludeEnum. + */ + @Generated + public static final IncludeEnum MEMORY_SEARCH_CALL_RESULTS = fromString("memory_search_call.results"); + + /** + * Creates a new instance of IncludeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public IncludeEnum() { + } + + /** + * Creates or finds a IncludeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding IncludeEnum. + */ + @Generated + public static IncludeEnum fromString(String name) { + return fromString(name, IncludeEnum.class); + } + + /** + * Gets known IncludeEnum values. + * + * @return known IncludeEnum values. + */ + @Generated + public static Collection values() { + return values(IncludeEnum.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContent.java similarity index 65% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchAction.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContent.java index e114f3b5cbbb..95ad9073045e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchAction.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContent.java @@ -12,22 +12,22 @@ import java.io.IOException; /** - * The WebSearchAction model. + * The InputContent model. */ @Immutable -public class WebSearchAction implements JsonSerializable { +public class InputContent implements JsonSerializable { /* * The type property. */ @Generated - private WebSearchActionType type; + private InputContentType type = InputContentType.fromString("InputContent"); /** - * Creates an instance of WebSearchAction class. + * Creates an instance of InputContent class. */ @Generated - public WebSearchAction() { + public InputContent() { } /** @@ -36,7 +36,7 @@ public WebSearchAction() { * @return the type value. */ @Generated - public WebSearchActionType getType() { + public InputContentType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of WebSearchAction from the JsonReader. + * Reads an instance of InputContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of WebSearchAction if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of InputContent 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 WebSearchAction. + * @throws IOException If an error occurs while reading the InputContent. */ @Generated - public static WebSearchAction fromJson(JsonReader jsonReader) throws IOException { + public static InputContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,12 +77,12 @@ public static WebSearchAction fromJson(JsonReader jsonReader) throws IOException } } // Use the discriminator value to determine which subtype should be deserialized. - if ("find".equals(discriminatorValue)) { - return WebSearchActionFind.fromJson(readerToUse.reset()); - } else if ("open_page".equals(discriminatorValue)) { - return WebSearchActionOpenPage.fromJson(readerToUse.reset()); - } else if ("search".equals(discriminatorValue)) { - return WebSearchActionSearch.fromJson(readerToUse.reset()); + 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()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -91,19 +91,19 @@ public static WebSearchAction fromJson(JsonReader jsonReader) throws IOException } @Generated - static WebSearchAction fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static InputContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - WebSearchAction deserializedWebSearchAction = new WebSearchAction(); + InputContent deserializedInputContent = new InputContent(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedWebSearchAction.type = WebSearchActionType.fromString(reader.getString()); + deserializedInputContent.type = InputContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedWebSearchAction; + return deserializedInputContent; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputFile.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputFileContent.java similarity index 56% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputFile.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputFileContent.java index 75f4d433be70..ba45b2f844f3 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputFile.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputFileContent.java @@ -11,19 +11,21 @@ import java.io.IOException; /** + * Input file + * * A file input to the model. */ @Fluent -public final class ItemContentInputFile extends ItemContent { +public final class InputContentInputFileContent extends InputContent { /* * The type property. */ @Generated - private ItemContentType type = ItemContentType.INPUT_FILE; + private InputContentType type = InputContentType.INPUT_FILE; /* - * The ID of the file to be sent to the model. + * The file_id property. */ @Generated private String fileId; @@ -34,6 +36,12 @@ public final class ItemContentInputFile extends ItemContent { @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. */ @@ -41,10 +49,10 @@ public final class ItemContentInputFile extends ItemContent { private String fileData; /** - * Creates an instance of ItemContentInputFile class. + * Creates an instance of InputContentInputFileContent class. */ @Generated - public ItemContentInputFile() { + public InputContentInputFileContent() { } /** @@ -54,12 +62,12 @@ public ItemContentInputFile() { */ @Generated @Override - public ItemContentType getType() { + public InputContentType getType() { return this.type; } /** - * Get the fileId property: The ID of the file to be sent to the model. + * Get the fileId property: The file_id property. * * @return the fileId value. */ @@ -69,13 +77,13 @@ public String getFileId() { } /** - * Set the fileId property: The ID of the file to be sent to the model. + * Set the fileId property: The file_id property. * * @param fileId the fileId value to set. - * @return the ItemContentInputFile object itself. + * @return the InputContentInputFileContent object itself. */ @Generated - public ItemContentInputFile setFileId(String fileId) { + public InputContentInputFileContent setFileId(String fileId) { this.fileId = fileId; return this; } @@ -94,14 +102,36 @@ public String getFilename() { * Set the filename property: The name of the file to be sent to the model. * * @param filename the filename value to set. - * @return the ItemContentInputFile object itself. + * @return the InputContentInputFileContent object itself. */ @Generated - public ItemContentInputFile setFilename(String filename) { + 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. * @@ -116,10 +146,10 @@ public String getFileData() { * Set the fileData property: The content of the file to be sent to the model. * * @param fileData the fileData value to set. - * @return the ItemContentInputFile object itself. + * @return the InputContentInputFileContent object itself. */ @Generated - public ItemContentInputFile setFileData(String fileData) { + public InputContentInputFileContent setFileData(String fileData) { this.fileData = fileData; return this; } @@ -134,38 +164,41 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { 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 ItemContentInputFile from the JsonReader. + * Reads an instance of InputContentInputFileContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentInputFile 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 ItemContentInputFile. + * @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 ItemContentInputFile fromJson(JsonReader jsonReader) throws IOException { + public static InputContentInputFileContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ItemContentInputFile deserializedItemContentInputFile = new ItemContentInputFile(); + InputContentInputFileContent deserializedInputContentInputFileContent = new InputContentInputFileContent(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedItemContentInputFile.type = ItemContentType.fromString(reader.getString()); + deserializedInputContentInputFileContent.type = InputContentType.fromString(reader.getString()); } else if ("file_id".equals(fieldName)) { - deserializedItemContentInputFile.fileId = reader.getString(); + deserializedInputContentInputFileContent.fileId = reader.getString(); } else if ("filename".equals(fieldName)) { - deserializedItemContentInputFile.filename = reader.getString(); + deserializedInputContentInputFileContent.filename = reader.getString(); + } else if ("file_url".equals(fieldName)) { + deserializedInputContentInputFileContent.fileUrl = reader.getString(); } else if ("file_data".equals(fieldName)) { - deserializedItemContentInputFile.fileData = reader.getString(); + deserializedInputContentInputFileContent.fileData = reader.getString(); } else { reader.skipChildren(); } } - return deserializedItemContentInputFile; + return deserializedInputContentInputFileContent; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputImage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputImageContent.java similarity index 54% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputImage.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputImageContent.java index fae5378760e2..0ca49e682466 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputImage.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputImageContent.java @@ -11,25 +11,27 @@ import java.io.IOException; /** + * Input image + * * An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). */ @Fluent -public final class ItemContentInputImage extends ItemContent { +public final class InputContentInputImageContent extends InputContent { /* * The type property. */ @Generated - private ItemContentType type = ItemContentType.INPUT_IMAGE; + private InputContentType type = InputContentType.INPUT_IMAGE; /* - * The URL of the image to be sent to the model. A fully qualified URL or base64 encoded image in a data URL. + * The image_url property. */ @Generated private String imageUrl; /* - * The ID of the file to be sent to the model. + * The file_id property. */ @Generated private String fileId; @@ -38,13 +40,16 @@ public final class ItemContentInputImage extends ItemContent { * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. */ @Generated - private ItemContentInputImageDetail detail; + private final ImageDetail detail; /** - * Creates an instance of ItemContentInputImage class. + * Creates an instance of InputContentInputImageContent class. + * + * @param detail the detail value to set. */ @Generated - public ItemContentInputImage() { + public InputContentInputImageContent(ImageDetail detail) { + this.detail = detail; } /** @@ -54,13 +59,12 @@ public ItemContentInputImage() { */ @Generated @Override - public ItemContentType getType() { + public InputContentType getType() { return this.type; } /** - * Get the imageUrl property: The URL of the image to be sent to the model. A fully qualified URL or base64 encoded - * image in a data URL. + * Get the imageUrl property: The image_url property. * * @return the imageUrl value. */ @@ -70,20 +74,19 @@ public String getImageUrl() { } /** - * Set the imageUrl property: The URL of the image to be sent to the model. A fully qualified URL or base64 encoded - * image in a data URL. + * Set the imageUrl property: The image_url property. * * @param imageUrl the imageUrl value to set. - * @return the ItemContentInputImage object itself. + * @return the InputContentInputImageContent object itself. */ @Generated - public ItemContentInputImage setImageUrl(String imageUrl) { + public InputContentInputImageContent setImageUrl(String imageUrl) { this.imageUrl = imageUrl; return this; } /** - * Get the fileId property: The ID of the file to be sent to the model. + * Get the fileId property: The file_id property. * * @return the fileId value. */ @@ -93,13 +96,13 @@ public String getFileId() { } /** - * Set the fileId property: The ID of the file to be sent to the model. + * Set the fileId property: The file_id property. * * @param fileId the fileId value to set. - * @return the ItemContentInputImage object itself. + * @return the InputContentInputImageContent object itself. */ @Generated - public ItemContentInputImage setFileId(String fileId) { + public InputContentInputImageContent setFileId(String fileId) { this.fileId = fileId; return this; } @@ -111,23 +114,10 @@ public ItemContentInputImage setFileId(String fileId) { * @return the detail value. */ @Generated - public ItemContentInputImageDetail getDetail() { + public ImageDetail getDetail() { return this.detail; } - /** - * Set the detail property: The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. - * Defaults to `auto`. - * - * @param detail the detail value to set. - * @return the ItemContentInputImage object itself. - */ - @Generated - public ItemContentInputImage setDetail(ItemContentInputImageDetail detail) { - this.detail = detail; - return this; - } - /** * {@inheritDoc} */ @@ -135,42 +125,50 @@ public ItemContentInputImage setDetail(ItemContentInputImageDetail detail) { @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); - jsonWriter.writeStringField("detail", this.detail == null ? null : this.detail.toString()); return jsonWriter.writeEndObject(); } /** - * Reads an instance of ItemContentInputImage from the JsonReader. + * Reads an instance of InputContentInputImageContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentInputImage 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 ItemContentInputImage. + * @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 ItemContentInputImage fromJson(JsonReader jsonReader) throws IOException { + public static InputContentInputImageContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ItemContentInputImage deserializedItemContentInputImage = new ItemContentInputImage(); + 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 ("type".equals(fieldName)) { - deserializedItemContentInputImage.type = ItemContentType.fromString(reader.getString()); + 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)) { - deserializedItemContentInputImage.imageUrl = reader.getString(); + imageUrl = reader.getString(); } else if ("file_id".equals(fieldName)) { - deserializedItemContentInputImage.fileId = reader.getString(); - } else if ("detail".equals(fieldName)) { - deserializedItemContentInputImage.detail - = ItemContentInputImageDetail.fromString(reader.getString()); + fileId = reader.getString(); } else { reader.skipChildren(); } } - return deserializedItemContentInputImage; + 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/models/ReasoningItemSummaryTextPart.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputTextContent.java similarity index 66% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryTextPart.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputTextContent.java index 613729f0c319..c4abfa1a669b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryTextPart.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentInputTextContent.java @@ -11,30 +11,32 @@ import java.io.IOException; /** - * The ReasoningItemSummaryTextPart model. + * Input text + * + * A text input to the model. */ @Immutable -public final class ReasoningItemSummaryTextPart extends ReasoningItemSummaryPart { +public final class InputContentInputTextContent extends InputContent { /* * The type property. */ @Generated - private ReasoningItemSummaryPartType type = ReasoningItemSummaryPartType.SUMMARY_TEXT; + private InputContentType type = InputContentType.INPUT_TEXT; /* - * The text property. + * The text input to the model. */ @Generated private final String text; /** - * Creates an instance of ReasoningItemSummaryTextPart class. + * Creates an instance of InputContentInputTextContent class. * * @param text the text value to set. */ @Generated - public ReasoningItemSummaryTextPart(String text) { + public InputContentInputTextContent(String text) { this.text = text; } @@ -45,12 +47,12 @@ public ReasoningItemSummaryTextPart(String text) { */ @Generated @Override - public ReasoningItemSummaryPartType getType() { + public InputContentType getType() { return this.type; } /** - * Get the text property: The text property. + * Get the text property: The text input to the model. * * @return the text value. */ @@ -72,34 +74,34 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ReasoningItemSummaryTextPart from the JsonReader. + * Reads an instance of InputContentInputTextContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ReasoningItemSummaryTextPart if the JsonReader was pointing to an instance of it, or null + * @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 ReasoningItemSummaryTextPart. + * @throws IOException If an error occurs while reading the InputContentInputTextContent. */ @Generated - public static ReasoningItemSummaryTextPart fromJson(JsonReader jsonReader) throws IOException { + public static InputContentInputTextContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String text = null; - ReasoningItemSummaryPartType type = ReasoningItemSummaryPartType.SUMMARY_TEXT; + 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 = ReasoningItemSummaryPartType.fromString(reader.getString()); + type = InputContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ReasoningItemSummaryTextPart deserializedReasoningItemSummaryTextPart - = new ReasoningItemSummaryTextPart(text); - deserializedReasoningItemSummaryTextPart.type = type; - return deserializedReasoningItemSummaryTextPart; + 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/models/InputContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentType.java new file mode 100644 index 000000000000..2bb9e8959d06 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputContentType.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; + +/** + * 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/models/InputFidelity.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputFidelity.java new file mode 100644 index 000000000000..cc70c35c80b7 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputFidelity.java @@ -0,0 +1,58 @@ +// 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; + +/** + * Control how much effort the model will exert to match the style and features, especially facial features, of input + * images. This parameter is only supported for `gpt-image-1`. Unsupported for `gpt-image-1-mini`. Supports `high` and + * `low`. Defaults to `low`. + */ +public enum InputFidelity { + /** + * Enum value high. + */ + HIGH("high"), + + /** + * Enum value low. + */ + LOW("low"); + + /** + * The actual serialized value for a InputFidelity instance. + */ + private final String value; + + InputFidelity(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a InputFidelity instance. + * + * @param value the serialized value to parse. + * @return the parsed InputFidelity object, or null if unable to parse. + */ + public static InputFidelity fromString(String value) { + if (value == null) { + return null; + } + InputFidelity[] items = InputFidelity.values(); + for (InputFidelity 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/InputFileContentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputFileContentParam.java new file mode 100644 index 000000000000..f2b5df825028 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputFileContentParam.java @@ -0,0 +1,203 @@ +// 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; + +/** + * 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/models/InputImageContentParamAutoParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputImageContentParamAutoParam.java new file mode 100644 index 000000000000..b7c77e7dfd6f --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputImageContentParamAutoParam.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.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; + +/** + * Input image + * + * An image input to the model. Learn about [image inputs](https://platform.openai.com/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 DetailEnum 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 DetailEnum 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(DetailEnum 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 = DetailEnum.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedInputImageContentParamAutoParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItem.java similarity index 54% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItem.java index bdc828282bab..e5d780033015 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItem.java @@ -3,6 +3,8 @@ // Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.ai.agents.models; +import com.azure.ai.agents.implementation.models.EasyInputMessage; +import com.azure.ai.agents.implementation.models.ItemReferenceParam; import com.azure.core.annotation.Generated; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -12,22 +14,24 @@ import java.io.IOException; /** - * Content item used to generate a response. + * 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 ItemParam implements JsonSerializable { +public class InputItem implements JsonSerializable { /* * The type property. */ @Generated - private ItemType type = ItemType.fromString("ItemParam"); + private InputItemType type = InputItemType.fromString("InputItem"); /** - * Creates an instance of ItemParam class. + * Creates an instance of InputItem class. */ @Generated - public ItemParam() { + public InputItem() { } /** @@ -36,7 +40,7 @@ public ItemParam() { * @return the type value. */ @Generated - public ItemType getType() { + public InputItemType getType() { return this.type; } @@ -52,15 +56,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ItemParam from the JsonReader. + * Reads an instance of InputItem from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemParam if the JsonReader was pointing to an instance of it, or null if it was pointing + * @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 ItemParam. + * @throws IOException If an error occurs while reading the InputItem. */ @Generated - public static ItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItem fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -78,41 +82,55 @@ public static ItemParam fromJson(JsonReader jsonReader) throws IOException { } // Use the discriminator value to determine which subtype should be deserialized. if ("message".equals(discriminatorValue)) { - return ResponsesMessageItemParam.fromJson(readerToUse.reset()); - } else if ("function_call_output".equals(discriminatorValue)) { - return FunctionToolCallOutputItemParam.fromJson(readerToUse.reset()); + 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 FileSearchToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemFileSearchToolCall.fromJson(readerToUse.reset()); } else if ("computer_call".equals(discriminatorValue)) { - return ComputerToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemComputerToolCall.fromJson(readerToUse.reset()); } else if ("computer_call_output".equals(discriminatorValue)) { - return ComputerToolCallOutputItemParam.fromJson(readerToUse.reset()); + return InputItemComputerCallOutputItemParam.fromJson(readerToUse.reset()); } else if ("web_search_call".equals(discriminatorValue)) { - return WebSearchToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemWebSearchToolCall.fromJson(readerToUse.reset()); } else if ("function_call".equals(discriminatorValue)) { - return FunctionToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemFunctionToolCall.fromJson(readerToUse.reset()); + } else if ("function_call_output".equals(discriminatorValue)) { + return InputItemFunctionCallOutputItemParam.fromJson(readerToUse.reset()); } else if ("reasoning".equals(discriminatorValue)) { - return ReasoningItemParam.fromJson(readerToUse.reset()); - } else if ("item_reference".equals(discriminatorValue)) { - return ItemReferenceItemParam.fromJson(readerToUse.reset()); + return InputItemReasoningItem.fromJson(readerToUse.reset()); + } else if ("compaction".equals(discriminatorValue)) { + return InputItemCompactionSummaryItemParam.fromJson(readerToUse.reset()); } else if ("image_generation_call".equals(discriminatorValue)) { - return ImageGenToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemImageGenToolCall.fromJson(readerToUse.reset()); } else if ("code_interpreter_call".equals(discriminatorValue)) { - return CodeInterpreterToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemCodeInterpreterToolCall.fromJson(readerToUse.reset()); } else if ("local_shell_call".equals(discriminatorValue)) { - return LocalShellToolCallItemParam.fromJson(readerToUse.reset()); + return InputItemLocalShellToolCall.fromJson(readerToUse.reset()); } else if ("local_shell_call_output".equals(discriminatorValue)) { - return LocalShellToolCallOutputItemParam.fromJson(readerToUse.reset()); + 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 MCPListToolsItemParam.fromJson(readerToUse.reset()); + return InputItemMcpListTools.fromJson(readerToUse.reset()); } else if ("mcp_approval_request".equals(discriminatorValue)) { - return MCPApprovalRequestItemParam.fromJson(readerToUse.reset()); + return InputItemMcpApprovalRequest.fromJson(readerToUse.reset()); } else if ("mcp_approval_response".equals(discriminatorValue)) { - return MCPApprovalResponseItemParam.fromJson(readerToUse.reset()); + return InputItemMcpApprovalResponse.fromJson(readerToUse.reset()); } else if ("mcp_call".equals(discriminatorValue)) { - return MCPCallItemParam.fromJson(readerToUse.reset()); - } else if ("memory_search_call".equals(discriminatorValue)) { - return MemorySearchToolCallItemParam.fromJson(readerToUse.reset()); + 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()); } @@ -121,19 +139,19 @@ public static ItemParam fromJson(JsonReader jsonReader) throws IOException { } @Generated - static ItemParam fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static InputItem fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ItemParam deserializedItemParam = new ItemParam(); + InputItem deserializedInputItem = new InputItem(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedItemParam.type = ItemType.fromString(reader.getString()); + deserializedInputItem.type = InputItemType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedItemParam; + return deserializedInputItem; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallItemParam.java new file mode 100644 index 000000000000..00c6e4a5ed07 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallItemParam.java @@ -0,0 +1,185 @@ +// 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; + +/** + * 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/models/InputItemApplyPatchToolCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallOutputItemParam.java new file mode 100644 index 000000000000..2d70a47156d1 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallOutputItemParam.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.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/models/InputItemCodeInterpreterToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCodeInterpreterToolCall.java new file mode 100644 index 000000000000..c4253c49e6e9 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCodeInterpreterToolCall.java @@ -0,0 +1,202 @@ +// 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.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 OutputItemCodeInterpreterToolCallStatus 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; + + /** + * 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, OutputItemCodeInterpreterToolCallStatus status, + String containerId, String code, List outputs) { + this.id = id; + this.status = status; + this.containerId = containerId; + this.code = code; + this.outputs = 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 OutputItemCodeInterpreterToolCallStatus 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) -> writer.writeUntyped(element == null ? null : element.toObject(Object.class))); + 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; + OutputItemCodeInterpreterToolCallStatus 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 = OutputItemCodeInterpreterToolCallStatus.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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCompactionSummaryItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCompactionSummaryItemParam.java new file mode 100644 index 000000000000..5f25def75d42 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCompactionSummaryItemParam.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.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; + +/** + * Compaction item + * + * A compaction item generated by the [`v1/responses/compact` + * API](https://platform.openai.com/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/models/InputItemComputerCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemComputerCallOutputItemParam.java new file mode 100644 index 000000000000..7a566d7952d7 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemComputerCallOutputItemParam.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.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; + +/** + * 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/models/ComputerToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemComputerToolCall.java similarity index 57% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemComputerToolCall.java index bcc74b406d9c..02ac65cfb390 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerToolCallItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemComputerToolCall.java @@ -12,17 +12,25 @@ import java.util.List; /** + * Computer tool call + * * A tool call to a computer use tool. See the * [computer use guide](https://platform.openai.com/docs/guides/tools-computer-use) for more information. */ @Immutable -public final class ComputerToolCallItemParam extends ItemParam { +public final class InputItemComputerToolCall extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.COMPUTER_CALL; + 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. @@ -40,21 +48,32 @@ public final class ComputerToolCallItemParam extends ItemParam { * The pending safety checks for the computer call. */ @Generated - private final List pendingSafetyChecks; + 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 OutputItemComputerToolCallStatus status; /** - * Creates an instance of ComputerToolCallItemParam class. + * 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 ComputerToolCallItemParam(String callId, ComputerAction action, - List pendingSafetyChecks) { + public InputItemComputerToolCall(String id, String callId, ComputerAction action, + List pendingSafetyChecks, OutputItemComputerToolCallStatus status) { + this.id = id; this.callId = callId; this.action = action; this.pendingSafetyChecks = pendingSafetyChecks; + this.status = status; } /** @@ -64,10 +83,20 @@ public ComputerToolCallItemParam(String callId, ComputerAction action, */ @Generated @Override - public ItemType getType() { + 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. * @@ -94,10 +123,21 @@ public ComputerAction getAction() { * @return the pendingSafetyChecks value. */ @Generated - public List getPendingSafetyChecks() { + 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 OutputItemComputerToolCallStatus getStatus() { + return this.status; + } + /** * {@inheritDoc} */ @@ -105,49 +145,57 @@ public List getPendingSafetyChecks() { @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 ComputerToolCallItemParam from the JsonReader. + * Reads an instance of InputItemComputerToolCall from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerToolCallItemParam if the JsonReader was pointing to an instance of it, or null if + * @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 ComputerToolCallItemParam. + * @throws IOException If an error occurs while reading the InputItemComputerToolCall. */ @Generated - public static ComputerToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemComputerToolCall fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { + String id = null; String callId = null; ComputerAction action = null; - List pendingSafetyChecks = null; - ItemType type = ItemType.COMPUTER_CALL; + List pendingSafetyChecks = null; + OutputItemComputerToolCallStatus status = null; + InputItemType type = InputItemType.COMPUTER_CALL; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("call_id".equals(fieldName)) { + 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 -> ComputerToolCallSafetyCheck.fromJson(reader1)); + pendingSafetyChecks = reader.readArray(reader1 -> ComputerCallSafetyCheckParam.fromJson(reader1)); + } else if ("status".equals(fieldName)) { + status = OutputItemComputerToolCallStatus.fromString(reader.getString()); } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ComputerToolCallItemParam deserializedComputerToolCallItemParam - = new ComputerToolCallItemParam(callId, action, pendingSafetyChecks); - deserializedComputerToolCallItemParam.type = type; - return deserializedComputerToolCallItemParam; + InputItemComputerToolCall deserializedInputItemComputerToolCall + = new InputItemComputerToolCall(id, callId, action, pendingSafetyChecks, status); + deserializedInputItemComputerToolCall.type = type; + return deserializedInputItemComputerToolCall; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCustomToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCustomToolCall.java new file mode 100644 index 000000000000..68a4d4229279 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCustomToolCall.java @@ -0,0 +1,184 @@ +// 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; + +/** + * 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/models/InputItemCustomToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCustomToolCallOutput.java new file mode 100644 index 000000000000..66092d33bded --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemCustomToolCallOutput.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.core.util.BinaryData; +import com.azure.json.JsonReader; +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. + */ +@Fluent +public final class InputItemCustomToolCallOutput extends InputItem { + + /* + * The type property. + */ + @Generated + private InputItemType type = InputItemType.CUSTOM_TOOL_CALL_OUTPUT; + + /* + * The unique ID of the custom tool call output in the OpenAI platform. + */ + @Generated + private String id; + + /* + * The call ID, used to map this custom tool call output to a custom tool call. + */ + @Generated + private final String callId; + + /* + * The output from the custom tool call generated by your code. + * Can be a string or an list of output content. + */ + @Generated + private final BinaryData output; + + /** + * Creates an instance of InputItemCustomToolCallOutput class. + * + * @param callId the callId value to set. + * @param output the output value to set. + */ + @Generated + public InputItemCustomToolCallOutput(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 unique ID of the custom tool call output 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 output in the OpenAI platform. + * + * @param id the id value to set. + * @return the InputItemCustomToolCallOutput object itself. + */ + @Generated + public InputItemCustomToolCallOutput setId(String id) { + this.id = id; + return this; + } + + /** + * Get the callId property: The call ID, used to map this custom tool call output to a custom tool call. + * + * @return the callId value. + */ + @Generated + public String getCallId() { + return this.callId; + } + + /** + * 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. + * + * @return the output value. + */ + @Generated + public BinaryData getOutput() { + return this.output; + } + + /** + * {@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); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of InputItemCustomToolCallOutput 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 + * 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. + */ + @Generated + public static InputItemCustomToolCallOutput fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String callId = 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 ("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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFileSearchToolCall.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFileSearchToolCall.java index a4ef1ac9615b..7ad7f2cce4d6 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFileSearchToolCall.java @@ -12,17 +12,32 @@ import java.util.List; /** + * File search tool call + * * The results of a file search tool call. See the * [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. */ @Fluent -public final class FileSearchToolCallItemParam extends ItemParam { +public final class InputItemFileSearchToolCall extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.FILE_SEARCH_CALL; + 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 OutputItemFileSearchToolCallStatus status; /* * The queries used to search for files. @@ -31,18 +46,22 @@ public final class FileSearchToolCallItemParam extends ItemParam { private final List queries; /* - * The results of the file search tool call. + * The results property. */ @Generated - private List results; + private List results; /** - * Creates an instance of FileSearchToolCallItemParam class. + * 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 FileSearchToolCallItemParam(List queries) { + public InputItemFileSearchToolCall(String id, OutputItemFileSearchToolCallStatus status, List queries) { + this.id = id; + this.status = status; this.queries = queries; } @@ -53,10 +72,31 @@ public FileSearchToolCallItemParam(List queries) { */ @Generated @Override - public ItemType getType() { + 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 OutputItemFileSearchToolCallStatus getStatus() { + return this.status; + } + /** * Get the queries property: The queries used to search for files. * @@ -68,23 +108,23 @@ public List getQueries() { } /** - * Get the results property: The results of the file search tool call. + * Get the results property: The results property. * * @return the results value. */ @Generated - public List getResults() { + public List getResults() { return this.results; } /** - * Set the results property: The results of the file search tool call. + * Set the results property: The results property. * * @param results the results value to set. - * @return the FileSearchToolCallItemParam object itself. + * @return the InputItemFileSearchToolCall object itself. */ @Generated - public FileSearchToolCallItemParam setResults(List results) { + public InputItemFileSearchToolCall setResults(List results) { this.results = results; return this; } @@ -96,6 +136,8 @@ public FileSearchToolCallItemParam setResults(List writer.writeString(element)); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeArrayField("results", this.results, (writer, element) -> writer.writeJson(element)); @@ -103,38 +145,44 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of FileSearchToolCallItemParam from the JsonReader. + * Reads an instance of InputItemFileSearchToolCall from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FileSearchToolCallItemParam if the JsonReader was pointing to an instance of it, or null + * @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 FileSearchToolCallItemParam. + * @throws IOException If an error occurs while reading the InputItemFileSearchToolCall. */ @Generated - public static FileSearchToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemFileSearchToolCall fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { + String id = null; + OutputItemFileSearchToolCallStatus status = null; List queries = null; - ItemType type = ItemType.FILE_SEARCH_CALL; - List results = null; + InputItemType type = InputItemType.FILE_SEARCH_CALL; + List results = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("queries".equals(fieldName)) { + if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OutputItemFileSearchToolCallStatus.fromString(reader.getString()); + } else if ("queries".equals(fieldName)) { queries = reader.readArray(reader1 -> reader1.getString()); } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else if ("results".equals(fieldName)) { - results = reader.readArray(reader1 -> FileSearchToolCallItemParamResult.fromJson(reader1)); + results = reader.readArray(reader1 -> FileSearchToolCallResults.fromJson(reader1)); } else { reader.skipChildren(); } } - FileSearchToolCallItemParam deserializedFileSearchToolCallItemParam - = new FileSearchToolCallItemParam(queries); - deserializedFileSearchToolCallItemParam.type = type; - deserializedFileSearchToolCallItemParam.results = results; - return deserializedFileSearchToolCallItemParam; + InputItemFileSearchToolCall deserializedInputItemFileSearchToolCall + = new InputItemFileSearchToolCall(id, status, queries); + deserializedInputItemFileSearchToolCall.type = type; + deserializedInputItemFileSearchToolCall.results = results; + return deserializedInputItemFileSearchToolCall; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionCallOutputItemParam.java new file mode 100644 index 000000000000..9144dfc66de7 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionCallOutputItemParam.java @@ -0,0 +1,197 @@ +// 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; + +/** + * 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/models/InputItemFunctionShellCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallItemParam.java new file mode 100644 index 000000000000..b320422bfb83 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallItemParam.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.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; + + /** + * 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; + } + + /** + * {@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()); + 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; + 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 { + reader.skipChildren(); + } + } + InputItemFunctionShellCallItemParam deserializedInputItemFunctionShellCallItemParam + = new InputItemFunctionShellCallItemParam(callId, action); + deserializedInputItemFunctionShellCallItemParam.type = type; + deserializedInputItemFunctionShellCallItemParam.id = id; + deserializedInputItemFunctionShellCallItemParam.status = status; + return deserializedInputItemFunctionShellCallItemParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallOutputItemParam.java new file mode 100644 index 000000000000..75d5412a02ca --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallOutputItemParam.java @@ -0,0 +1,196 @@ +// 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; + +/** + * 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 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 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.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; + 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 ("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.maxOutputLength = maxOutputLength; + return deserializedInputItemFunctionShellCallOutputItemParam; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionToolCall.java similarity index 54% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionToolCallItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionToolCall.java index 5b527dcb9eeb..21e9a7677539 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/FunctionToolCallItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemFunctionToolCall.java @@ -3,25 +3,33 @@ // 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; /** + * Function tool call + * * A tool call to run a function. See the * [function calling guide](https://platform.openai.com/docs/guides/function-calling) for more information. */ -@Immutable -public final class FunctionToolCallItemParam extends ItemParam { +@Fluent +public final class InputItemFunctionToolCall extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.FUNCTION_CALL; + 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. @@ -41,15 +49,22 @@ public final class FunctionToolCallItemParam extends ItemParam { @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 OutputItemFunctionToolCallStatus status; + /** - * Creates an instance of FunctionToolCallItemParam class. + * 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 FunctionToolCallItemParam(String callId, String name, String arguments) { + public InputItemFunctionToolCall(String callId, String name, String arguments) { this.callId = callId; this.name = name; this.arguments = arguments; @@ -62,10 +77,32 @@ public FunctionToolCallItemParam(String callId, String name, String arguments) { */ @Generated @Override - public ItemType getType() { + 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. * @@ -96,6 +133,30 @@ 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 OutputItemFunctionToolCallStatus getStatus() { + return this.status; + } + + /** + * 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(OutputItemFunctionToolCallStatus status) { + this.status = status; + return this; + } + /** * {@inheritDoc} */ @@ -107,25 +168,29 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { 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 FunctionToolCallItemParam from the JsonReader. + * Reads an instance of InputItemFunctionToolCall from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of FunctionToolCallItemParam if the JsonReader was pointing to an instance of it, or null if + * @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 FunctionToolCallItemParam. + * @throws IOException If an error occurs while reading the InputItemFunctionToolCall. */ @Generated - public static FunctionToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemFunctionToolCall fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String callId = null; String name = null; String arguments = null; - ItemType type = ItemType.FUNCTION_CALL; + InputItemType type = InputItemType.FUNCTION_CALL; + String id = null; + OutputItemFunctionToolCallStatus status = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -136,15 +201,21 @@ public static FunctionToolCallItemParam fromJson(JsonReader jsonReader) throws I } else if ("arguments".equals(fieldName)) { arguments = reader.getString(); } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + id = reader.getString(); + } else if ("status".equals(fieldName)) { + status = OutputItemFunctionToolCallStatus.fromString(reader.getString()); } else { reader.skipChildren(); } } - FunctionToolCallItemParam deserializedFunctionToolCallItemParam - = new FunctionToolCallItemParam(callId, name, arguments); - deserializedFunctionToolCallItemParam.type = type; - return deserializedFunctionToolCallItemParam; + InputItemFunctionToolCall deserializedInputItemFunctionToolCall + = new InputItemFunctionToolCall(callId, name, arguments); + deserializedInputItemFunctionToolCall.type = type; + deserializedInputItemFunctionToolCall.id = id; + deserializedInputItemFunctionToolCall.status = status; + return deserializedInputItemFunctionToolCall; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemImageGenToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemImageGenToolCall.java new file mode 100644 index 000000000000..d0a53f986b1b --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemImageGenToolCall.java @@ -0,0 +1,151 @@ +// 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; + +/** + * 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 OutputItemImageGenToolCallStatus status; + + /* + * The result property. + */ + @Generated + private final String result; + + /** + * 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, OutputItemImageGenToolCallStatus status, String result) { + this.id = id; + this.status = status; + this.result = 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 OutputItemImageGenToolCallStatus 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; + OutputItemImageGenToolCallStatus 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 = OutputItemImageGenToolCallStatus.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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCall.java similarity index 56% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolCallItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCall.java index 73dea91c10cc..38016ed965cd 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolCallItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCall.java @@ -11,16 +11,24 @@ import java.io.IOException; /** + * Local shell call + * * A tool call to run a command on the local shell. */ @Immutable -public final class LocalShellToolCallItemParam extends ItemParam { +public final class InputItemLocalShellToolCall extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.LOCAL_SHELL_CALL; + 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. @@ -34,16 +42,27 @@ public final class LocalShellToolCallItemParam extends ItemParam { @Generated private final LocalShellExecAction action; + /* + * The status of the local shell call. + */ + @Generated + private final OutputItemLocalShellToolCallStatus status; + /** - * Creates an instance of LocalShellToolCallItemParam class. + * 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 LocalShellToolCallItemParam(String callId, LocalShellExecAction action) { + public InputItemLocalShellToolCall(String id, String callId, LocalShellExecAction action, + OutputItemLocalShellToolCallStatus status) { + this.id = id; this.callId = callId; this.action = action; + this.status = status; } /** @@ -53,10 +72,20 @@ public LocalShellToolCallItemParam(String callId, LocalShellExecAction action) { */ @Generated @Override - public ItemType getType() { + 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. * @@ -77,6 +106,16 @@ public LocalShellExecAction getAction() { return this.action; } + /** + * Get the status property: The status of the local shell call. + * + * @return the status value. + */ + @Generated + public OutputItemLocalShellToolCallStatus getStatus() { + return this.status; + } + /** * {@inheritDoc} */ @@ -84,44 +123,52 @@ public LocalShellExecAction getAction() { @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 LocalShellToolCallItemParam from the JsonReader. + * Reads an instance of InputItemLocalShellToolCall from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of LocalShellToolCallItemParam if the JsonReader was pointing to an instance of it, or null + * @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 LocalShellToolCallItemParam. + * @throws IOException If an error occurs while reading the InputItemLocalShellToolCall. */ @Generated - public static LocalShellToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemLocalShellToolCall fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { + String id = null; String callId = null; LocalShellExecAction action = null; - ItemType type = ItemType.LOCAL_SHELL_CALL; + OutputItemLocalShellToolCallStatus status = null; + InputItemType type = InputItemType.LOCAL_SHELL_CALL; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("call_id".equals(fieldName)) { + 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 = OutputItemLocalShellToolCallStatus.fromString(reader.getString()); } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else { reader.skipChildren(); } } - LocalShellToolCallItemParam deserializedLocalShellToolCallItemParam - = new LocalShellToolCallItemParam(callId, action); - deserializedLocalShellToolCallItemParam.type = type; - return deserializedLocalShellToolCallItemParam; + InputItemLocalShellToolCall deserializedInputItemLocalShellToolCall + = new InputItemLocalShellToolCall(id, callId, action, status); + deserializedInputItemLocalShellToolCall.type = type; + return deserializedInputItemLocalShellToolCall; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutput.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutput.java new file mode 100644 index 000000000000..c746c27d39c3 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutput.java @@ -0,0 +1,162 @@ +// 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; + +/** + * 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; + } + + /** + * 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; + } + + /** + * {@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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutputStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutputStatus.java new file mode 100644 index 000000000000..68337fd270f8 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutputStatus.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.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/models/MCPApprovalRequestItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalRequest.java similarity index 69% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPApprovalRequestItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalRequest.java index 84011f1b51a8..d74e3e6cdd5b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPApprovalRequestItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalRequest.java @@ -11,16 +11,24 @@ import java.io.IOException; /** + * MCP approval request + * * A request for human approval of a tool invocation. */ @Immutable -public final class MCPApprovalRequestItemParam extends ItemParam { +public final class InputItemMcpApprovalRequest extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.MCP_APPROVAL_REQUEST; + 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. @@ -41,14 +49,16 @@ public final class MCPApprovalRequestItemParam extends ItemParam { private final String arguments; /** - * Creates an instance of MCPApprovalRequestItemParam class. + * 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 MCPApprovalRequestItemParam(String serverLabel, String name, String arguments) { + public InputItemMcpApprovalRequest(String id, String serverLabel, String name, String arguments) { + this.id = id; this.serverLabel = serverLabel; this.name = name; this.arguments = arguments; @@ -61,10 +71,20 @@ public MCPApprovalRequestItemParam(String serverLabel, String name, String argum */ @Generated @Override - public ItemType getType() { + 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. * @@ -102,6 +122,7 @@ public String getArguments() { @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); @@ -110,40 +131,43 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MCPApprovalRequestItemParam from the JsonReader. + * Reads an instance of InputItemMcpApprovalRequest from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MCPApprovalRequestItemParam if the JsonReader was pointing to an instance of it, or null + * @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 MCPApprovalRequestItemParam. + * @throws IOException If an error occurs while reading the InputItemMcpApprovalRequest. */ @Generated - public static MCPApprovalRequestItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemMcpApprovalRequest fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { + String id = null; String serverLabel = null; String name = null; String arguments = null; - ItemType type = ItemType.MCP_APPROVAL_REQUEST; + InputItemType type = InputItemType.MCP_APPROVAL_REQUEST; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("server_label".equals(fieldName)) { + 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 = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else { reader.skipChildren(); } } - MCPApprovalRequestItemParam deserializedMCPApprovalRequestItemParam - = new MCPApprovalRequestItemParam(serverLabel, name, arguments); - deserializedMCPApprovalRequestItemParam.type = type; - return deserializedMCPApprovalRequestItemParam; + 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/models/MCPApprovalResponseItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalResponse.java similarity index 64% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPApprovalResponseItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalResponse.java index 3ad78b07fe42..5f02a69f0a3b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPApprovalResponseItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalResponse.java @@ -11,16 +11,24 @@ import java.io.IOException; /** + * MCP approval response + * * A response to an MCP approval request. */ @Fluent -public final class MCPApprovalResponseItemParam extends ItemParam { +public final class InputItemMcpApprovalResponse extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.MCP_APPROVAL_RESPONSE; + private InputItemType type = InputItemType.MCP_APPROVAL_RESPONSE; + + /* + * The id property. + */ + @Generated + private String id; /* * The ID of the approval request being answered. @@ -29,19 +37,25 @@ public final class MCPApprovalResponseItemParam extends ItemParam { private final String approvalRequestId; /* - * Optional reason for the decision. + * Whether the request was approved. + */ + @Generated + private final boolean approved; + + /* + * The reason property. */ @Generated private String reason; /** - * Creates an instance of MCPApprovalResponseItemParam class. + * Creates an instance of InputItemMcpApprovalResponse class. * * @param approvalRequestId the approvalRequestId value to set. * @param approved the approved value to set. */ @Generated - public MCPApprovalResponseItemParam(String approvalRequestId, boolean approved) { + public InputItemMcpApprovalResponse(String approvalRequestId, boolean approved) { this.approvalRequestId = approvalRequestId; this.approved = approved; } @@ -53,10 +67,32 @@ public MCPApprovalResponseItemParam(String approvalRequestId, boolean approved) */ @Generated @Override - public ItemType getType() { + 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. * @@ -68,7 +104,17 @@ public String getApprovalRequestId() { } /** - * Get the reason property: Optional reason for the decision. + * 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. */ @@ -78,13 +124,13 @@ public String getReason() { } /** - * Set the reason property: Optional reason for the decision. + * Set the reason property: The reason property. * * @param reason the reason value to set. - * @return the MCPApprovalResponseItemParam object itself. + * @return the InputItemMcpApprovalResponse object itself. */ @Generated - public MCPApprovalResponseItemParam setReason(String reason) { + public InputItemMcpApprovalResponse setReason(String reason) { this.reason = reason; return this; } @@ -99,25 +145,27 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { 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 MCPApprovalResponseItemParam from the JsonReader. + * Reads an instance of InputItemMcpApprovalResponse from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MCPApprovalResponseItemParam if the JsonReader was pointing to an instance of it, or null + * @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 MCPApprovalResponseItemParam. + * @throws IOException If an error occurs while reading the InputItemMcpApprovalResponse. */ @Generated - public static MCPApprovalResponseItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemMcpApprovalResponse fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String approvalRequestId = null; boolean approved = false; - ItemType type = ItemType.MCP_APPROVAL_RESPONSE; + InputItemType type = InputItemType.MCP_APPROVAL_RESPONSE; + String id = null; String reason = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -127,34 +175,21 @@ public static MCPApprovalResponseItemParam fromJson(JsonReader jsonReader) throw } else if ("approve".equals(fieldName)) { approved = reader.getBoolean(); } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); + } else if ("id".equals(fieldName)) { + id = reader.getString(); } else if ("reason".equals(fieldName)) { reason = reader.getString(); } else { reader.skipChildren(); } } - MCPApprovalResponseItemParam deserializedMCPApprovalResponseItemParam - = new MCPApprovalResponseItemParam(approvalRequestId, approved); - deserializedMCPApprovalResponseItemParam.type = type; - deserializedMCPApprovalResponseItemParam.reason = reason; - return deserializedMCPApprovalResponseItemParam; + InputItemMcpApprovalResponse deserializedInputItemMcpApprovalResponse + = new InputItemMcpApprovalResponse(approvalRequestId, approved); + deserializedInputItemMcpApprovalResponse.type = type; + deserializedInputItemMcpApprovalResponse.id = id; + deserializedInputItemMcpApprovalResponse.reason = reason; + return deserializedInputItemMcpApprovalResponse; }); } - - /* - * Whether the request was approved. - */ - @Generated - private final boolean approved; - - /** - * Get the approved property: Whether the request was approved. - * - * @return the approved value. - */ - @Generated - public boolean isApproved() { - return this.approved; - } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpListTools.java similarity index 67% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpListTools.java index d4630b419d17..ce5c26f5b970 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpListTools.java @@ -12,16 +12,24 @@ import java.util.List; /** + * MCP list tools + * * A list of tools available on an MCP server. */ @Fluent -public final class MCPListToolsItemParam extends ItemParam { +public final class InputItemMcpListTools extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.MCP_LIST_TOOLS; + private InputItemType type = InputItemType.MCP_LIST_TOOLS; + + /* + * The unique ID of the list. + */ + @Generated + private final String id; /* * The label of the MCP server. @@ -36,19 +44,21 @@ public final class MCPListToolsItemParam extends ItemParam { private final List tools; /* - * Error message if the server could not list tools. + * The error property. */ @Generated private String error; /** - * Creates an instance of MCPListToolsItemParam class. + * 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 MCPListToolsItemParam(String serverLabel, List tools) { + public InputItemMcpListTools(String id, String serverLabel, List tools) { + this.id = id; this.serverLabel = serverLabel; this.tools = tools; } @@ -60,10 +70,20 @@ public MCPListToolsItemParam(String serverLabel, List tools) { */ @Generated @Override - public ItemType getType() { + 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. * @@ -85,7 +105,7 @@ public List getTools() { } /** - * Get the error property: Error message if the server could not list tools. + * Get the error property: The error property. * * @return the error value. */ @@ -95,13 +115,13 @@ public String getError() { } /** - * Set the error property: Error message if the server could not list tools. + * Set the error property: The error property. * * @param error the error value to set. - * @return the MCPListToolsItemParam object itself. + * @return the InputItemMcpListTools object itself. */ @Generated - public MCPListToolsItemParam setError(String error) { + public InputItemMcpListTools setError(String error) { this.error = error; return this; } @@ -113,6 +133,7 @@ public MCPListToolsItemParam setError(String error) { @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()); @@ -121,40 +142,43 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MCPListToolsItemParam from the JsonReader. + * Reads an instance of InputItemMcpListTools from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MCPListToolsItemParam if the JsonReader was pointing to an instance of it, or null if it + * @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 MCPListToolsItemParam. + * @throws IOException If an error occurs while reading the InputItemMcpListTools. */ @Generated - public static MCPListToolsItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemMcpListTools fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { + String id = null; String serverLabel = null; List tools = null; - ItemType type = ItemType.MCP_LIST_TOOLS; + InputItemType type = InputItemType.MCP_LIST_TOOLS; String error = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("server_label".equals(fieldName)) { + 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 = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else if ("error".equals(fieldName)) { error = reader.getString(); } else { reader.skipChildren(); } } - MCPListToolsItemParam deserializedMCPListToolsItemParam = new MCPListToolsItemParam(serverLabel, tools); - deserializedMCPListToolsItemParam.type = type; - deserializedMCPListToolsItemParam.error = error; - return deserializedMCPListToolsItemParam; + 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/models/MCPCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpToolCall.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPCallItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpToolCall.java index 76cbaf7d125d..ca6f1cf8f593 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPCallItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemMcpToolCall.java @@ -11,16 +11,24 @@ import java.io.IOException; /** + * MCP tool call + * * An invocation of a tool on an MCP server. */ @Fluent -public final class MCPCallItemParam extends ItemParam { +public final class InputItemMcpToolCall extends InputItem { /* * The type property. */ @Generated - private ItemType type = ItemType.MCP_CALL; + 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. @@ -41,26 +49,40 @@ public final class MCPCallItemParam extends ItemParam { private final String arguments; /* - * The output from the tool call. + * The output property. */ @Generated private String output; /* - * The error from the tool call, if any. + * The error property. */ @Generated private String 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 MCPCallItemParam class. + * 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 MCPCallItemParam(String serverLabel, String name, String arguments) { + public InputItemMcpToolCall(String id, String serverLabel, String name, String arguments) { + this.id = id; this.serverLabel = serverLabel; this.name = name; this.arguments = arguments; @@ -73,10 +95,20 @@ public MCPCallItemParam(String serverLabel, String name, String arguments) { */ @Generated @Override - public ItemType getType() { + 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. * @@ -108,7 +140,7 @@ public String getArguments() { } /** - * Get the output property: The output from the tool call. + * Get the output property: The output property. * * @return the output value. */ @@ -118,19 +150,19 @@ public String getOutput() { } /** - * Set the output property: The output from the tool call. + * Set the output property: The output property. * * @param output the output value to set. - * @return the MCPCallItemParam object itself. + * @return the InputItemMcpToolCall object itself. */ @Generated - public MCPCallItemParam setOutput(String output) { + public InputItemMcpToolCall setOutput(String output) { this.output = output; return this; } /** - * Get the error property: The error from the tool call, if any. + * Get the error property: The error property. * * @return the error value. */ @@ -140,17 +172,63 @@ public String getError() { } /** - * Set the error property: The error from the tool call, if any. + * Set the error property: The error property. * * @param error the error value to set. - * @return the MCPCallItemParam object itself. + * @return the InputItemMcpToolCall object itself. */ @Generated - public MCPCallItemParam setError(String error) { + public InputItemMcpToolCall setError(String 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} */ @@ -158,57 +236,72 @@ public MCPCallItemParam setError(String error) { @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.writeStringField("error", this.error); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("approval_request_id", this.approvalRequestId); return jsonWriter.writeEndObject(); } /** - * Reads an instance of MCPCallItemParam from the JsonReader. + * Reads an instance of InputItemMcpToolCall from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MCPCallItemParam if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @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 MCPCallItemParam. + * @throws IOException If an error occurs while reading the InputItemMcpToolCall. */ @Generated - public static MCPCallItemParam fromJson(JsonReader jsonReader) throws IOException { + public static InputItemMcpToolCall fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { + String id = null; String serverLabel = null; String name = null; String arguments = null; - ItemType type = ItemType.MCP_CALL; + InputItemType type = InputItemType.MCP_CALL; String output = null; String error = null; + MCPToolCallStatus status = null; + String approvalRequestId = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("server_label".equals(fieldName)) { + 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 = ItemType.fromString(reader.getString()); + type = InputItemType.fromString(reader.getString()); } else if ("output".equals(fieldName)) { output = reader.getString(); } else if ("error".equals(fieldName)) { error = reader.getString(); + } else if ("status".equals(fieldName)) { + status = MCPToolCallStatus.fromString(reader.getString()); + } else if ("approval_request_id".equals(fieldName)) { + approvalRequestId = reader.getString(); } else { reader.skipChildren(); } } - MCPCallItemParam deserializedMCPCallItemParam = new MCPCallItemParam(serverLabel, name, arguments); - deserializedMCPCallItemParam.type = type; - deserializedMCPCallItemParam.output = output; - deserializedMCPCallItemParam.error = error; - return deserializedMCPCallItemParam; + 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/models/InputItemOutputMessage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemOutputMessage.java new file mode 100644 index 000000000000..d14dcd022f5b --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemOutputMessage.java @@ -0,0 +1,170 @@ +// 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.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 OutputItemOutputMessageStatus status; + + /** + * 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, OutputItemOutputMessageStatus status) { + this.id = id; + this.content = content; + 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 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 OutputItemOutputMessageStatus 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; + OutputItemOutputMessageStatus 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 = OutputItemOutputMessageStatus.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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemReasoningItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemReasoningItem.java new file mode 100644 index 000000000000..200619730adf --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemReasoningItem.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.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](https://platform.openai.com/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 OutputItemReasoningItemStatus 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 OutputItemReasoningItemStatus getStatus() { + return this.status; + } + + /** + * 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(OutputItemReasoningItemStatus status) { + this.status = status; + return this; + } + + /** + * {@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; + OutputItemReasoningItemStatus 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 -> Summary.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 = OutputItemReasoningItemStatus.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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemType.java new file mode 100644 index 000000000000..8b21155567e0 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemType.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.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/models/InputItemWebSearchToolCall.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemWebSearchToolCall.java new file mode 100644 index 000000000000..933a87cdc01a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputItemWebSearchToolCall.java @@ -0,0 +1,156 @@ +// 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.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](https://platform.openai.com/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 OutputItemWebSearchToolCallStatus 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). + */ + @Generated + private final BinaryData action; + + /** + * 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, OutputItemWebSearchToolCallStatus status, BinaryData action) { + this.id = id; + this.status = status; + 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 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 OutputItemWebSearchToolCallStatus 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). + * + * @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; + OutputItemWebSearchToolCallStatus 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 = OutputItemWebSearchToolCallStatus.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; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputTextContentParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputTextContentParam.java new file mode 100644 index 000000000000..f3cafdd21ee9 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/InputTextContentParam.java @@ -0,0 +1,101 @@ +// 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; + +/** + * 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/models/ItemContentInputAudio.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputAudio.java deleted file mode 100644 index b52b40ecbc19..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputAudio.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.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; - -/** - * An audio input to the model. - */ -@Immutable -public final class ItemContentInputAudio extends ItemContent { - - /* - * The type property. - */ - @Generated - private ItemContentType type = ItemContentType.INPUT_AUDIO; - - /* - * Base64-encoded audio data. - */ - @Generated - private final String data; - - /* - * The format of the audio data. Currently supported formats are `mp3` and - * `wav`. - */ - @Generated - private final ItemContentInputAudioFormat format; - - /** - * Creates an instance of ItemContentInputAudio class. - * - * @param data the data value to set. - * @param format the format value to set. - */ - @Generated - public ItemContentInputAudio(String data, ItemContentInputAudioFormat format) { - this.data = data; - this.format = format; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemContentType getType() { - return this.type; - } - - /** - * Get the data property: Base64-encoded audio data. - * - * @return the data value. - */ - @Generated - public String getData() { - return this.data; - } - - /** - * Get the format property: The format of the audio data. Currently supported formats are `mp3` and - * `wav`. - * - * @return the format value. - */ - @Generated - public ItemContentInputAudioFormat getFormat() { - return this.format; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("data", this.data); - jsonWriter.writeStringField("format", this.format == null ? null : this.format.toString()); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ItemContentInputAudio from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentInputAudio 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 ItemContentInputAudio. - */ - @Generated - public static ItemContentInputAudio fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String data = null; - ItemContentInputAudioFormat format = null; - ItemContentType type = ItemContentType.INPUT_AUDIO; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("data".equals(fieldName)) { - data = reader.getString(); - } else if ("format".equals(fieldName)) { - format = ItemContentInputAudioFormat.fromString(reader.getString()); - } else if ("type".equals(fieldName)) { - type = ItemContentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ItemContentInputAudio deserializedItemContentInputAudio = new ItemContentInputAudio(data, format); - deserializedItemContentInputAudio.type = type; - return deserializedItemContentInputAudio; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentOutputAudio.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentOutputAudio.java deleted file mode 100644 index 68a56557af57..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentOutputAudio.java +++ /dev/null @@ -1,126 +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.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An audio output from the model. - */ -@Immutable -public final class ItemContentOutputAudio extends ItemContent { - - /* - * The type property. - */ - @Generated - private ItemContentType type = ItemContentType.OUTPUT_AUDIO; - - /* - * Base64-encoded audio data from the model. - */ - @Generated - private final String data; - - /* - * The transcript of the audio data from the model. - */ - @Generated - private final String transcript; - - /** - * Creates an instance of ItemContentOutputAudio class. - * - * @param data the data value to set. - * @param transcript the transcript value to set. - */ - @Generated - public ItemContentOutputAudio(String data, String transcript) { - this.data = data; - this.transcript = transcript; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemContentType getType() { - return this.type; - } - - /** - * Get the data property: Base64-encoded audio data from the model. - * - * @return the data value. - */ - @Generated - public String getData() { - return this.data; - } - - /** - * Get the transcript property: The transcript of the audio data from the model. - * - * @return the transcript value. - */ - @Generated - public String getTranscript() { - return this.transcript; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("data", this.data); - jsonWriter.writeStringField("transcript", this.transcript); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ItemContentOutputAudio from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentOutputAudio 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 ItemContentOutputAudio. - */ - @Generated - public static ItemContentOutputAudio fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - String data = null; - String transcript = null; - ItemContentType type = ItemContentType.OUTPUT_AUDIO; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("data".equals(fieldName)) { - data = reader.getString(); - } else if ("transcript".equals(fieldName)) { - transcript = reader.getString(); - } else if ("type".equals(fieldName)) { - type = ItemContentType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ItemContentOutputAudio deserializedItemContentOutputAudio = new ItemContentOutputAudio(data, transcript); - deserializedItemContentOutputAudio.type = type; - return deserializedItemContentOutputAudio; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentType.java deleted file mode 100644 index 10c953146444..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentType.java +++ /dev/null @@ -1,81 +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; - -/** - * Multi-modal input and output contents. - */ -public enum ItemContentType { - /** - * Enum value input_text. - */ - INPUT_TEXT("input_text"), - - /** - * Enum value input_audio. - */ - INPUT_AUDIO("input_audio"), - - /** - * Enum value input_image. - */ - INPUT_IMAGE("input_image"), - - /** - * Enum value input_file. - */ - INPUT_FILE("input_file"), - - /** - * Enum value output_text. - */ - OUTPUT_TEXT("output_text"), - - /** - * Enum value output_audio. - */ - OUTPUT_AUDIO("output_audio"), - - /** - * Enum value refusal. - */ - REFUSAL("refusal"); - - /** - * The actual serialized value for a ItemContentType instance. - */ - private final String value; - - ItemContentType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ItemContentType instance. - * - * @param value the serialized value to parse. - * @return the parsed ItemContentType object, or null if unable to parse. - */ - public static ItemContentType fromString(String value) { - if (value == null) { - return null; - } - ItemContentType[] items = ItemContentType.values(); - for (ItemContentType 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/ItemType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemType.java deleted file mode 100644 index 4b22d68771b0..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemType.java +++ /dev/null @@ -1,171 +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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ItemType. - */ -public final class ItemType extends ExpandableStringEnum { - - /** - * Static value message for ItemType. - */ - @Generated - public static final ItemType MESSAGE = fromString("message"); - - /** - * Static value file_search_call for ItemType. - */ - @Generated - public static final ItemType FILE_SEARCH_CALL = fromString("file_search_call"); - - /** - * Static value function_call for ItemType. - */ - @Generated - public static final ItemType FUNCTION_CALL = fromString("function_call"); - - /** - * Static value function_call_output for ItemType. - */ - @Generated - public static final ItemType FUNCTION_CALL_OUTPUT = fromString("function_call_output"); - - /** - * Static value computer_call for ItemType. - */ - @Generated - public static final ItemType COMPUTER_CALL = fromString("computer_call"); - - /** - * Static value computer_call_output for ItemType. - */ - @Generated - public static final ItemType COMPUTER_CALL_OUTPUT = fromString("computer_call_output"); - - /** - * Static value web_search_call for ItemType. - */ - @Generated - public static final ItemType WEB_SEARCH_CALL = fromString("web_search_call"); - - /** - * Static value reasoning for ItemType. - */ - @Generated - public static final ItemType REASONING = fromString("reasoning"); - - /** - * Static value item_reference for ItemType. - */ - @Generated - public static final ItemType ITEM_REFERENCE = fromString("item_reference"); - - /** - * Static value image_generation_call for ItemType. - */ - @Generated - public static final ItemType IMAGE_GENERATION_CALL = fromString("image_generation_call"); - - /** - * Static value code_interpreter_call for ItemType. - */ - @Generated - public static final ItemType CODE_INTERPRETER_CALL = fromString("code_interpreter_call"); - - /** - * Static value local_shell_call for ItemType. - */ - @Generated - public static final ItemType LOCAL_SHELL_CALL = fromString("local_shell_call"); - - /** - * Static value local_shell_call_output for ItemType. - */ - @Generated - public static final ItemType LOCAL_SHELL_CALL_OUTPUT = fromString("local_shell_call_output"); - - /** - * Static value mcp_list_tools for ItemType. - */ - @Generated - public static final ItemType MCP_LIST_TOOLS = fromString("mcp_list_tools"); - - /** - * Static value mcp_approval_request for ItemType. - */ - @Generated - public static final ItemType MCP_APPROVAL_REQUEST = fromString("mcp_approval_request"); - - /** - * Static value mcp_approval_response for ItemType. - */ - @Generated - public static final ItemType MCP_APPROVAL_RESPONSE = fromString("mcp_approval_response"); - - /** - * Static value mcp_call for ItemType. - */ - @Generated - public static final ItemType MCP_CALL = fromString("mcp_call"); - - /** - * Static value structured_outputs for ItemType. - */ - @Generated - public static final ItemType STRUCTURED_OUTPUTS = fromString("structured_outputs"); - - /** - * Static value workflow_action for ItemType. - */ - @Generated - public static final ItemType WORKFLOW_ACTION = fromString("workflow_action"); - - /** - * Static value memory_search_call for ItemType. - */ - @Generated - public static final ItemType MEMORY_SEARCH_CALL = fromString("memory_search_call"); - - /** - * Static value oauth_consent_request for ItemType. - */ - @Generated - public static final ItemType OAUTH_CONSENT_REQUEST = fromString("oauth_consent_request"); - - /** - * Creates a new instance of ItemType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ItemType() { - } - - /** - * Creates or finds a ItemType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ItemType. - */ - @Generated - public static ItemType fromString(String name) { - return fromString(name, ItemType.class); - } - - /** - * Gets known ItemType values. - * - * @return known ItemType values. - */ - @Generated - public static Collection values() { - return values(ItemType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionKeyPress.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/KeyPressAction.java similarity index 70% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionKeyPress.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/KeyPressAction.java index 64409aa16af0..ad0375eb205c 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionKeyPress.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/KeyPressAction.java @@ -12,31 +12,33 @@ import java.util.List; /** + * KeyPress + * * A collection of keypresses the model would like to perform. */ @Immutable -public final class ComputerActionKeyPress extends ComputerAction { +public final class KeyPressAction extends ComputerAction { /* * The type property. */ @Generated - private ComputerActionType type = ComputerActionType.KEY_PRESS; + 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. + * 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 ComputerActionKeyPress class. + * Creates an instance of KeyPressAction class. * * @param keys the keys value to set. */ @Generated - public ComputerActionKeyPress(List keys) { + public KeyPressAction(List keys) { this.keys = keys; } @@ -52,8 +54,8 @@ public ComputerActionType getType() { } /** - * 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. + * 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. */ @@ -75,19 +77,19 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ComputerActionKeyPress from the JsonReader. + * Reads an instance of KeyPressAction from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionKeyPress if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @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 ComputerActionKeyPress. + * @throws IOException If an error occurs while reading the KeyPressAction. */ @Generated - public static ComputerActionKeyPress fromJson(JsonReader jsonReader) throws IOException { + public static KeyPressAction fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { List keys = null; - ComputerActionType type = ComputerActionType.KEY_PRESS; + ComputerActionType type = ComputerActionType.KEYPRESS; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -99,9 +101,9 @@ public static ComputerActionKeyPress fromJson(JsonReader jsonReader) throws IOEx reader.skipChildren(); } } - ComputerActionKeyPress deserializedComputerActionKeyPress = new ComputerActionKeyPress(keys); - deserializedComputerActionKeyPress.type = type; - return deserializedComputerActionKeyPress; + 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/models/LocalShellExecAction.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellExecAction.java index 40ca7dc8bfe2..77d1f31673d1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellExecAction.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellExecAction.java @@ -14,6 +14,8 @@ import java.util.Map; /** + * Local shell exec action + * * Execute a shell command on the server. */ @Fluent @@ -32,7 +34,7 @@ public final class LocalShellExecAction implements JsonSerializable command; /* - * Optional working directory to run the command in. + * The working_directory property. */ @Generated private String workingDirectory; @@ -44,7 +46,7 @@ public final class LocalShellExecAction implements JsonSerializable env; /* - * Optional user to run the command as. + * The user property. */ @Generated private String user; @@ -82,7 +84,7 @@ public List getCommand() { } /** - * Get the workingDirectory property: Optional working directory to run the command in. + * Get the workingDirectory property: The working_directory property. * * @return the workingDirectory value. */ @@ -92,7 +94,7 @@ public String getWorkingDirectory() { } /** - * Set the workingDirectory property: Optional working directory to run the command in. + * Set the workingDirectory property: The working_directory property. * * @param workingDirectory the workingDirectory value to set. * @return the LocalShellExecAction object itself. @@ -114,7 +116,7 @@ public Map getEnv() { } /** - * Get the user property: Optional user to run the command as. + * Get the user property: The user property. * * @return the user value. */ @@ -124,7 +126,7 @@ public String getUser() { } /** - * Set the user property: Optional user to run the command as. + * Set the user property: The user property. * * @param user the user value to set. * @return the LocalShellExecAction object itself. @@ -165,7 +167,7 @@ public static LocalShellExecAction fromJson(JsonReader jsonReader) throws IOExce return jsonReader.readObject(reader -> { List command = null; Map env = null; - Integer duration = null; + Long duration = null; String workingDirectory = null; String user = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -176,7 +178,7 @@ public static LocalShellExecAction fromJson(JsonReader jsonReader) throws IOExce } else if ("env".equals(fieldName)) { env = reader.readMap(reader1 -> reader1.getString()); } else if ("timeout_ms".equals(fieldName)) { - duration = reader.getNullable(JsonReader::getInt); + duration = reader.getNullable(JsonReader::getLong); } else if ("working_directory".equals(fieldName)) { workingDirectory = reader.getString(); } else if ("user".equals(fieldName)) { @@ -194,29 +196,29 @@ public static LocalShellExecAction fromJson(JsonReader jsonReader) throws IOExce } /* - * Optional timeout in milliseconds for the command. + * The timeout_ms property. */ @Generated - private Integer duration; + private Long duration; /** - * Get the duration property: Optional timeout in milliseconds for the command. + * Get the duration property: The timeout_ms property. * * @return the duration value. */ @Generated - public Integer getDuration() { + public Long getDuration() { return this.duration; } /** - * Set the duration property: Optional timeout in milliseconds for the command. + * Set the duration property: The timeout_ms property. * * @param duration the duration value to set. * @return the LocalShellExecAction object itself. */ @Generated - public LocalShellExecAction setDuration(Integer duration) { + public LocalShellExecAction setDuration(Long duration) { this.duration = duration; return this; } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParam.java similarity index 70% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParam.java index 5b67bde18cc9..94ef6e2eb662 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolParam.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Local shell tool + * * A tool that allows the model to execute shell commands in a local environment. */ @Immutable -public final class LocalShellTool extends Tool { +public final class LocalShellToolParam extends Tool { /* * The type property. @@ -23,10 +25,10 @@ public final class LocalShellTool extends Tool { private ToolType type = ToolType.LOCAL_SHELL; /** - * Creates an instance of LocalShellTool class. + * Creates an instance of LocalShellToolParam class. */ @Generated - public LocalShellTool() { + public LocalShellToolParam() { } /** @@ -52,27 +54,27 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of LocalShellTool from the JsonReader. + * Reads an instance of LocalShellToolParam from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of LocalShellTool if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of LocalShellToolParam 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 LocalShellTool. + * @throws IOException If an error occurs while reading the LocalShellToolParam. */ @Generated - public static LocalShellTool fromJson(JsonReader jsonReader) throws IOException { + public static LocalShellToolParam fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - LocalShellTool deserializedLocalShellTool = new LocalShellTool(); + LocalShellToolParam deserializedLocalShellToolParam = new LocalShellToolParam(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedLocalShellTool.type = ToolType.fromString(reader.getString()); + deserializedLocalShellToolParam.type = ToolType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedLocalShellTool; + return deserializedLocalShellToolParam; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocationType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocationType.java deleted file mode 100644 index 934ced40471a..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocationType.java +++ /dev/null @@ -1,51 +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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for LocationType. - */ -public final class LocationType extends ExpandableStringEnum { - - /** - * Static value approximate for LocationType. - */ - @Generated - public static final LocationType APPROXIMATE = fromString("approximate"); - - /** - * Creates a new instance of LocationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public LocationType() { - } - - /** - * Creates or finds a LocationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding LocationType. - */ - @Generated - public static LocationType fromString(String name) { - return fromString(name, LocationType.class); - } - - /** - * Gets known LocationType values. - * - * @return known LocationType values. - */ - @Generated - public static Collection values() { - return values(LocationType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LogProb.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LogProb.java index f65ce2f7d751..656b8f952c0a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LogProb.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LogProb.java @@ -13,6 +13,8 @@ import java.util.List; /** + * Log probability + * * The log probability of a token. */ @Immutable @@ -28,7 +30,7 @@ public final class LogProb implements JsonSerializable { * The bytes property. */ @Generated - private final List bytes; + private final List bytes; /* * The top_logprobs property. @@ -45,7 +47,7 @@ public final class LogProb implements JsonSerializable { * @param topLogprobs the topLogprobs value to set. */ @Generated - public LogProb(String token, double logProb, List bytes, List topLogprobs) { + public LogProb(String token, double logProb, List bytes, List topLogprobs) { this.token = token; this.logProb = logProb; this.bytes = bytes; @@ -68,7 +70,7 @@ public String getToken() { * @return the bytes value. */ @Generated - public List getBytes() { + public List getBytes() { return this.bytes; } @@ -91,7 +93,7 @@ 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.writeInt(element)); + jsonWriter.writeArrayField("bytes", this.bytes, (writer, element) -> writer.writeLong(element)); jsonWriter.writeArrayField("top_logprobs", this.topLogprobs, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -110,7 +112,7 @@ public static LogProb fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String token = null; double logProb = 0.0; - List bytes = null; + List bytes = null; List topLogprobs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -120,7 +122,7 @@ public static LogProb fromJson(JsonReader jsonReader) throws IOException { } else if ("logprob".equals(fieldName)) { logProb = reader.getDouble(); } else if ("bytes".equals(fieldName)) { - bytes = reader.readArray(reader1 -> reader1.getInt()); + bytes = reader.readArray(reader1 -> reader1.getLong()); } else if ("top_logprobs".equals(fieldName)) { topLogprobs = reader.readArray(reader1 -> TopLogProb.fromJson(reader1)); } else { diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsTool.java index a8a6fb16b730..fb3948ba19e2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsTool.java @@ -5,7 +5,6 @@ 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; @@ -13,6 +12,8 @@ import java.io.IOException; /** + * MCP list tools tool + * * A tool available on an MCP server. */ @Fluent @@ -25,7 +26,7 @@ public final class MCPListToolsTool implements JsonSerializable { String name = null; - BinaryData inputSchema = null; + MCPListToolsToolInputSchema inputSchema = null; String description = null; - BinaryData annotations = 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 - = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + inputSchema = MCPListToolsToolInputSchema.fromJson(reader); } else if ("description".equals(fieldName)) { description = reader.getString(); } else if ("annotations".equals(fieldName)) { - annotations - = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); + annotations = MCPListToolsToolAnnotations.fromJson(reader); } else { reader.skipChildren(); } @@ -175,4 +146,28 @@ public static MCPListToolsTool fromJson(JsonReader jsonReader) throws IOExceptio return deserializedMCPListToolsTool; }); } + + /** + * 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; + } + + /** + * 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; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsToolAnnotations.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsToolAnnotations.java new file mode 100644 index 000000000000..bb7470700e56 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsToolAnnotations.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.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/models/MCPListToolsToolInputSchema.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsToolInputSchema.java new file mode 100644 index 000000000000..6bdd2804efd0 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPListToolsToolInputSchema.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.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/models/MCPTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPTool.java index e42b7fc0a1d0..5c6a95ef2110 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 @@ -13,6 +13,8 @@ import java.util.Map; /** + * MCP tool + * * Give the model access to additional tools via remote Model Context Protocol * (MCP) servers. [Learn more about MCP](https://platform.openai.com/docs/guides/tools-remote-mcp). */ @@ -32,26 +34,26 @@ public final class MCPTool extends Tool { private final String serverLabel; /* - * The URL for the MCP server. + * The URL for the MCP server. One of `server_url` or `connector_id` must be + * provided. */ @Generated - private final String serverUrl; + private String serverUrl; /* - * Optional HTTP headers to send to the MCP server. Use for authentication - * or other purposes. + * The headers property. */ @Generated private Map headers; /* - * List of allowed tool names or a filter object. + * The allowed_tools property. */ @Generated private BinaryData allowedTools; /* - * Specify which of the MCP server's tools require approval. + * The require_approval property. */ @Generated private BinaryData requireApproval; @@ -63,18 +65,6 @@ public final class MCPTool extends Tool { @Generated private String projectConnectionId; - /** - * Creates an instance of MCPTool class. - * - * @param serverLabel the serverLabel value to set. - * @param serverUrl the serverUrl value to set. - */ - @Generated - public MCPTool(String serverLabel, String serverUrl) { - this.serverLabel = serverLabel; - this.serverUrl = serverUrl; - } - /** * Get the type property: The type property. * @@ -97,7 +87,8 @@ public String getServerLabel() { } /** - * Get the serverUrl property: The URL for the MCP server. + * Get the serverUrl property: The URL for the MCP server. One of `server_url` or `connector_id` must be + * provided. * * @return the serverUrl value. */ @@ -107,8 +98,7 @@ public String getServerUrl() { } /** - * Get the headers property: Optional HTTP headers to send to the MCP server. Use for authentication - * or other purposes. + * Get the headers property: The headers property. * * @return the headers value. */ @@ -118,8 +108,7 @@ public Map getHeaders() { } /** - * Set the headers property: Optional HTTP headers to send to the MCP server. Use for authentication - * or other purposes. + * Set the headers property: The headers property. * * @param headers the headers value to set. * @return the MCPTool object itself. @@ -131,7 +120,7 @@ public MCPTool setHeaders(Map headers) { } /** - * Get the allowedTools property: List of allowed tool names or a filter object. + * Get the allowedTools property: The allowed_tools property. * * @return the allowedTools value. */ @@ -141,7 +130,7 @@ public BinaryData getAllowedTools() { } /** - * Set the allowedTools property: List of allowed tool names or a filter object. + * Set the allowedTools property: The allowed_tools property. * * @param allowedTools the allowedTools value to set. * @return the MCPTool object itself. @@ -153,7 +142,7 @@ public MCPTool setAllowedTools(BinaryData allowedTools) { } /** - * Get the requireApproval property: Specify which of the MCP server's tools require approval. + * Get the requireApproval property: The require_approval property. * * @return the requireApproval value. */ @@ -163,7 +152,7 @@ public BinaryData getRequireApproval() { } /** - * Set the requireApproval property: Specify which of the MCP server's tools require approval. + * Set the requireApproval property: The require_approval property. * * @param requireApproval the requireApproval value to set. * @return the MCPTool object itself. @@ -206,8 +195,11 @@ public MCPTool setProjectConnectionId(String projectConnectionId) { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("server_label", this.serverLabel); - jsonWriter.writeStringField("server_url", this.serverUrl); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeStringField("server_url", this.serverUrl); + jsonWriter.writeStringField("connector_id", this.connectorId == null ? null : this.connectorId.toString()); + jsonWriter.writeStringField("authorization", this.authorization); + jsonWriter.writeStringField("server_description", this.serverDescription); jsonWriter.writeMapField("headers", this.headers, (writer, element) -> writer.writeString(element)); if (this.allowedTools != null) { jsonWriter.writeFieldName("allowed_tools"); @@ -234,8 +226,11 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static MCPTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String serverLabel = null; - String serverUrl = null; ToolType type = ToolType.MCP; + String serverUrl = null; + MCPToolConnectorId connectorId = null; + String authorization = null; + String serverDescription = null; Map headers = null; BinaryData allowedTools = null; BinaryData requireApproval = null; @@ -245,10 +240,16 @@ public static MCPTool fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("server_label".equals(fieldName)) { serverLabel = reader.getString(); - } else if ("server_url".equals(fieldName)) { - serverUrl = reader.getString(); } else if ("type".equals(fieldName)) { type = ToolType.fromString(reader.getString()); + } else if ("server_url".equals(fieldName)) { + serverUrl = reader.getString(); + } else if ("connector_id".equals(fieldName)) { + connectorId = MCPToolConnectorId.fromString(reader.getString()); + } else if ("authorization".equals(fieldName)) { + authorization = reader.getString(); + } else if ("server_description".equals(fieldName)) { + serverDescription = reader.getString(); } else if ("headers".equals(fieldName)) { headers = reader.readMap(reader1 -> reader1.getString()); } else if ("allowed_tools".equals(fieldName)) { @@ -263,8 +264,12 @@ public static MCPTool fromJson(JsonReader jsonReader) throws IOException { reader.skipChildren(); } } - MCPTool deserializedMCPTool = new MCPTool(serverLabel, serverUrl); + MCPTool deserializedMCPTool = new MCPTool(serverLabel); deserializedMCPTool.type = type; + deserializedMCPTool.serverUrl = serverUrl; + deserializedMCPTool.connectorId = connectorId; + deserializedMCPTool.authorization = authorization; + deserializedMCPTool.serverDescription = serverDescription; deserializedMCPTool.headers = headers; deserializedMCPTool.allowedTools = allowedTools; deserializedMCPTool.requireApproval = requireApproval; @@ -272,4 +277,150 @@ public static MCPTool fromJson(JsonReader jsonReader) throws IOException { return deserializedMCPTool; }); } + + /* + * Identifier for service connectors, like those available in ChatGPT. One of + * `server_url` or `connector_id` must be provided. Learn more about service + * connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + * Currently supported `connector_id` values are: + * - Dropbox: `connector_dropbox` + * - Gmail: `connector_gmail` + * - Google Calendar: `connector_googlecalendar` + * - Google Drive: `connector_googledrive` + * - Microsoft Teams: `connector_microsoftteams` + * - Outlook Calendar: `connector_outlookcalendar` + * - Outlook Email: `connector_outlookemail` + * - SharePoint: `connector_sharepoint` + */ + @Generated + private MCPToolConnectorId connectorId; + + /* + * An OAuth access token that can be used with a remote MCP server, either + * with a custom MCP server URL or a service connector. Your application + * must handle the OAuth authorization flow and provide the token here. + */ + @Generated + private String authorization; + + /* + * Optional description of the MCP server, used to provide more context. + */ + @Generated + private String serverDescription; + + /** + * Creates an instance of MCPTool class. + * + * @param serverLabel the serverLabel value to set. + */ + @Generated + public MCPTool(String serverLabel) { + this.serverLabel = serverLabel; + } + + /** + * Set the serverUrl property: The URL for the MCP server. One of `server_url` or `connector_id` must be + * provided. + * + * @param serverUrl the serverUrl value to set. + * @return the MCPTool object itself. + */ + @Generated + public MCPTool setServerUrl(String serverUrl) { + this.serverUrl = serverUrl; + return this; + } + + /** + * Get the connectorId property: Identifier for service connectors, like those available in ChatGPT. One of + * `server_url` or `connector_id` must be provided. Learn more about service + * connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + * Currently supported `connector_id` values are: + * - Dropbox: `connector_dropbox` + * - Gmail: `connector_gmail` + * - Google Calendar: `connector_googlecalendar` + * - Google Drive: `connector_googledrive` + * - Microsoft Teams: `connector_microsoftteams` + * - Outlook Calendar: `connector_outlookcalendar` + * - Outlook Email: `connector_outlookemail` + * - SharePoint: `connector_sharepoint`. + * + * @return the connectorId value. + */ + @Generated + public MCPToolConnectorId getConnectorId() { + return this.connectorId; + } + + /** + * Set the connectorId property: Identifier for service connectors, like those available in ChatGPT. One of + * `server_url` or `connector_id` must be provided. Learn more about service + * connectors [here](https://platform.openai.com/docs/guides/tools-remote-mcp#connectors). + * Currently supported `connector_id` values are: + * - Dropbox: `connector_dropbox` + * - Gmail: `connector_gmail` + * - Google Calendar: `connector_googlecalendar` + * - Google Drive: `connector_googledrive` + * - Microsoft Teams: `connector_microsoftteams` + * - Outlook Calendar: `connector_outlookcalendar` + * - Outlook Email: `connector_outlookemail` + * - SharePoint: `connector_sharepoint`. + * + * @param connectorId the connectorId value to set. + * @return the MCPTool object itself. + */ + @Generated + public MCPTool setConnectorId(MCPToolConnectorId connectorId) { + this.connectorId = connectorId; + return this; + } + + /** + * Get the authorization property: An OAuth access token that can be used with a remote MCP server, either + * with a custom MCP server URL or a service connector. Your application + * must handle the OAuth authorization flow and provide the token here. + * + * @return the authorization value. + */ + @Generated + public String getAuthorization() { + return this.authorization; + } + + /** + * Set the authorization property: An OAuth access token that can be used with a remote MCP server, either + * with a custom MCP server URL or a service connector. Your application + * must handle the OAuth authorization flow and provide the token here. + * + * @param authorization the authorization value to set. + * @return the MCPTool object itself. + */ + @Generated + public MCPTool setAuthorization(String authorization) { + this.authorization = authorization; + return this; + } + + /** + * Get the serverDescription property: Optional description of the MCP server, used to provide more context. + * + * @return the serverDescription value. + */ + @Generated + public String getServerDescription() { + return this.serverDescription; + } + + /** + * Set the serverDescription property: Optional description of the MCP server, used to provide more context. + * + * @param serverDescription the serverDescription value to set. + * @return the MCPTool object itself. + */ + @Generated + public MCPTool setServerDescription(String serverDescription) { + this.serverDescription = serverDescription; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolAllowedTools.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolAllowedTools.java deleted file mode 100644 index 846a635c4e3a..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolAllowedTools.java +++ /dev/null @@ -1,92 +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.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; - -/** - * The MCPToolAllowedTools model. - */ -@Fluent -public final class MCPToolAllowedTools implements JsonSerializable { - - /* - * List of allowed tool names. - */ - @Generated - private List toolNames; - - /** - * Creates an instance of MCPToolAllowedTools class. - */ - @Generated - public MCPToolAllowedTools() { - } - - /** - * Get the toolNames property: List of allowed tool names. - * - * @return the toolNames value. - */ - @Generated - public List getToolNames() { - return this.toolNames; - } - - /** - * Set the toolNames property: List of allowed tool names. - * - * @param toolNames the toolNames value to set. - * @return the MCPToolAllowedTools object itself. - */ - @Generated - public MCPToolAllowedTools setToolNames(List toolNames) { - this.toolNames = toolNames; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tool_names", this.toolNames, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MCPToolAllowedTools from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MCPToolAllowedTools 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 MCPToolAllowedTools. - */ - @Generated - public static MCPToolAllowedTools fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MCPToolAllowedTools deserializedMCPToolAllowedTools = new MCPToolAllowedTools(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("tool_names".equals(fieldName)) { - List toolNames = reader.readArray(reader1 -> reader1.getString()); - deserializedMCPToolAllowedTools.toolNames = toolNames; - } else { - reader.skipChildren(); - } - } - return deserializedMCPToolAllowedTools; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolCallStatus.java new file mode 100644 index 000000000000..3eccf05e6b19 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolCallStatus.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; + +/** + * Defines values for MCPToolCallStatus. + */ +public enum MCPToolCallStatus { + /** + * Enum value in_progress. + */ + IN_PROGRESS("in_progress"), + + /** + * Enum value completed. + */ + COMPLETED("completed"), + + /** + * Enum value incomplete. + */ + INCOMPLETE("incomplete"), + + /** + * Enum value calling. + */ + CALLING("calling"), + + /** + * Enum value failed. + */ + FAILED("failed"); + + /** + * The actual serialized value for a MCPToolCallStatus instance. + */ + private final String value; + + MCPToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MCPToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed MCPToolCallStatus object, or null if unable to parse. + */ + public static MCPToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + MCPToolCallStatus[] items = MCPToolCallStatus.values(); + for (MCPToolCallStatus 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/MCPToolConnectorId.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolConnectorId.java new file mode 100644 index 000000000000..4214065cd96a --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolConnectorId.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.agents.models; + +/** + * Defines values for MCPToolConnectorId. + */ +public enum MCPToolConnectorId { + /** + * Enum value connector_dropbox. + */ + CONNECTOR_DROPBOX("connector_dropbox"), + + /** + * Enum value connector_gmail. + */ + CONNECTOR_GMAIL("connector_gmail"), + + /** + * Enum value connector_googlecalendar. + */ + CONNECTOR_GOOGLECALENDAR("connector_googlecalendar"), + + /** + * Enum value connector_googledrive. + */ + CONNECTOR_GOOGLEDRIVE("connector_googledrive"), + + /** + * Enum value connector_microsoftteams. + */ + CONNECTOR_MICROSOFTTEAMS("connector_microsoftteams"), + + /** + * Enum value connector_outlookcalendar. + */ + CONNECTOR_OUTLOOKCALENDAR("connector_outlookcalendar"), + + /** + * Enum value connector_outlookemail. + */ + CONNECTOR_OUTLOOKEMAIL("connector_outlookemail"), + + /** + * Enum value connector_sharepoint. + */ + CONNECTOR_SHAREPOINT("connector_sharepoint"); + + /** + * The actual serialized value for a MCPToolConnectorId instance. + */ + private final String value; + + MCPToolConnectorId(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a MCPToolConnectorId instance. + * + * @param value the serialized value to parse. + * @return the parsed MCPToolConnectorId object, or null if unable to parse. + */ + public static MCPToolConnectorId fromString(String value) { + if (value == null) { + return null; + } + MCPToolConnectorId[] items = MCPToolConnectorId.values(); + for (MCPToolConnectorId 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/MCPToolFilter.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolFilter.java new file mode 100644 index 000000000000..b984d574f245 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolFilter.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.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * MCP tool filter + * + * A filter object to specify which tools are allowed. + */ +@Fluent +public final class MCPToolFilter implements JsonSerializable { + + /* + * MCP allowed tools + * + * List of allowed tool names. + */ + @Generated + private List toolNames; + + /* + * Indicates whether or not a tool modifies data or is read-only. If an + * MCP server is [annotated with + * `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + * it will match this filter. + */ + @Generated + private Boolean readOnly; + + /** + * Creates an instance of MCPToolFilter class. + */ + @Generated + public MCPToolFilter() { + } + + /** + * Get the toolNames property: MCP allowed tools + * + * List of allowed tool names. + * + * @return the toolNames value. + */ + @Generated + public List getToolNames() { + return this.toolNames; + } + + /** + * Set the toolNames property: MCP allowed tools + * + * List of allowed tool names. + * + * @param toolNames the toolNames value to set. + * @return the MCPToolFilter object itself. + */ + @Generated + public MCPToolFilter setToolNames(List toolNames) { + this.toolNames = toolNames; + return this; + } + + /** + * Get the readOnly property: Indicates whether or not a tool modifies data or is read-only. If an + * MCP server is [annotated with + * `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + * it will match this filter. + * + * @return the readOnly value. + */ + @Generated + public Boolean isReadOnly() { + return this.readOnly; + } + + /** + * Set the readOnly property: Indicates whether or not a tool modifies data or is read-only. If an + * MCP server is [annotated with + * `readOnlyHint`](https://modelcontextprotocol.io/specification/2025-06-18/schema#toolannotations-readonlyhint), + * it will match this filter. + * + * @param readOnly the readOnly value to set. + * @return the MCPToolFilter object itself. + */ + @Generated + public MCPToolFilter setReadOnly(Boolean readOnly) { + this.readOnly = readOnly; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tool_names", this.toolNames, (writer, element) -> writer.writeString(element)); + jsonWriter.writeBooleanField("read_only", this.readOnly); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MCPToolFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MCPToolFilter 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 MCPToolFilter. + */ + @Generated + public static MCPToolFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MCPToolFilter deserializedMCPToolFilter = new MCPToolFilter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("tool_names".equals(fieldName)) { + List toolNames = reader.readArray(reader1 -> reader1.getString()); + deserializedMCPToolFilter.toolNames = toolNames; + } else if ("read_only".equals(fieldName)) { + deserializedMCPToolFilter.readOnly = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + return deserializedMCPToolFilter; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApproval.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApproval.java index f7775d3180ce..b369542ce1dc 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApproval.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApproval.java @@ -18,16 +18,16 @@ public final class MCPToolRequireApproval implements JsonSerializable { /* - * A list of tools that always require approval. + * The always property. */ @Generated - private MCPToolRequireApprovalAlways always; + private MCPToolFilter always; /* - * A list of tools that never require approval. + * The never property. */ @Generated - private MCPToolRequireApprovalNever never; + private MCPToolFilter never; /** * Creates an instance of MCPToolRequireApproval class. @@ -37,49 +37,25 @@ public MCPToolRequireApproval() { } /** - * Get the always property: A list of tools that always require approval. + * Get the always property: The always property. * * @return the always value. */ @Generated - public MCPToolRequireApprovalAlways getAlways() { + public MCPToolFilter getAlways() { return this.always; } /** - * Set the always property: A list of tools that always require approval. - * - * @param always the always value to set. - * @return the MCPToolRequireApproval object itself. - */ - @Generated - public MCPToolRequireApproval setAlways(MCPToolRequireApprovalAlways always) { - this.always = always; - return this; - } - - /** - * Get the never property: A list of tools that never require approval. + * Get the never property: The never property. * * @return the never value. */ @Generated - public MCPToolRequireApprovalNever getNever() { + public MCPToolFilter getNever() { return this.never; } - /** - * Set the never property: A list of tools that never require approval. - * - * @param never the never value to set. - * @return the MCPToolRequireApproval object itself. - */ - @Generated - public MCPToolRequireApproval setNever(MCPToolRequireApprovalNever never) { - this.never = never; - return this; - } - /** * {@inheritDoc} */ @@ -108,9 +84,9 @@ public static MCPToolRequireApproval fromJson(JsonReader jsonReader) throws IOEx String fieldName = reader.getFieldName(); reader.nextToken(); if ("always".equals(fieldName)) { - deserializedMCPToolRequireApproval.always = MCPToolRequireApprovalAlways.fromJson(reader); + deserializedMCPToolRequireApproval.always = MCPToolFilter.fromJson(reader); } else if ("never".equals(fieldName)) { - deserializedMCPToolRequireApproval.never = MCPToolRequireApprovalNever.fromJson(reader); + deserializedMCPToolRequireApproval.never = MCPToolFilter.fromJson(reader); } else { reader.skipChildren(); } @@ -118,4 +94,28 @@ public static MCPToolRequireApproval fromJson(JsonReader jsonReader) throws IOEx return deserializedMCPToolRequireApproval; }); } + + /** + * Set the always property: The always property. + * + * @param always the always value to set. + * @return the MCPToolRequireApproval object itself. + */ + @Generated + public MCPToolRequireApproval setAlways(MCPToolFilter always) { + this.always = always; + return this; + } + + /** + * Set the never property: The never property. + * + * @param never the never value to set. + * @return the MCPToolRequireApproval object itself. + */ + @Generated + public MCPToolRequireApproval setNever(MCPToolFilter never) { + this.never = never; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalAlways.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalAlways.java deleted file mode 100644 index efa514f41bba..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalAlways.java +++ /dev/null @@ -1,92 +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.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; - -/** - * The MCPToolRequireApprovalAlways model. - */ -@Fluent -public final class MCPToolRequireApprovalAlways implements JsonSerializable { - - /* - * List of tools that require approval. - */ - @Generated - private List toolNames; - - /** - * Creates an instance of MCPToolRequireApprovalAlways class. - */ - @Generated - public MCPToolRequireApprovalAlways() { - } - - /** - * Get the toolNames property: List of tools that require approval. - * - * @return the toolNames value. - */ - @Generated - public List getToolNames() { - return this.toolNames; - } - - /** - * Set the toolNames property: List of tools that require approval. - * - * @param toolNames the toolNames value to set. - * @return the MCPToolRequireApprovalAlways object itself. - */ - @Generated - public MCPToolRequireApprovalAlways setToolNames(List toolNames) { - this.toolNames = toolNames; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tool_names", this.toolNames, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MCPToolRequireApprovalAlways from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MCPToolRequireApprovalAlways 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 MCPToolRequireApprovalAlways. - */ - @Generated - public static MCPToolRequireApprovalAlways fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MCPToolRequireApprovalAlways deserializedMCPToolRequireApprovalAlways = new MCPToolRequireApprovalAlways(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("tool_names".equals(fieldName)) { - List toolNames = reader.readArray(reader1 -> reader1.getString()); - deserializedMCPToolRequireApprovalAlways.toolNames = toolNames; - } else { - reader.skipChildren(); - } - } - return deserializedMCPToolRequireApprovalAlways; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalNever.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalNever.java deleted file mode 100644 index 9f35ff91478a..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalNever.java +++ /dev/null @@ -1,92 +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.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; - -/** - * The MCPToolRequireApprovalNever model. - */ -@Fluent -public final class MCPToolRequireApprovalNever implements JsonSerializable { - - /* - * List of tools that do not require approval. - */ - @Generated - private List toolNames; - - /** - * Creates an instance of MCPToolRequireApprovalNever class. - */ - @Generated - public MCPToolRequireApprovalNever() { - } - - /** - * Get the toolNames property: List of tools that do not require approval. - * - * @return the toolNames value. - */ - @Generated - public List getToolNames() { - return this.toolNames; - } - - /** - * Set the toolNames property: List of tools that do not require approval. - * - * @param toolNames the toolNames value to set. - * @return the MCPToolRequireApprovalNever object itself. - */ - @Generated - public MCPToolRequireApprovalNever setToolNames(List toolNames) { - this.toolNames = toolNames; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("tool_names", this.toolNames, (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MCPToolRequireApprovalNever from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MCPToolRequireApprovalNever 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 MCPToolRequireApprovalNever. - */ - @Generated - public static MCPToolRequireApprovalNever fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MCPToolRequireApprovalNever deserializedMCPToolRequireApprovalNever = new MCPToolRequireApprovalNever(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("tool_names".equals(fieldName)) { - List toolNames = reader.readArray(reader1 -> reader1.getString()); - deserializedMCPToolRequireApprovalNever.toolNames = toolNames; - } else { - reader.skipChildren(); - } - } - return deserializedMCPToolRequireApprovalNever; - }); - } -} 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 b9fdfeca5275..342431b6d01c 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 - public MemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { + protected MemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { this.memoryId = memoryId; if (updatedAt == null) { this.updatedAt = 0L; diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchItem.java index 9615b6f0084f..755856bbc4b5 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchItem.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchItem.java @@ -29,7 +29,7 @@ public final class MemorySearchItem implements JsonSerializable { String memoryStoreName = null; String scope = null; @@ -186,11 +186,12 @@ public static MemorySearchTool fromJson(JsonReader jsonReader) throws IOExceptio reader.skipChildren(); } } - MemorySearchTool deserializedMemorySearchTool = new MemorySearchTool(memoryStoreName, scope); - deserializedMemorySearchTool.type = type; - deserializedMemorySearchTool.searchOptions = searchOptions; - deserializedMemorySearchTool.updateDelay = updateDelay; - return deserializedMemorySearchTool; + MemorySearchPreviewTool deserializedMemorySearchPreviewTool + = new MemorySearchPreviewTool(memoryStoreName, scope); + deserializedMemorySearchPreviewTool.type = type; + deserializedMemorySearchPreviewTool.searchOptions = searchOptions; + deserializedMemorySearchPreviewTool.updateDelay = updateDelay; + return deserializedMemorySearchPreviewTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchToolCallItemParam.java deleted file mode 100644 index ba73ea9d49d5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemorySearchToolCallItemParam.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.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 MemorySearchToolCallItemParam model. - */ -@Fluent -public final class MemorySearchToolCallItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.MEMORY_SEARCH_CALL; - - /* - * The results returned from the memory search. - */ - @Generated - private List results; - - /** - * Creates an instance of MemorySearchToolCallItemParam class. - */ - @Generated - public MemorySearchToolCallItemParam() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the results property: The results returned from the memory search. - * - * @return the results value. - */ - @Generated - public List getResults() { - return this.results; - } - - /** - * Set the results property: The results returned from the memory search. - * - * @param results the results value to set. - * @return the MemorySearchToolCallItemParam object itself. - */ - @Generated - public MemorySearchToolCallItemParam setResults(List results) { - this.results = results; - 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("results", this.results, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of MemorySearchToolCallItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of MemorySearchToolCallItemParam 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 MemorySearchToolCallItemParam. - */ - @Generated - public static MemorySearchToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - MemorySearchToolCallItemParam deserializedMemorySearchToolCallItemParam - = new MemorySearchToolCallItemParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedMemorySearchToolCallItemParam.type = ItemType.fromString(reader.getString()); - } else if ("results".equals(fieldName)) { - List results = reader.readArray(reader1 -> MemorySearchItem.fromJson(reader1)); - deserializedMemorySearchToolCallItemParam.results = results; - } else { - reader.skipChildren(); - } - } - return deserializedMemorySearchToolCallItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsage.java index ac9e079ceadf..74f448b618bf 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsage.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsage.java @@ -27,53 +27,31 @@ public final class MemoryStoreOperationUsage implements JsonSerializable { int embeddingTokens = 0; - int inputTokens = 0; - MemoryStoreOperationUsageInputTokensDetails inputTokensDetails = null; - int outputTokens = 0; - MemoryStoreOperationUsageOutputTokensDetails outputTokensDetails = null; - int totalTokens = 0; + long inputTokens = 0L; + ResponseUsageInputTokensDetails inputTokensDetails = null; + long outputTokens = 0L; + ResponseUsageOutputTokensDetails outputTokensDetails = null; + long totalTokens = 0L; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("embedding_tokens".equals(fieldName)) { embeddingTokens = reader.getInt(); } else if ("input_tokens".equals(fieldName)) { - inputTokens = reader.getInt(); + inputTokens = reader.getLong(); } else if ("input_tokens_details".equals(fieldName)) { - inputTokensDetails = MemoryStoreOperationUsageInputTokensDetails.fromJson(reader); + inputTokensDetails = ResponseUsageInputTokensDetails.fromJson(reader); } else if ("output_tokens".equals(fieldName)) { - outputTokens = reader.getInt(); + outputTokens = reader.getLong(); } else if ("output_tokens_details".equals(fieldName)) { - outputTokensDetails = MemoryStoreOperationUsageOutputTokensDetails.fromJson(reader); + outputTokensDetails = ResponseUsageOutputTokensDetails.fromJson(reader); } else if ("total_tokens".equals(fieldName)) { - totalTokens = reader.getInt(); + totalTokens = reader.getLong(); } else { reader.skipChildren(); } @@ -192,4 +170,26 @@ public static MemoryStoreOperationUsage fromJson(JsonReader jsonReader) throws I outputTokensDetails, totalTokens); }); } + + /** + * Creates an instance of MemoryStoreOperationUsage class. + * + * @param embeddingTokens the embeddingTokens value to set. + * @param inputTokens the inputTokens value to set. + * @param inputTokensDetails the inputTokensDetails value to set. + * @param outputTokens the outputTokens value to set. + * @param outputTokensDetails the outputTokensDetails value to set. + * @param totalTokens the totalTokens value to set. + */ + @Generated + private MemoryStoreOperationUsage(int embeddingTokens, long inputTokens, + ResponseUsageInputTokensDetails inputTokensDetails, long outputTokens, + ResponseUsageOutputTokensDetails outputTokensDetails, long totalTokens) { + this.embeddingTokens = embeddingTokens; + this.inputTokens = inputTokens; + this.inputTokensDetails = inputTokensDetails; + this.outputTokens = outputTokens; + this.outputTokensDetails = outputTokensDetails; + this.totalTokens = totalTokens; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MicrosoftFabricAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MicrosoftFabricPreviewTool.java similarity index 78% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MicrosoftFabricAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MicrosoftFabricPreviewTool.java index f31a035f55a9..de17a8448955 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MicrosoftFabricAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MicrosoftFabricPreviewTool.java @@ -14,7 +14,7 @@ * The input definition information for a Microsoft Fabric tool as used to configure an agent. */ @Immutable -public final class MicrosoftFabricAgentTool extends Tool { +public final class MicrosoftFabricPreviewTool extends Tool { /* * The type property. @@ -22,13 +22,19 @@ public final class MicrosoftFabricAgentTool extends Tool { @Generated private ToolType type = ToolType.FABRIC_DATAAGENT_PREVIEW; + /* + * The fabric data agent tool parameters. + */ + @Generated + private final FabricDataAgentToolParameters fabricDataAgentPreview; + /** - * Creates an instance of MicrosoftFabricAgentTool class. + * Creates an instance of MicrosoftFabricPreviewTool class. * * @param fabricDataAgentPreview the fabricDataAgentPreview value to set. */ @Generated - public MicrosoftFabricAgentTool(FabricDataAgentToolParameters fabricDataAgentPreview) { + public MicrosoftFabricPreviewTool(FabricDataAgentToolParameters fabricDataAgentPreview) { this.fabricDataAgentPreview = fabricDataAgentPreview; } @@ -43,6 +49,16 @@ public ToolType getType() { return this.type; } + /** + * Get the fabricDataAgentPreview property: The fabric data agent tool parameters. + * + * @return the fabricDataAgentPreview value. + */ + @Generated + public FabricDataAgentToolParameters getFabricDataAgentPreview() { + return this.fabricDataAgentPreview; + } + /** * {@inheritDoc} */ @@ -56,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of MicrosoftFabricAgentTool from the JsonReader. + * Reads an instance of MicrosoftFabricPreviewTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MicrosoftFabricAgentTool if the JsonReader was pointing to an instance of it, or null if + * @return An instance of MicrosoftFabricPreviewTool 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 MicrosoftFabricAgentTool. + * @throws IOException If an error occurs while reading the MicrosoftFabricPreviewTool. */ @Generated - public static MicrosoftFabricAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static MicrosoftFabricPreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { FabricDataAgentToolParameters fabricDataAgentPreview = null; ToolType type = ToolType.FABRIC_DATAAGENT_PREVIEW; @@ -80,26 +96,10 @@ public static MicrosoftFabricAgentTool fromJson(JsonReader jsonReader) throws IO reader.skipChildren(); } } - MicrosoftFabricAgentTool deserializedMicrosoftFabricAgentTool - = new MicrosoftFabricAgentTool(fabricDataAgentPreview); - deserializedMicrosoftFabricAgentTool.type = type; - return deserializedMicrosoftFabricAgentTool; + MicrosoftFabricPreviewTool deserializedMicrosoftFabricPreviewTool + = new MicrosoftFabricPreviewTool(fabricDataAgentPreview); + deserializedMicrosoftFabricPreviewTool.type = type; + return deserializedMicrosoftFabricPreviewTool; }); } - - /* - * The fabric data agent tool parameters. - */ - @Generated - private final FabricDataAgentToolParameters fabricDataAgentPreview; - - /** - * Get the fabricDataAgentPreview property: The fabric data agent tool parameters. - * - * @return the fabricDataAgentPreview value. - */ - @Generated - public FabricDataAgentToolParameters getFabricDataAgentPreview() { - return this.fabricDataAgentPreview; - } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionMove.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Move.java similarity index 71% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionMove.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Move.java index 26aa24e4ff4f..c18a972010b4 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionMove.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Move.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Move + * * A mouse move action. */ @Immutable -public final class ComputerActionMove extends ComputerAction { +public final class Move extends ComputerAction { /* * The type property. @@ -26,22 +28,22 @@ public final class ComputerActionMove extends ComputerAction { * The x-coordinate to move to. */ @Generated - private final int x; + private final long x; /* * The y-coordinate to move to. */ @Generated - private final int y; + private final long y; /** - * Creates an instance of ComputerActionMove class. + * Creates an instance of Move class. * * @param x the x value to set. * @param y the y value to set. */ @Generated - public ComputerActionMove(int x, int y) { + public Move(long x, long y) { this.x = x; this.y = y; } @@ -63,7 +65,7 @@ public ComputerActionType getType() { * @return the x value. */ @Generated - public int getX() { + public long getX() { return this.x; } @@ -73,7 +75,7 @@ public int getX() { * @return the y value. */ @Generated - public int getY() { + public long getY() { return this.y; } @@ -84,43 +86,43 @@ public int getY() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("x", this.x); - jsonWriter.writeIntField("y", this.y); + 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 ComputerActionMove from the JsonReader. + * Reads an instance of Move from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionMove if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of Move 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 ComputerActionMove. + * @throws IOException If an error occurs while reading the Move. */ @Generated - public static ComputerActionMove fromJson(JsonReader jsonReader) throws IOException { + public static Move fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - int x = 0; - int y = 0; + 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.getInt(); + x = reader.getLong(); } else if ("y".equals(fieldName)) { - y = reader.getInt(); + y = reader.getLong(); } else if ("type".equals(fieldName)) { type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ComputerActionMove deserializedComputerActionMove = new ComputerActionMove(x, y); - deserializedComputerActionMove.type = type; - return deserializedComputerActionMove; + Move deserializedMove = new Move(x, y); + deserializedMove.type = type; + return deserializedMove; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java similarity index 80% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java index cb6d0af29895..2f2288666fce 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OpenApiTool.java @@ -14,7 +14,7 @@ * The input definition information for an OpenAPI tool as used to configure an agent. */ @Immutable -public final class OpenApiAgentTool extends Tool { +public final class OpenApiTool extends Tool { /* * The type property. @@ -29,12 +29,12 @@ public final class OpenApiAgentTool extends Tool { private final OpenApiFunctionDefinition openapi; /** - * Creates an instance of OpenApiAgentTool class. + * Creates an instance of OpenApiTool class. * * @param openapi the openapi value to set. */ @Generated - public OpenApiAgentTool(OpenApiFunctionDefinition openapi) { + public OpenApiTool(OpenApiFunctionDefinition openapi) { this.openapi = openapi; } @@ -72,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of OpenApiAgentTool from the JsonReader. + * Reads an instance of OpenApiTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of OpenApiAgentTool if the JsonReader was pointing to an instance of it, or null if it was + * @return An instance of OpenApiTool 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 OpenApiAgentTool. + * @throws IOException If an error occurs while reading the OpenApiTool. */ @Generated - public static OpenApiAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static OpenApiTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { OpenApiFunctionDefinition openapi = null; ToolType type = ToolType.OPENAPI; @@ -96,9 +96,9 @@ public static OpenApiAgentTool fromJson(JsonReader jsonReader) throws IOExceptio reader.skipChildren(); } } - OpenApiAgentTool deserializedOpenApiAgentTool = new OpenApiAgentTool(openapi); - deserializedOpenApiAgentTool.type = type; - return deserializedOpenApiAgentTool; + OpenApiTool deserializedOpenApiTool = new OpenApiTool(openapi); + deserializedOpenApiTool.type = type; + return deserializedOpenApiTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPart.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContent.java similarity index 65% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPart.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContent.java index 78ad7af6c58c..b22d85c0f5cd 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPart.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContent.java @@ -12,22 +12,22 @@ import java.io.IOException; /** - * The ReasoningItemSummaryPart model. + * The OutputContent model. */ @Immutable -public class ReasoningItemSummaryPart implements JsonSerializable { +public class OutputContent implements JsonSerializable { /* * The type property. */ @Generated - private ReasoningItemSummaryPartType type = ReasoningItemSummaryPartType.fromString("ReasoningItemSummaryPart"); + private OutputContentType type = OutputContentType.fromString("OutputContent"); /** - * Creates an instance of ReasoningItemSummaryPart class. + * Creates an instance of OutputContent class. */ @Generated - public ReasoningItemSummaryPart() { + public OutputContent() { } /** @@ -36,7 +36,7 @@ public ReasoningItemSummaryPart() { * @return the type value. */ @Generated - public ReasoningItemSummaryPartType getType() { + public OutputContentType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ReasoningItemSummaryPart from the JsonReader. + * Reads an instance of OutputContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ReasoningItemSummaryPart 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 ReasoningItemSummaryPart. + * @return An instance of OutputContent 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 OutputContent. */ @Generated - public static ReasoningItemSummaryPart fromJson(JsonReader jsonReader) throws IOException { + public static OutputContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,8 +77,12 @@ public static ReasoningItemSummaryPart fromJson(JsonReader jsonReader) throws IO } } // Use the discriminator value to determine which subtype should be deserialized. - if ("summary_text".equals(discriminatorValue)) { - return ReasoningItemSummaryTextPart.fromJson(readerToUse.reset()); + if ("output_text".equals(discriminatorValue)) { + return OutputContentOutputTextContent.fromJson(readerToUse.reset()); + } else if ("refusal".equals(discriminatorValue)) { + return OutputContentRefusalContent.fromJson(readerToUse.reset()); + } else if ("reasoning_text".equals(discriminatorValue)) { + return ReasoningTextContent.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -87,20 +91,19 @@ public static ReasoningItemSummaryPart fromJson(JsonReader jsonReader) throws IO } @Generated - static ReasoningItemSummaryPart fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static OutputContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ReasoningItemSummaryPart deserializedReasoningItemSummaryPart = new ReasoningItemSummaryPart(); + OutputContent deserializedOutputContent = new OutputContent(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedReasoningItemSummaryPart.type - = ReasoningItemSummaryPartType.fromString(reader.getString()); + deserializedOutputContent.type = OutputContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedReasoningItemSummaryPart; + return deserializedOutputContent; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentOutputText.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentOutputTextContent.java similarity index 73% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentOutputText.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentOutputTextContent.java index 50e1f93e69b8..f1634802ae47 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentOutputText.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentOutputTextContent.java @@ -12,16 +12,18 @@ import java.util.List; /** + * Output text + * * A text output from the model. */ @Fluent -public final class ItemContentOutputText extends ItemContent { +public final class OutputContentOutputTextContent extends OutputContent { /* * The type property. */ @Generated - private ItemContentType type = ItemContentType.OUTPUT_TEXT; + private OutputContentType type = OutputContentType.OUTPUT_TEXT; /* * The text output from the model. @@ -35,14 +37,20 @@ public final class ItemContentOutputText extends ItemContent { @Generated private final List annotations; + /* + * The logprobs property. + */ + @Generated + private List logProbs; + /** - * Creates an instance of ItemContentOutputText class. + * Creates an instance of OutputContentOutputTextContent class. * * @param text the text value to set. * @param annotations the annotations value to set. */ @Generated - public ItemContentOutputText(String text, List annotations) { + public OutputContentOutputTextContent(String text, List annotations) { this.text = text; this.annotations = annotations; } @@ -54,7 +62,7 @@ public ItemContentOutputText(String text, List annotations) { */ @Generated @Override - public ItemContentType getType() { + public OutputContentType getType() { return this.type; } @@ -78,6 +86,28 @@ public List getAnnotations() { return this.annotations; } + /** + * Get the logProbs property: The logprobs property. + * + * @return the logProbs value. + */ + @Generated + public List getLogProbs() { + return this.logProbs; + } + + /** + * Set the logProbs property: The logprobs property. + * + * @param logProbs the logProbs value to set. + * @return the OutputContentOutputTextContent object itself. + */ + @Generated + public OutputContentOutputTextContent setLogProbs(List logProbs) { + this.logProbs = logProbs; + return this; + } + /** * {@inheritDoc} */ @@ -93,20 +123,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ItemContentOutputText from the JsonReader. + * Reads an instance of OutputContentOutputTextContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentOutputText if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of OutputContentOutputTextContent 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 ItemContentOutputText. + * @throws IOException If an error occurs while reading the OutputContentOutputTextContent. */ @Generated - public static ItemContentOutputText fromJson(JsonReader jsonReader) throws IOException { + public static OutputContentOutputTextContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String text = null; List annotations = null; - ItemContentType type = ItemContentType.OUTPUT_TEXT; + OutputContentType type = OutputContentType.OUTPUT_TEXT; List logProbs = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); @@ -116,45 +146,18 @@ public static ItemContentOutputText fromJson(JsonReader jsonReader) throws IOExc } else if ("annotations".equals(fieldName)) { annotations = reader.readArray(reader1 -> Annotation.fromJson(reader1)); } else if ("type".equals(fieldName)) { - type = ItemContentType.fromString(reader.getString()); + type = OutputContentType.fromString(reader.getString()); } else if ("logprobs".equals(fieldName)) { logProbs = reader.readArray(reader1 -> LogProb.fromJson(reader1)); } else { reader.skipChildren(); } } - ItemContentOutputText deserializedItemContentOutputText = new ItemContentOutputText(text, annotations); - deserializedItemContentOutputText.type = type; - deserializedItemContentOutputText.logProbs = logProbs; - return deserializedItemContentOutputText; + OutputContentOutputTextContent deserializedOutputContentOutputTextContent + = new OutputContentOutputTextContent(text, annotations); + deserializedOutputContentOutputTextContent.type = type; + deserializedOutputContentOutputTextContent.logProbs = logProbs; + return deserializedOutputContentOutputTextContent; }); } - - /* - * The logprobs property. - */ - @Generated - private List logProbs; - - /** - * Get the logProbs property: The logprobs property. - * - * @return the logProbs value. - */ - @Generated - public List getLogProbs() { - return this.logProbs; - } - - /** - * Set the logProbs property: The logprobs property. - * - * @param logProbs the logProbs value to set. - * @return the ItemContentOutputText object itself. - */ - @Generated - public ItemContentOutputText setLogProbs(List logProbs) { - this.logProbs = logProbs; - return this; - } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentRefusal.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentRefusalContent.java similarity index 64% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentRefusal.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentRefusalContent.java index e4b63c0ab01d..5e46a5b25b23 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentRefusal.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentRefusalContent.java @@ -11,30 +11,32 @@ import java.io.IOException; /** + * Refusal + * * A refusal from the model. */ @Immutable -public final class ItemContentRefusal extends ItemContent { +public final class OutputContentRefusalContent extends OutputContent { /* * The type property. */ @Generated - private ItemContentType type = ItemContentType.REFUSAL; + private OutputContentType type = OutputContentType.REFUSAL; /* - * The refusal explanationfrom the model. + * The refusal explanation from the model. */ @Generated private final String refusal; /** - * Creates an instance of ItemContentRefusal class. + * Creates an instance of OutputContentRefusalContent class. * * @param refusal the refusal value to set. */ @Generated - public ItemContentRefusal(String refusal) { + public OutputContentRefusalContent(String refusal) { this.refusal = refusal; } @@ -45,12 +47,12 @@ public ItemContentRefusal(String refusal) { */ @Generated @Override - public ItemContentType getType() { + public OutputContentType getType() { return this.type; } /** - * Get the refusal property: The refusal explanationfrom the model. + * Get the refusal property: The refusal explanation from the model. * * @return the refusal value. */ @@ -72,33 +74,34 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ItemContentRefusal from the JsonReader. + * Reads an instance of OutputContentRefusalContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentRefusal if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of OutputContentRefusalContent 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 ItemContentRefusal. + * @throws IOException If an error occurs while reading the OutputContentRefusalContent. */ @Generated - public static ItemContentRefusal fromJson(JsonReader jsonReader) throws IOException { + public static OutputContentRefusalContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String refusal = null; - ItemContentType type = ItemContentType.REFUSAL; + OutputContentType type = OutputContentType.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 = ItemContentType.fromString(reader.getString()); + type = OutputContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ItemContentRefusal deserializedItemContentRefusal = new ItemContentRefusal(refusal); - deserializedItemContentRefusal.type = type; - return deserializedItemContentRefusal; + OutputContentRefusalContent deserializedOutputContentRefusalContent + = new OutputContentRefusalContent(refusal); + deserializedOutputContentRefusalContent.type = type; + return deserializedOutputContentRefusalContent; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentType.java new file mode 100644 index 000000000000..a585e1536266 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputContentType.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; + +/** + * Defines values for OutputContentType. + */ +public final class OutputContentType extends ExpandableStringEnum { + + /** + * Static value output_text for OutputContentType. + */ + @Generated + public static final OutputContentType OUTPUT_TEXT = fromString("output_text"); + + /** + * Static value refusal for OutputContentType. + */ + @Generated + public static final OutputContentType REFUSAL = fromString("refusal"); + + /** + * Static value reasoning_text for OutputContentType. + */ + @Generated + public static final OutputContentType REASONING_TEXT = fromString("reasoning_text"); + + /** + * Creates a new instance of OutputContentType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public OutputContentType() { + } + + /** + * Creates or finds a OutputContentType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OutputContentType. + */ + @Generated + public static OutputContentType fromString(String name) { + return fromString(name, OutputContentType.class); + } + + /** + * Gets known OutputContentType values. + * + * @return known OutputContentType values. + */ + @Generated + public static Collection values() { + return values(OutputContentType.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemCodeInterpreterToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemCodeInterpreterToolCallStatus.java new file mode 100644 index 000000000000..1a4ad99246b8 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemCodeInterpreterToolCallStatus.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; + +/** + * Defines values for OutputItemCodeInterpreterToolCallStatus. + */ +public enum OutputItemCodeInterpreterToolCallStatus { + /** + * 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 OutputItemCodeInterpreterToolCallStatus instance. + */ + private final String value; + + OutputItemCodeInterpreterToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemCodeInterpreterToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemCodeInterpreterToolCallStatus object, or null if unable to parse. + */ + public static OutputItemCodeInterpreterToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemCodeInterpreterToolCallStatus[] items = OutputItemCodeInterpreterToolCallStatus.values(); + for (OutputItemCodeInterpreterToolCallStatus 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/OutputItemComputerToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemComputerToolCallStatus.java new file mode 100644 index 000000000000..158a78c4238c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemComputerToolCallStatus.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.models; + +/** + * Defines values for OutputItemComputerToolCallStatus. + */ +public enum OutputItemComputerToolCallStatus { + /** + * Enum value in_progress. + */ + IN_PROGRESS("in_progress"), + + /** + * Enum value completed. + */ + COMPLETED("completed"), + + /** + * Enum value incomplete. + */ + INCOMPLETE("incomplete"); + + /** + * The actual serialized value for a OutputItemComputerToolCallStatus instance. + */ + private final String value; + + OutputItemComputerToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemComputerToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemComputerToolCallStatus object, or null if unable to parse. + */ + public static OutputItemComputerToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemComputerToolCallStatus[] items = OutputItemComputerToolCallStatus.values(); + for (OutputItemComputerToolCallStatus 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/OutputItemFileSearchToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemFileSearchToolCallStatus.java new file mode 100644 index 000000000000..f8a5508d559c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemFileSearchToolCallStatus.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; + +/** + * Defines values for OutputItemFileSearchToolCallStatus. + */ +public enum OutputItemFileSearchToolCallStatus { + /** + * 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 OutputItemFileSearchToolCallStatus instance. + */ + private final String value; + + OutputItemFileSearchToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemFileSearchToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemFileSearchToolCallStatus object, or null if unable to parse. + */ + public static OutputItemFileSearchToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemFileSearchToolCallStatus[] items = OutputItemFileSearchToolCallStatus.values(); + for (OutputItemFileSearchToolCallStatus 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/OutputItemFunctionToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemFunctionToolCallStatus.java new file mode 100644 index 000000000000..6022a1835f5f --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemFunctionToolCallStatus.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.models; + +/** + * Defines values for OutputItemFunctionToolCallStatus. + */ +public enum OutputItemFunctionToolCallStatus { + /** + * Enum value in_progress. + */ + IN_PROGRESS("in_progress"), + + /** + * Enum value completed. + */ + COMPLETED("completed"), + + /** + * Enum value incomplete. + */ + INCOMPLETE("incomplete"); + + /** + * The actual serialized value for a OutputItemFunctionToolCallStatus instance. + */ + private final String value; + + OutputItemFunctionToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemFunctionToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemFunctionToolCallStatus object, or null if unable to parse. + */ + public static OutputItemFunctionToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemFunctionToolCallStatus[] items = OutputItemFunctionToolCallStatus.values(); + for (OutputItemFunctionToolCallStatus 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/OutputItemImageGenToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemImageGenToolCallStatus.java new file mode 100644 index 000000000000..404466451304 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemImageGenToolCallStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.agents.models; + +/** + * Defines values for OutputItemImageGenToolCallStatus. + */ +public enum OutputItemImageGenToolCallStatus { + /** + * 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 OutputItemImageGenToolCallStatus instance. + */ + private final String value; + + OutputItemImageGenToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemImageGenToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemImageGenToolCallStatus object, or null if unable to parse. + */ + public static OutputItemImageGenToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemImageGenToolCallStatus[] items = OutputItemImageGenToolCallStatus.values(); + for (OutputItemImageGenToolCallStatus 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/OutputItemLocalShellToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemLocalShellToolCallStatus.java new file mode 100644 index 000000000000..96a7eb4ea880 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemLocalShellToolCallStatus.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.models; + +/** + * Defines values for OutputItemLocalShellToolCallStatus. + */ +public enum OutputItemLocalShellToolCallStatus { + /** + * Enum value in_progress. + */ + IN_PROGRESS("in_progress"), + + /** + * Enum value completed. + */ + COMPLETED("completed"), + + /** + * Enum value incomplete. + */ + INCOMPLETE("incomplete"); + + /** + * The actual serialized value for a OutputItemLocalShellToolCallStatus instance. + */ + private final String value; + + OutputItemLocalShellToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemLocalShellToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemLocalShellToolCallStatus object, or null if unable to parse. + */ + public static OutputItemLocalShellToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemLocalShellToolCallStatus[] items = OutputItemLocalShellToolCallStatus.values(); + for (OutputItemLocalShellToolCallStatus 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/OutputItemOutputMessageStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemOutputMessageStatus.java new file mode 100644 index 000000000000..745df074bb7e --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemOutputMessageStatus.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.models; + +/** + * Defines values for OutputItemOutputMessageStatus. + */ +public enum OutputItemOutputMessageStatus { + /** + * Enum value in_progress. + */ + IN_PROGRESS("in_progress"), + + /** + * Enum value completed. + */ + COMPLETED("completed"), + + /** + * Enum value incomplete. + */ + INCOMPLETE("incomplete"); + + /** + * The actual serialized value for a OutputItemOutputMessageStatus instance. + */ + private final String value; + + OutputItemOutputMessageStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemOutputMessageStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemOutputMessageStatus object, or null if unable to parse. + */ + public static OutputItemOutputMessageStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemOutputMessageStatus[] items = OutputItemOutputMessageStatus.values(); + for (OutputItemOutputMessageStatus 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/OutputItemReasoningItemStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemReasoningItemStatus.java new file mode 100644 index 000000000000..10e59164453c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemReasoningItemStatus.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.models; + +/** + * Defines values for OutputItemReasoningItemStatus. + */ +public enum OutputItemReasoningItemStatus { + /** + * Enum value in_progress. + */ + IN_PROGRESS("in_progress"), + + /** + * Enum value completed. + */ + COMPLETED("completed"), + + /** + * Enum value incomplete. + */ + INCOMPLETE("incomplete"); + + /** + * The actual serialized value for a OutputItemReasoningItemStatus instance. + */ + private final String value; + + OutputItemReasoningItemStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemReasoningItemStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemReasoningItemStatus object, or null if unable to parse. + */ + public static OutputItemReasoningItemStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemReasoningItemStatus[] items = OutputItemReasoningItemStatus.values(); + for (OutputItemReasoningItemStatus 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/OutputItemWebSearchToolCallStatus.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemWebSearchToolCallStatus.java new file mode 100644 index 000000000000..7758d3ce5a49 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputItemWebSearchToolCallStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.agents.models; + +/** + * Defines values for OutputItemWebSearchToolCallStatus. + */ +public enum OutputItemWebSearchToolCallStatus { + /** + * 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 OutputItemWebSearchToolCallStatus instance. + */ + private final String value; + + OutputItemWebSearchToolCallStatus(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a OutputItemWebSearchToolCallStatus instance. + * + * @param value the serialized value to parse. + * @return the parsed OutputItemWebSearchToolCallStatus object, or null if unable to parse. + */ + public static OutputItemWebSearchToolCallStatus fromString(String value) { + if (value == null) { + return null; + } + OutputItemWebSearchToolCallStatus[] items = OutputItemWebSearchToolCallStatus.values(); + for (OutputItemWebSearchToolCallStatus 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/Location.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContent.java similarity index 64% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Location.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContent.java index 04202c4f5817..ad0d614b31e1 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Location.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContent.java @@ -12,22 +12,22 @@ import java.io.IOException; /** - * The Location model. + * The OutputMessageContent model. */ @Immutable -public class Location implements JsonSerializable { +public class OutputMessageContent implements JsonSerializable { /* * The type property. */ @Generated - private LocationType type = LocationType.fromString("Location"); + private OutputMessageContentType type = OutputMessageContentType.fromString("OutputMessageContent"); /** - * Creates an instance of Location class. + * Creates an instance of OutputMessageContent class. */ @Generated - public Location() { + public OutputMessageContent() { } /** @@ -36,7 +36,7 @@ public Location() { * @return the type value. */ @Generated - public LocationType getType() { + public OutputMessageContentType getType() { return this.type; } @@ -52,15 +52,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of Location from the JsonReader. + * Reads an instance of OutputMessageContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of Location 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 Location. + * @return An instance of OutputMessageContent 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. */ @Generated - public static Location fromJson(JsonReader jsonReader) throws IOException { + public static OutputMessageContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,8 +77,10 @@ public static Location fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("approximate".equals(discriminatorValue)) { - return ApproximateLocation.fromJson(readerToUse.reset()); + if ("output_text".equals(discriminatorValue)) { + return OutputMessageContentOutputTextContent.fromJson(readerToUse.reset()); + } else if ("refusal".equals(discriminatorValue)) { + return OutputMessageContentRefusalContent.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -87,19 +89,19 @@ public static Location fromJson(JsonReader jsonReader) throws IOException { } @Generated - static Location fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static OutputMessageContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - Location deserializedLocation = new Location(); + OutputMessageContent deserializedOutputMessageContent = new OutputMessageContent(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedLocation.type = LocationType.fromString(reader.getString()); + deserializedOutputMessageContent.type = OutputMessageContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedLocation; + return deserializedOutputMessageContent; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentOutputTextContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentOutputTextContent.java new file mode 100644 index 000000000000..16969f887c81 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentOutputTextContent.java @@ -0,0 +1,163 @@ +// 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; + +/** + * Output text + * + * A text output from the model. + */ +@Fluent +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 List logProbs; + + /** + * Creates an instance of OutputMessageContentOutputTextContent class. + * + * @param text the text value to set. + * @param annotations the annotations value to set. + */ + @Generated + public OutputMessageContentOutputTextContent(String text, List annotations) { + this.text = text; + this.annotations = annotations; + } + + /** + * 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; + } + + /** + * Set the logProbs property: The logprobs property. + * + * @param logProbs the logProbs value to set. + * @return the OutputMessageContentOutputTextContent object itself. + */ + @Generated + public OutputMessageContentOutputTextContent setLogProbs(List logProbs) { + this.logProbs = logProbs; + return this; + } + + /** + * {@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.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("logprobs", this.logProbs, (writer, element) -> writer.writeJson(element)); + 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; + OutputMessageContentType type = OutputMessageContentType.OUTPUT_TEXT; + List logProbs = null; + 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 ("type".equals(fieldName)) { + type = OutputMessageContentType.fromString(reader.getString()); + } else if ("logprobs".equals(fieldName)) { + logProbs = reader.readArray(reader1 -> LogProb.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + OutputMessageContentOutputTextContent deserializedOutputMessageContentOutputTextContent + = new OutputMessageContentOutputTextContent(text, annotations); + deserializedOutputMessageContentOutputTextContent.type = type; + deserializedOutputMessageContentOutputTextContent.logProbs = logProbs; + return deserializedOutputMessageContentOutputTextContent; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolCallOutputItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentRefusalContent.java similarity index 50% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolCallOutputItemParam.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentRefusalContent.java index 27aa37aefc8c..6469df57a774 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/LocalShellToolCallOutputItemParam.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentRefusalContent.java @@ -11,31 +11,33 @@ import java.io.IOException; /** - * The output of a local shell tool call. + * Refusal + * + * A refusal from the model. */ @Immutable -public final class LocalShellToolCallOutputItemParam extends ItemParam { +public final class OutputMessageContentRefusalContent extends OutputMessageContent { /* * The type property. */ @Generated - private ItemType type = ItemType.LOCAL_SHELL_CALL_OUTPUT; + private OutputMessageContentType type = OutputMessageContentType.REFUSAL; /* - * A JSON string of the output of the local shell tool call. + * The refusal explanation from the model. */ @Generated - private final String output; + private final String refusal; /** - * Creates an instance of LocalShellToolCallOutputItemParam class. + * Creates an instance of OutputMessageContentRefusalContent class. * - * @param output the output value to set. + * @param refusal the refusal value to set. */ @Generated - public LocalShellToolCallOutputItemParam(String output) { - this.output = output; + public OutputMessageContentRefusalContent(String refusal) { + this.refusal = refusal; } /** @@ -45,18 +47,18 @@ public LocalShellToolCallOutputItemParam(String output) { */ @Generated @Override - public ItemType getType() { + public OutputMessageContentType getType() { return this.type; } /** - * Get the output property: A JSON string of the output of the local shell tool call. + * Get the refusal property: The refusal explanation from the model. * - * @return the output value. + * @return the refusal value. */ @Generated - public String getOutput() { - return this.output; + public String getRefusal() { + return this.refusal; } /** @@ -66,40 +68,40 @@ public String getOutput() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("output", this.output); + jsonWriter.writeStringField("refusal", this.refusal); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } /** - * Reads an instance of LocalShellToolCallOutputItemParam from the JsonReader. + * Reads an instance of OutputMessageContentRefusalContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of LocalShellToolCallOutputItemParam if the JsonReader was pointing to an instance of it, or + * @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 LocalShellToolCallOutputItemParam. + * @throws IOException If an error occurs while reading the OutputMessageContentRefusalContent. */ @Generated - public static LocalShellToolCallOutputItemParam fromJson(JsonReader jsonReader) throws IOException { + public static OutputMessageContentRefusalContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - String output = null; - ItemType type = ItemType.LOCAL_SHELL_CALL_OUTPUT; + String refusal = null; + OutputMessageContentType type = OutputMessageContentType.REFUSAL; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("output".equals(fieldName)) { - output = reader.getString(); + if ("refusal".equals(fieldName)) { + refusal = reader.getString(); } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); + type = OutputMessageContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - LocalShellToolCallOutputItemParam deserializedLocalShellToolCallOutputItemParam - = new LocalShellToolCallOutputItemParam(output); - deserializedLocalShellToolCallOutputItemParam.type = type; - return deserializedLocalShellToolCallOutputItemParam; + 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/models/OutputMessageContentType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentType.java new file mode 100644 index 000000000000..336439fb521b --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/OutputMessageContentType.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; + +/** + * 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/models/ListAgentsRequestOrder.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PageOrder.java similarity index 59% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ListAgentsRequestOrder.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PageOrder.java index 7c21f49ac5cf..af45557c6ae2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ListAgentsRequestOrder.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PageOrder.java @@ -5,9 +5,9 @@ package com.azure.ai.agents.models; /** - * Defines values for ListAgentsRequestOrder. + * Defines values for PageOrder. */ -public enum ListAgentsRequestOrder { +public enum PageOrder { /** * Enum value asc. */ @@ -19,26 +19,26 @@ public enum ListAgentsRequestOrder { DESC("desc"); /** - * The actual serialized value for a ListAgentsRequestOrder instance. + * The actual serialized value for a PageOrder instance. */ private final String value; - ListAgentsRequestOrder(String value) { + PageOrder(String value) { this.value = value; } /** - * Parses a serialized value to a ListAgentsRequestOrder instance. + * Parses a serialized value to a PageOrder instance. * * @param value the serialized value to parse. - * @return the parsed ListAgentsRequestOrder object, or null if unable to parse. + * @return the parsed PageOrder object, or null if unable to parse. */ - public static ListAgentsRequestOrder fromString(String value) { + public static PageOrder fromString(String value) { if (value == null) { return null; } - ListAgentsRequestOrder[] items = ListAgentsRequestOrder.values(); - for (ListAgentsRequestOrder item : items) { + PageOrder[] items = PageOrder.values(); + for (PageOrder 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/PromptAgentDefinitionText.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinitionText.java index a0d31a25844e..2ac1c3e3a63a 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinitionText.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/PromptAgentDefinitionText.java @@ -21,7 +21,7 @@ public final class PromptAgentDefinitionText implements JsonSerializable { * The ranker to use for the file search. */ @Generated - private RankingOptionsRanker ranker; + private RankerVersionType ranker; /* * The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return @@ -43,22 +43,10 @@ public RankingOptions() { * @return the ranker value. */ @Generated - public RankingOptionsRanker getRanker() { + public RankerVersionType getRanker() { return this.ranker; } - /** - * Set the ranker property: The ranker to use for the file search. - * - * @param ranker the ranker value to set. - * @return the RankingOptions object itself. - */ - @Generated - public RankingOptions setRanker(RankingOptionsRanker ranker) { - this.ranker = ranker; - return this; - } - /** * Get the scoreThreshold property: The score threshold for the file search, a number between 0 and 1. Numbers * closer to 1 will attempt to return only the most relevant results, but may return fewer results. @@ -92,6 +80,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("ranker", this.ranker == null ? null : this.ranker.toString()); jsonWriter.writeNumberField("score_threshold", this.scoreThreshold); + jsonWriter.writeJsonField("hybrid_search", this.hybridSearch); return jsonWriter.writeEndObject(); } @@ -111,9 +100,11 @@ public static RankingOptions fromJson(JsonReader jsonReader) throws IOException String fieldName = reader.getFieldName(); reader.nextToken(); if ("ranker".equals(fieldName)) { - deserializedRankingOptions.ranker = RankingOptionsRanker.fromString(reader.getString()); + deserializedRankingOptions.ranker = RankerVersionType.fromString(reader.getString()); } else if ("score_threshold".equals(fieldName)) { deserializedRankingOptions.scoreThreshold = reader.getNullable(JsonReader::getDouble); + } else if ("hybrid_search".equals(fieldName)) { + deserializedRankingOptions.hybridSearch = HybridSearchOptions.fromJson(reader); } else { reader.skipChildren(); } @@ -121,4 +112,47 @@ public static RankingOptions fromJson(JsonReader jsonReader) throws IOException return deserializedRankingOptions; }); } + + /* + * Weights that control how reciprocal rank fusion balances semantic embedding matches versus sparse keyword matches + * when hybrid search is enabled. + */ + @Generated + private HybridSearchOptions hybridSearch; + + /** + * Set the ranker property: The ranker to use for the file search. + * + * @param ranker the ranker value to set. + * @return the RankingOptions object itself. + */ + @Generated + public RankingOptions setRanker(RankerVersionType ranker) { + this.ranker = ranker; + return this; + } + + /** + * Get the hybridSearch property: Weights that control how reciprocal rank fusion balances semantic embedding + * matches versus sparse keyword matches when hybrid search is enabled. + * + * @return the hybridSearch value. + */ + @Generated + public HybridSearchOptions getHybridSearch() { + return this.hybridSearch; + } + + /** + * Set the hybridSearch property: Weights that control how reciprocal rank fusion balances semantic embedding + * matches versus sparse keyword matches when hybrid search is enabled. + * + * @param hybridSearch the hybridSearch value to set. + * @return the RankingOptions object itself. + */ + @Generated + public RankingOptions setHybridSearch(HybridSearchOptions hybridSearch) { + this.hybridSearch = hybridSearch; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Reasoning.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Reasoning.java index 858f34421e9e..5b70dc24adea 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Reasoning.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Reasoning.java @@ -12,9 +12,11 @@ import java.io.IOException; /** - * **o-series models only** + * Reasoning * - * Configuration options for [reasoning models](https://platform.openai.com/docs/guides/reasoning). + * **gpt-5 and o-series models only** + * Configuration options for + * [reasoning models](https://platform.openai.com/docs/guides/reasoning). */ @Fluent public final class Reasoning implements JsonSerializable { @@ -26,16 +28,13 @@ public final class Reasoning implements JsonSerializable { private ReasoningEffort effort; /* - * A summary of the reasoning performed by the model. This can be - * useful for debugging and understanding the model's reasoning process. - * One of `auto`, `concise`, or `detailed`. + * The summary property. */ @Generated private ReasoningSummary summary; /* - * **Deprecated**: use `summary` instead. A summary of the reasoning performed by the model. This can be useful for - * debugging and understanding the model's reasoning process. One of `auto`, `concise`, or `detailed`. + * The generate_summary property. */ @Generated private ReasoningGenerateSummary generateSummary; @@ -58,21 +57,7 @@ public ReasoningEffort getEffort() { } /** - * Set the effort property: The effort property. - * - * @param effort the effort value to set. - * @return the Reasoning object itself. - */ - @Generated - public Reasoning setEffort(ReasoningEffort effort) { - this.effort = effort; - return this; - } - - /** - * Get the summary property: A summary of the reasoning performed by the model. This can be - * useful for debugging and understanding the model's reasoning process. - * One of `auto`, `concise`, or `detailed`. + * Get the summary property: The summary property. * * @return the summary value. */ @@ -82,9 +67,7 @@ public ReasoningSummary getSummary() { } /** - * Set the summary property: A summary of the reasoning performed by the model. This can be - * useful for debugging and understanding the model's reasoning process. - * One of `auto`, `concise`, or `detailed`. + * Set the summary property: The summary property. * * @param summary the summary value to set. * @return the Reasoning object itself. @@ -96,9 +79,7 @@ public Reasoning setSummary(ReasoningSummary summary) { } /** - * Get the generateSummary property: **Deprecated**: use `summary` instead. A summary of the reasoning performed by - * the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, - * `concise`, or `detailed`. + * Get the generateSummary property: The generate_summary property. * * @return the generateSummary value. */ @@ -108,9 +89,7 @@ public ReasoningGenerateSummary getGenerateSummary() { } /** - * Set the generateSummary property: **Deprecated**: use `summary` instead. A summary of the reasoning performed by - * the model. This can be useful for debugging and understanding the model's reasoning process. One of `auto`, - * `concise`, or `detailed`. + * Set the generateSummary property: The generate_summary property. * * @param generateSummary the generateSummary value to set. * @return the Reasoning object itself. @@ -163,4 +142,16 @@ public static Reasoning fromJson(JsonReader jsonReader) throws IOException { return deserializedReasoning; }); } + + /** + * Set the effort property: The effort property. + * + * @param effort the effort value to set. + * @return the Reasoning object itself. + */ + @Generated + public Reasoning setEffort(ReasoningEffort effort) { + this.effort = effort; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningEffort.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningEffort.java index ce3d9766d3ad..204bb719ae88 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningEffort.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningEffort.java @@ -5,18 +5,7 @@ package com.azure.ai.agents.models; /** - * Constrains effort on reasoning for reasoning models. - * - * Currently supported values are none, minimal, low, medium, and high. - * - * Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. - * - * gpt-5.1 defaults to none, which does not perform reasoning. The supported reasoning values for gpt-5.1 are none, low, - * medium, and high. Tool calls are supported for all reasoning values in gpt-5.1. - * - * All models before gpt-5.1 default to medium reasoning effort, and do not support none. - * - * The gpt-5-pro model defaults to (and only supports) high reasoning effort. + * Defines values for ReasoningEffort. */ public enum ReasoningEffort { /** @@ -42,7 +31,12 @@ public enum ReasoningEffort { /** * Enum value high. */ - HIGH("high"); + HIGH("high"), + + /** + * Enum value xhigh. + */ + XHIGH("xhigh"); /** * The actual serialized value for a ReasoningEffort instance. diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemParam.java deleted file mode 100644 index 0799fa86a25c..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemParam.java +++ /dev/null @@ -1,144 +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.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; - -/** - * 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 conversation state](https://platform.openai.com/docs/guides/conversation-state). - */ -@Fluent -public final class ReasoningItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.REASONING; - - /* - * The encrypted content of the reasoning item - populated when a response is - * generated with `reasoning.encrypted_content` in the `include` parameter. - */ - @Generated - private String encryptedContent; - - /* - * Reasoning text contents. - */ - @Generated - private final List summary; - - /** - * Creates an instance of ReasoningItemParam class. - * - * @param summary the summary value to set. - */ - @Generated - public ReasoningItemParam(List summary) { - this.summary = summary; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the encryptedContent property: The encrypted content of the reasoning item - populated when a response is - * generated with `reasoning.encrypted_content` in the `include` parameter. - * - * @return the encryptedContent value. - */ - @Generated - public String getEncryptedContent() { - return this.encryptedContent; - } - - /** - * Set the encryptedContent property: The encrypted content of the reasoning item - populated when a response is - * generated with `reasoning.encrypted_content` in the `include` parameter. - * - * @param encryptedContent the encryptedContent value to set. - * @return the ReasoningItemParam object itself. - */ - @Generated - public ReasoningItemParam setEncryptedContent(String encryptedContent) { - this.encryptedContent = encryptedContent; - return this; - } - - /** - * Get the summary property: Reasoning text contents. - * - * @return the summary value. - */ - @Generated - public List getSummary() { - return this.summary; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - 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); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ReasoningItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ReasoningItemParam 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 ReasoningItemParam. - */ - @Generated - public static ReasoningItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - List summary = null; - ItemType type = ItemType.REASONING; - String encryptedContent = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("summary".equals(fieldName)) { - summary = reader.readArray(reader1 -> ReasoningItemSummaryPart.fromJson(reader1)); - } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); - } else if ("encrypted_content".equals(fieldName)) { - encryptedContent = reader.getString(); - } else { - reader.skipChildren(); - } - } - ReasoningItemParam deserializedReasoningItemParam = new ReasoningItemParam(summary); - deserializedReasoningItemParam.type = type; - deserializedReasoningItemParam.encryptedContent = encryptedContent; - return deserializedReasoningItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPartType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPartType.java deleted file mode 100644 index ac6d9ae8a3b5..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPartType.java +++ /dev/null @@ -1,51 +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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * Defines values for ReasoningItemSummaryPartType. - */ -public final class ReasoningItemSummaryPartType extends ExpandableStringEnum { - - /** - * Static value summary_text for ReasoningItemSummaryPartType. - */ - @Generated - public static final ReasoningItemSummaryPartType SUMMARY_TEXT = fromString("summary_text"); - - /** - * Creates a new instance of ReasoningItemSummaryPartType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ReasoningItemSummaryPartType() { - } - - /** - * Creates or finds a ReasoningItemSummaryPartType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ReasoningItemSummaryPartType. - */ - @Generated - public static ReasoningItemSummaryPartType fromString(String name) { - return fromString(name, ReasoningItemSummaryPartType.class); - } - - /** - * Gets known ReasoningItemSummaryPartType values. - * - * @return known ReasoningItemSummaryPartType values. - */ - @Generated - public static Collection values() { - return values(ReasoningItemSummaryPartType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputText.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningTextContent.java similarity index 68% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputText.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningTextContent.java index d533c374d86a..e8a695497b2b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContentInputText.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ReasoningTextContent.java @@ -11,30 +11,32 @@ import java.io.IOException; /** - * A text input to the model. + * ReasoningTextContent + * + * Reasoning text from the model. */ @Immutable -public final class ItemContentInputText extends ItemContent { +public final class ReasoningTextContent extends OutputContent { /* * The type property. */ @Generated - private ItemContentType type = ItemContentType.INPUT_TEXT; + private OutputContentType type = OutputContentType.REASONING_TEXT; /* - * The text input to the model. + * The reasoning text from the model. */ @Generated private final String text; /** - * Creates an instance of ItemContentInputText class. + * Creates an instance of ReasoningTextContent class. * * @param text the text value to set. */ @Generated - public ItemContentInputText(String text) { + public ReasoningTextContent(String text) { this.text = text; } @@ -45,12 +47,12 @@ public ItemContentInputText(String text) { */ @Generated @Override - public ItemContentType getType() { + public OutputContentType getType() { return this.type; } /** - * Get the text property: The text input to the model. + * Get the text property: The reasoning text from the model. * * @return the text value. */ @@ -72,33 +74,33 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ItemContentInputText from the JsonReader. + * Reads an instance of ReasoningTextContent from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemContentInputText if the JsonReader was pointing to an instance of it, or null if it + * @return An instance of ReasoningTextContent 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 ItemContentInputText. + * @throws IOException If an error occurs while reading the ReasoningTextContent. */ @Generated - public static ItemContentInputText fromJson(JsonReader jsonReader) throws IOException { + public static ReasoningTextContent fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String text = null; - ItemContentType type = ItemContentType.INPUT_TEXT; + OutputContentType type = OutputContentType.REASONING_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 = ItemContentType.fromString(reader.getString()); + type = OutputContentType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ItemContentInputText deserializedItemContentInputText = new ItemContentInputText(text); - deserializedItemContentInputText.type = type; - return deserializedItemContentInputText; + ReasoningTextContent deserializedReasoningTextContent = new ReasoningTextContent(text); + deserializedReasoningTextContent.type = type; + return deserializedReasoningTextContent; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseFormatJsonSchemaSchema.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseFormatJsonSchemaSchema.java new file mode 100644 index 000000000000..dc409d598db1 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseFormatJsonSchemaSchema.java @@ -0,0 +1,111 @@ +// 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.LinkedHashMap; +import java.util.Map; + +/** + * JSON schema + * + * The schema for the response format, described as a JSON Schema object. + * Learn how to build JSON schemas [here](https://json-schema.org/). + */ +@Fluent +public final class ResponseFormatJsonSchemaSchema implements JsonSerializable { + + /* + * The schema for the response format, described as a JSON Schema object. + * Learn how to build JSON schemas [here](https://json-schema.org/). + */ + @Generated + private Map additionalProperties; + + /** + * Creates an instance of ResponseFormatJsonSchemaSchema class. + */ + @Generated + public ResponseFormatJsonSchemaSchema() { + } + + /** + * Get the additionalProperties property: The schema for the response format, described as a JSON Schema object. + * Learn how to build JSON schemas [here](https://json-schema.org/). + * + * @return the additionalProperties value. + */ + @Generated + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties property: The schema for the response format, described as a JSON Schema object. + * Learn how to build JSON schemas [here](https://json-schema.org/). + * + * @param additionalProperties the additionalProperties value to set. + * @return the ResponseFormatJsonSchemaSchema object itself. + */ + @Generated + public ResponseFormatJsonSchemaSchema 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 ResponseFormatJsonSchemaSchema from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResponseFormatJsonSchemaSchema 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 ResponseFormatJsonSchemaSchema. + */ + @Generated + public static ResponseFormatJsonSchemaSchema fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResponseFormatJsonSchemaSchema deserializedResponseFormatJsonSchemaSchema + = new ResponseFormatJsonSchemaSchema(); + 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()))); + } + deserializedResponseFormatJsonSchemaSchema.additionalProperties = additionalProperties; + return deserializedResponseFormatJsonSchemaSchema; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationType.java deleted file mode 100644 index d9bd9b350d8b..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationType.java +++ /dev/null @@ -1,76 +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.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * An object specifying the format that the model must output. - * - * Configuring `{ "type": "json_schema" }` enables Structured Outputs, - * which ensures the model will match your supplied JSON schema. Learn more in the - * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). - * - * The default format is `{ "type": "text" }` with no additional options. - * - * **Not recommended for gpt-4o and newer models:** - * - * Setting to `{ "type": "json_object" }` enables the older JSON mode, which - * ensures the message the model generates is valid JSON. Using `json_schema` - * is preferred for models that support it. - */ -public final class ResponseTextFormatConfigurationType - extends ExpandableStringEnum { - - /** - * Static value text for ResponseTextFormatConfigurationType. - */ - @Generated - public static final ResponseTextFormatConfigurationType TEXT = fromString("text"); - - /** - * Static value json_schema for ResponseTextFormatConfigurationType. - */ - @Generated - public static final ResponseTextFormatConfigurationType JSON_SCHEMA = fromString("json_schema"); - - /** - * Static value json_object for ResponseTextFormatConfigurationType. - */ - @Generated - public static final ResponseTextFormatConfigurationType JSON_OBJECT = fromString("json_object"); - - /** - * Creates a new instance of ResponseTextFormatConfigurationType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Generated - @Deprecated - public ResponseTextFormatConfigurationType() { - } - - /** - * Creates or finds a ResponseTextFormatConfigurationType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ResponseTextFormatConfigurationType. - */ - @Generated - public static ResponseTextFormatConfigurationType fromString(String name) { - return fromString(name, ResponseTextFormatConfigurationType.class); - } - - /** - * Gets known ResponseTextFormatConfigurationType values. - * - * @return known ResponseTextFormatConfigurationType values. - */ - @Generated - public static Collection values() { - return values(ResponseTextFormatConfigurationType.class); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageInputTokensDetails.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseUsageInputTokensDetails.java similarity index 53% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageInputTokensDetails.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseUsageInputTokensDetails.java index f9558d305e90..3a01fdd5a45e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageInputTokensDetails.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseUsageInputTokensDetails.java @@ -12,37 +12,34 @@ import java.io.IOException; /** - * The MemoryStoreOperationUsageInputTokensDetails model. + * The ResponseUsageInputTokensDetails model. */ @Immutable -public final class MemoryStoreOperationUsageInputTokensDetails - implements JsonSerializable { +public final class ResponseUsageInputTokensDetails implements JsonSerializable { /* - * The number of tokens that were retrieved from the cache. - * [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + * The cached_tokens property. */ @Generated - private final int cachedTokens; + private final long cachedTokens; /** - * Creates an instance of MemoryStoreOperationUsageInputTokensDetails class. + * Creates an instance of ResponseUsageInputTokensDetails class. * * @param cachedTokens the cachedTokens value to set. */ @Generated - private MemoryStoreOperationUsageInputTokensDetails(int cachedTokens) { + private ResponseUsageInputTokensDetails(long cachedTokens) { this.cachedTokens = cachedTokens; } /** - * Get the cachedTokens property: The number of tokens that were retrieved from the cache. - * [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + * Get the cachedTokens property: The cached_tokens property. * * @return the cachedTokens value. */ @Generated - public int getCachedTokens() { + public long getCachedTokens() { return this.cachedTokens; } @@ -53,33 +50,33 @@ public int getCachedTokens() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("cached_tokens", this.cachedTokens); + jsonWriter.writeLongField("cached_tokens", this.cachedTokens); return jsonWriter.writeEndObject(); } /** - * Reads an instance of MemoryStoreOperationUsageInputTokensDetails from the JsonReader. + * Reads an instance of ResponseUsageInputTokensDetails from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MemoryStoreOperationUsageInputTokensDetails if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. + * @return An instance of ResponseUsageInputTokensDetails 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 MemoryStoreOperationUsageInputTokensDetails. + * @throws IOException If an error occurs while reading the ResponseUsageInputTokensDetails. */ @Generated - public static MemoryStoreOperationUsageInputTokensDetails fromJson(JsonReader jsonReader) throws IOException { + public static ResponseUsageInputTokensDetails fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - int cachedTokens = 0; + long cachedTokens = 0L; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("cached_tokens".equals(fieldName)) { - cachedTokens = reader.getInt(); + cachedTokens = reader.getLong(); } else { reader.skipChildren(); } } - return new MemoryStoreOperationUsageInputTokensDetails(cachedTokens); + return new ResponseUsageInputTokensDetails(cachedTokens); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageOutputTokensDetails.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseUsageOutputTokensDetails.java similarity index 57% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageOutputTokensDetails.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseUsageOutputTokensDetails.java index 79807655253c..50988b580b95 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageOutputTokensDetails.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseUsageOutputTokensDetails.java @@ -12,35 +12,34 @@ import java.io.IOException; /** - * The MemoryStoreOperationUsageOutputTokensDetails model. + * The ResponseUsageOutputTokensDetails model. */ @Immutable -public final class MemoryStoreOperationUsageOutputTokensDetails - implements JsonSerializable { +public final class ResponseUsageOutputTokensDetails implements JsonSerializable { /* - * The number of reasoning tokens. + * The reasoning_tokens property. */ @Generated - private final int reasoningTokens; + private final long reasoningTokens; /** - * Creates an instance of MemoryStoreOperationUsageOutputTokensDetails class. + * Creates an instance of ResponseUsageOutputTokensDetails class. * * @param reasoningTokens the reasoningTokens value to set. */ @Generated - private MemoryStoreOperationUsageOutputTokensDetails(int reasoningTokens) { + private ResponseUsageOutputTokensDetails(long reasoningTokens) { this.reasoningTokens = reasoningTokens; } /** - * Get the reasoningTokens property: The number of reasoning tokens. + * Get the reasoningTokens property: The reasoning_tokens property. * * @return the reasoningTokens value. */ @Generated - public int getReasoningTokens() { + public long getReasoningTokens() { return this.reasoningTokens; } @@ -51,33 +50,33 @@ public int getReasoningTokens() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("reasoning_tokens", this.reasoningTokens); + jsonWriter.writeLongField("reasoning_tokens", this.reasoningTokens); return jsonWriter.writeEndObject(); } /** - * Reads an instance of MemoryStoreOperationUsageOutputTokensDetails from the JsonReader. + * Reads an instance of ResponseUsageOutputTokensDetails from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of MemoryStoreOperationUsageOutputTokensDetails if the JsonReader was pointing to an instance - * of it, or null if it was pointing to JSON null. + * @return An instance of ResponseUsageOutputTokensDetails 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 MemoryStoreOperationUsageOutputTokensDetails. + * @throws IOException If an error occurs while reading the ResponseUsageOutputTokensDetails. */ @Generated - public static MemoryStoreOperationUsageOutputTokensDetails fromJson(JsonReader jsonReader) throws IOException { + public static ResponseUsageOutputTokensDetails fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - int reasoningTokens = 0; + long reasoningTokens = 0L; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("reasoning_tokens".equals(fieldName)) { - reasoningTokens = reader.getInt(); + reasoningTokens = reader.getLong(); } else { reader.skipChildren(); } } - return new MemoryStoreOperationUsageOutputTokensDetails(reasoningTokens); + return new ResponseUsageOutputTokensDetails(reasoningTokens); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesAssistantMessageItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesAssistantMessageItemParam.java deleted file mode 100644 index ab27d70c94fe..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesAssistantMessageItemParam.java +++ /dev/null @@ -1,125 +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.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A message parameter item with the `assistant` role. - */ -@Immutable -public final class ResponsesAssistantMessageItemParam extends ResponsesMessageItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.MESSAGE; - - /* - * The role associated with the message. - */ - @Generated - private ResponsesMessageRole role = ResponsesMessageRole.ASSISTANT; - - /* - * The content associated with the message. - */ - @Generated - private final BinaryData content; - - /** - * Creates an instance of ResponsesAssistantMessageItemParam class. - * - * @param content the content value to set. - */ - @Generated - public ResponsesAssistantMessageItemParam(BinaryData content) { - this.content = content; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the role property: The role associated with the message. - * - * @return the role value. - */ - @Generated - @Override - public ResponsesMessageRole getRole() { - return this.role; - } - - /** - * Get the content property: The content associated with the message. - * - * @return the content value. - */ - @Generated - public BinaryData getContent() { - return this.content; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeFieldName("content"); - this.content.writeTo(jsonWriter); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResponsesAssistantMessageItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResponsesAssistantMessageItemParam 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 ResponsesAssistantMessageItemParam. - */ - @Generated - public static ResponsesAssistantMessageItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BinaryData content = null; - ResponsesMessageRole role = ResponsesMessageRole.ASSISTANT; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("content".equals(fieldName)) { - content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("role".equals(fieldName)) { - role = ResponsesMessageRole.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ResponsesAssistantMessageItemParam deserializedResponsesAssistantMessageItemParam - = new ResponsesAssistantMessageItemParam(content); - deserializedResponsesAssistantMessageItemParam.role = role; - return deserializedResponsesAssistantMessageItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesDeveloperMessageItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesDeveloperMessageItemParam.java deleted file mode 100644 index 06576e5a54ac..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesDeveloperMessageItemParam.java +++ /dev/null @@ -1,125 +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.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A message parameter item with the `developer` role. - */ -@Immutable -public final class ResponsesDeveloperMessageItemParam extends ResponsesMessageItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.MESSAGE; - - /* - * The role associated with the message. - */ - @Generated - private ResponsesMessageRole role = ResponsesMessageRole.DEVELOPER; - - /* - * The content associated with the message. - */ - @Generated - private final BinaryData content; - - /** - * Creates an instance of ResponsesDeveloperMessageItemParam class. - * - * @param content the content value to set. - */ - @Generated - public ResponsesDeveloperMessageItemParam(BinaryData content) { - this.content = content; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the role property: The role associated with the message. - * - * @return the role value. - */ - @Generated - @Override - public ResponsesMessageRole getRole() { - return this.role; - } - - /** - * Get the content property: The content associated with the message. - * - * @return the content value. - */ - @Generated - public BinaryData getContent() { - return this.content; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeFieldName("content"); - this.content.writeTo(jsonWriter); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResponsesDeveloperMessageItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResponsesDeveloperMessageItemParam 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 ResponsesDeveloperMessageItemParam. - */ - @Generated - public static ResponsesDeveloperMessageItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BinaryData content = null; - ResponsesMessageRole role = ResponsesMessageRole.DEVELOPER; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("content".equals(fieldName)) { - content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("role".equals(fieldName)) { - role = ResponsesMessageRole.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ResponsesDeveloperMessageItemParam deserializedResponsesDeveloperMessageItemParam - = new ResponsesDeveloperMessageItemParam(content); - deserializedResponsesDeveloperMessageItemParam.role = role; - return deserializedResponsesDeveloperMessageItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesMessageItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesMessageItemParam.java deleted file mode 100644 index c0e02ff5fad2..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesMessageItemParam.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.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 response message item, representing a role and content, as provided as client request parameters. - */ -@Immutable -public class ResponsesMessageItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.MESSAGE; - - /* - * The role associated with the message. - */ - @Generated - private ResponsesMessageRole role; - - /** - * Creates an instance of ResponsesMessageItemParam class. - */ - @Generated - public ResponsesMessageItemParam() { - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the role property: The role associated with the message. - * - * @return the role value. - */ - @Generated - public ResponsesMessageRole getRole() { - return this.role; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResponsesMessageItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResponsesMessageItemParam 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 ResponsesMessageItemParam. - */ - @Generated - public static ResponsesMessageItemParam 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 ("role".equals(fieldName)) { - discriminatorValue = readerToUse.getString(); - break; - } else { - readerToUse.skipChildren(); - } - } - // Use the discriminator value to determine which subtype should be deserialized. - if ("user".equals(discriminatorValue)) { - return ResponsesUserMessageItemParam.fromJson(readerToUse.reset()); - } else if ("system".equals(discriminatorValue)) { - return ResponsesSystemMessageItemParam.fromJson(readerToUse.reset()); - } else if ("developer".equals(discriminatorValue)) { - return ResponsesDeveloperMessageItemParam.fromJson(readerToUse.reset()); - } else if ("assistant".equals(discriminatorValue)) { - return ResponsesAssistantMessageItemParam.fromJson(readerToUse.reset()); - } else { - return fromJsonKnownDiscriminator(readerToUse.reset()); - } - } - }); - } - - @Generated - static ResponsesMessageItemParam fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ResponsesMessageItemParam deserializedResponsesMessageItemParam = new ResponsesMessageItemParam(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("role".equals(fieldName)) { - deserializedResponsesMessageItemParam.role = ResponsesMessageRole.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - return deserializedResponsesMessageItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesSystemMessageItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesSystemMessageItemParam.java deleted file mode 100644 index 3d099114bdd3..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesSystemMessageItemParam.java +++ /dev/null @@ -1,125 +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.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A message parameter item with the `system` role. - */ -@Immutable -public final class ResponsesSystemMessageItemParam extends ResponsesMessageItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.MESSAGE; - - /* - * The role associated with the message. - */ - @Generated - private ResponsesMessageRole role = ResponsesMessageRole.SYSTEM; - - /* - * The content associated with the message. - */ - @Generated - private final BinaryData content; - - /** - * Creates an instance of ResponsesSystemMessageItemParam class. - * - * @param content the content value to set. - */ - @Generated - public ResponsesSystemMessageItemParam(BinaryData content) { - this.content = content; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the role property: The role associated with the message. - * - * @return the role value. - */ - @Generated - @Override - public ResponsesMessageRole getRole() { - return this.role; - } - - /** - * Get the content property: The content associated with the message. - * - * @return the content value. - */ - @Generated - public BinaryData getContent() { - return this.content; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeFieldName("content"); - this.content.writeTo(jsonWriter); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResponsesSystemMessageItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResponsesSystemMessageItemParam 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 ResponsesSystemMessageItemParam. - */ - @Generated - public static ResponsesSystemMessageItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BinaryData content = null; - ResponsesMessageRole role = ResponsesMessageRole.SYSTEM; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("content".equals(fieldName)) { - content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("role".equals(fieldName)) { - role = ResponsesMessageRole.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ResponsesSystemMessageItemParam deserializedResponsesSystemMessageItemParam - = new ResponsesSystemMessageItemParam(content); - deserializedResponsesSystemMessageItemParam.role = role; - return deserializedResponsesSystemMessageItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesUserMessageItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesUserMessageItemParam.java deleted file mode 100644 index 59019ce8092d..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponsesUserMessageItemParam.java +++ /dev/null @@ -1,125 +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.core.util.BinaryData; -import com.azure.json.JsonReader; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * A message parameter item with the `user` role. - */ -@Immutable -public final class ResponsesUserMessageItemParam extends ResponsesMessageItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.MESSAGE; - - /* - * The role associated with the message. - */ - @Generated - private ResponsesMessageRole role = ResponsesMessageRole.USER; - - /* - * The content associated with the message. - */ - @Generated - private final BinaryData content; - - /** - * Creates an instance of ResponsesUserMessageItemParam class. - * - * @param content the content value to set. - */ - @Generated - public ResponsesUserMessageItemParam(BinaryData content) { - this.content = content; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * Get the role property: The role associated with the message. - * - * @return the role value. - */ - @Generated - @Override - public ResponsesMessageRole getRole() { - return this.role; - } - - /** - * Get the content property: The content associated with the message. - * - * @return the content value. - */ - @Generated - public BinaryData getContent() { - return this.content; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - jsonWriter.writeFieldName("content"); - this.content.writeTo(jsonWriter); - jsonWriter.writeStringField("role", this.role == null ? null : this.role.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ResponsesUserMessageItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ResponsesUserMessageItemParam 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 ResponsesUserMessageItemParam. - */ - @Generated - public static ResponsesUserMessageItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - BinaryData content = null; - ResponsesMessageRole role = ResponsesMessageRole.USER; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("content".equals(fieldName)) { - content = reader.getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped())); - } else if ("role".equals(fieldName)) { - role = ResponsesMessageRole.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - ResponsesUserMessageItemParam deserializedResponsesUserMessageItemParam - = new ResponsesUserMessageItemParam(content); - deserializedResponsesUserMessageItemParam.role = role; - return deserializedResponsesUserMessageItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionScreenshot.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Screenshot.java similarity index 67% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionScreenshot.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Screenshot.java index 1ccf9bcd19e3..48e2ed969a2c 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionScreenshot.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Screenshot.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Screenshot + * * A screenshot action. */ @Immutable -public final class ComputerActionScreenshot extends ComputerAction { +public final class Screenshot extends ComputerAction { /* * The type property. @@ -23,10 +25,10 @@ public final class ComputerActionScreenshot extends ComputerAction { private ComputerActionType type = ComputerActionType.SCREENSHOT; /** - * Creates an instance of ComputerActionScreenshot class. + * Creates an instance of Screenshot class. */ @Generated - public ComputerActionScreenshot() { + public Screenshot() { } /** @@ -52,27 +54,27 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ComputerActionScreenshot from the JsonReader. + * Reads an instance of Screenshot from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionScreenshot 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 ComputerActionScreenshot. + * @return An instance of Screenshot 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 Screenshot. */ @Generated - public static ComputerActionScreenshot fromJson(JsonReader jsonReader) throws IOException { + public static Screenshot fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ComputerActionScreenshot deserializedComputerActionScreenshot = new ComputerActionScreenshot(); + Screenshot deserializedScreenshot = new Screenshot(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedComputerActionScreenshot.type = ComputerActionType.fromString(reader.getString()); + deserializedScreenshot.type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedComputerActionScreenshot; + return deserializedScreenshot; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionScroll.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Scroll.java similarity index 69% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionScroll.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Scroll.java index 97b560f978ea..0260931342d4 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionScroll.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Scroll.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Scroll + * * A scroll action. */ @Immutable -public final class ComputerActionScroll extends ComputerAction { +public final class Scroll extends ComputerAction { /* * The type property. @@ -26,28 +28,28 @@ public final class ComputerActionScroll extends ComputerAction { * The x-coordinate where the scroll occurred. */ @Generated - private final int x; + private final long x; /* * The y-coordinate where the scroll occurred. */ @Generated - private final int y; + private final long y; /* * The horizontal scroll distance. */ @Generated - private final int scrollX; + private final long scrollX; /* * The vertical scroll distance. */ @Generated - private final int scrollY; + private final long scrollY; /** - * Creates an instance of ComputerActionScroll class. + * Creates an instance of Scroll class. * * @param x the x value to set. * @param y the y value to set. @@ -55,7 +57,7 @@ public final class ComputerActionScroll extends ComputerAction { * @param scrollY the scrollY value to set. */ @Generated - public ComputerActionScroll(int x, int y, int scrollX, int scrollY) { + public Scroll(long x, long y, long scrollX, long scrollY) { this.x = x; this.y = y; this.scrollX = scrollX; @@ -79,7 +81,7 @@ public ComputerActionType getType() { * @return the x value. */ @Generated - public int getX() { + public long getX() { return this.x; } @@ -89,7 +91,7 @@ public int getX() { * @return the y value. */ @Generated - public int getY() { + public long getY() { return this.y; } @@ -99,7 +101,7 @@ public int getY() { * @return the scrollX value. */ @Generated - public int getScrollX() { + public long getScrollX() { return this.scrollX; } @@ -109,7 +111,7 @@ public int getScrollX() { * @return the scrollY value. */ @Generated - public int getScrollY() { + public long getScrollY() { return this.scrollY; } @@ -120,51 +122,51 @@ public int getScrollY() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeIntField("x", this.x); - jsonWriter.writeIntField("y", this.y); - jsonWriter.writeIntField("scroll_x", this.scrollX); - jsonWriter.writeIntField("scroll_y", this.scrollY); + 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 ComputerActionScroll from the JsonReader. + * Reads an instance of Scroll from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionScroll if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of Scroll 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 ComputerActionScroll. + * @throws IOException If an error occurs while reading the Scroll. */ @Generated - public static ComputerActionScroll fromJson(JsonReader jsonReader) throws IOException { + public static Scroll fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - int x = 0; - int y = 0; - int scrollX = 0; - int scrollY = 0; + 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.getInt(); + x = reader.getLong(); } else if ("y".equals(fieldName)) { - y = reader.getInt(); + y = reader.getLong(); } else if ("scroll_x".equals(fieldName)) { - scrollX = reader.getInt(); + scrollX = reader.getLong(); } else if ("scroll_y".equals(fieldName)) { - scrollY = reader.getInt(); + scrollY = reader.getLong(); } else if ("type".equals(fieldName)) { type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - ComputerActionScroll deserializedComputerActionScroll = new ComputerActionScroll(x, y, scrollX, scrollY); - deserializedComputerActionScroll.type = type; - return deserializedComputerActionScroll; + Scroll deserializedScroll = new Scroll(x, y, scrollX, scrollY); + deserializedScroll.type = type; + return deserializedScroll; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewToolSearchContextSize.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SearchContextSize.java similarity index 55% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewToolSearchContextSize.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SearchContextSize.java index 1cd788a2858a..4484fb40c60f 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewToolSearchContextSize.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SearchContextSize.java @@ -5,9 +5,9 @@ package com.azure.ai.agents.models; /** - * Defines values for WebSearchPreviewToolSearchContextSize. + * Defines values for SearchContextSize. */ -public enum WebSearchPreviewToolSearchContextSize { +public enum SearchContextSize { /** * Enum value low. */ @@ -24,26 +24,26 @@ public enum WebSearchPreviewToolSearchContextSize { HIGH("high"); /** - * The actual serialized value for a WebSearchPreviewToolSearchContextSize instance. + * The actual serialized value for a SearchContextSize instance. */ private final String value; - WebSearchPreviewToolSearchContextSize(String value) { + SearchContextSize(String value) { this.value = value; } /** - * Parses a serialized value to a WebSearchPreviewToolSearchContextSize instance. + * Parses a serialized value to a SearchContextSize instance. * * @param value the serialized value to parse. - * @return the parsed WebSearchPreviewToolSearchContextSize object, or null if unable to parse. + * @return the parsed SearchContextSize object, or null if unable to parse. */ - public static WebSearchPreviewToolSearchContextSize fromString(String value) { + public static SearchContextSize fromString(String value) { if (value == null) { return null; } - WebSearchPreviewToolSearchContextSize[] items = WebSearchPreviewToolSearchContextSize.values(); - for (WebSearchPreviewToolSearchContextSize item : items) { + SearchContextSize[] items = SearchContextSize.values(); + for (SearchContextSize 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/SharepointAgentTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java similarity index 78% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointAgentTool.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java index 23584387b6b0..6cdc2f1101d0 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointAgentTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/SharepointPreviewTool.java @@ -14,7 +14,7 @@ * The input definition information for a sharepoint tool as used to configure an agent. */ @Immutable -public final class SharepointAgentTool extends Tool { +public final class SharepointPreviewTool extends Tool { /* * The type property. @@ -29,12 +29,12 @@ public final class SharepointAgentTool extends Tool { private final SharepointGroundingToolParameters sharepointGroundingPreview; /** - * Creates an instance of SharepointAgentTool class. + * Creates an instance of SharepointPreviewTool class. * * @param sharepointGroundingPreview the sharepointGroundingPreview value to set. */ @Generated - public SharepointAgentTool(SharepointGroundingToolParameters sharepointGroundingPreview) { + public SharepointPreviewTool(SharepointGroundingToolParameters sharepointGroundingPreview) { this.sharepointGroundingPreview = sharepointGroundingPreview; } @@ -72,16 +72,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of SharepointAgentTool from the JsonReader. + * Reads an instance of SharepointPreviewTool from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of SharepointAgentTool if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of SharepointPreviewTool 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 SharepointAgentTool. + * @throws IOException If an error occurs while reading the SharepointPreviewTool. */ @Generated - public static SharepointAgentTool fromJson(JsonReader jsonReader) throws IOException { + public static SharepointPreviewTool fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { SharepointGroundingToolParameters sharepointGroundingPreview = null; ToolType type = ToolType.SHAREPOINT_GROUNDING_PREVIEW; @@ -96,9 +96,10 @@ public static SharepointAgentTool fromJson(JsonReader jsonReader) throws IOExcep reader.skipChildren(); } } - SharepointAgentTool deserializedSharepointAgentTool = new SharepointAgentTool(sharepointGroundingPreview); - deserializedSharepointAgentTool.type = type; - return deserializedSharepointAgentTool; + SharepointPreviewTool deserializedSharepointPreviewTool + = new SharepointPreviewTool(sharepointGroundingPreview); + deserializedSharepointPreviewTool.type = type; + return deserializedSharepointPreviewTool; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Summary.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Summary.java new file mode 100644 index 000000000000..d45efcfc067e --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Summary.java @@ -0,0 +1,101 @@ +// 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; + +/** + * Summary text + * + * A summary text from the model. + */ +@Immutable +public final class Summary implements JsonSerializable { + + /* + * The type of the object. Always `summary_text`. + */ + @Generated + private final String type = "summary_text"; + + /* + * A summary of the reasoning output from the model so far. + */ + @Generated + private final String text; + + /** + * Creates an instance of Summary class. + * + * @param text the text value to set. + */ + @Generated + public Summary(String text) { + this.text = text; + } + + /** + * Get the type property: The type of the object. Always `summary_text`. + * + * @return the type value. + */ + @Generated + public String 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("type", this.type); + jsonWriter.writeStringField("text", this.text); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of Summary from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of Summary 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 Summary. + */ + @Generated + public static Summary 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 Summary(text); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContent.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfiguration.java similarity index 51% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContent.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfiguration.java index 17f095875f71..48f0ac3ccbb6 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ItemContent.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfiguration.java @@ -12,22 +12,31 @@ import java.io.IOException; /** - * The ItemContent model. + * An object specifying the format that the model must output. + * Configuring `{ "type": "json_schema" }` enables Structured Outputs, + * which ensures the model will match your supplied JSON schema. Learn more in the + * [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + * The default format is `{ "type": "text" }` with no additional options. + * *Not recommended for gpt-4o and newer models:** + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` + * is preferred for models that support it. */ @Immutable -public class ItemContent implements JsonSerializable { +public class TextResponseFormatConfiguration implements JsonSerializable { /* * The type property. */ @Generated - private ItemContentType type; + private TextResponseFormatConfigurationType type + = TextResponseFormatConfigurationType.fromString("TextResponseFormatConfiguration"); /** - * Creates an instance of ItemContent class. + * Creates an instance of TextResponseFormatConfiguration class. */ @Generated - public ItemContent() { + public TextResponseFormatConfiguration() { } /** @@ -36,7 +45,7 @@ public ItemContent() { * @return the type value. */ @Generated - public ItemContentType getType() { + public TextResponseFormatConfigurationType getType() { return this.type; } @@ -52,15 +61,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ItemContent from the JsonReader. + * Reads an instance of TextResponseFormatConfiguration from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ItemContent 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 ItemContent. + * @return An instance of TextResponseFormatConfiguration 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 TextResponseFormatConfiguration. */ @Generated - public static ItemContent fromJson(JsonReader jsonReader) throws IOException { + public static TextResponseFormatConfiguration fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String discriminatorValue = null; try (JsonReader readerToUse = reader.bufferObject()) { @@ -77,20 +86,12 @@ public static ItemContent fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("input_audio".equals(discriminatorValue)) { - return ItemContentInputAudio.fromJson(readerToUse.reset()); - } else if ("output_audio".equals(discriminatorValue)) { - return ItemContentOutputAudio.fromJson(readerToUse.reset()); - } else if ("refusal".equals(discriminatorValue)) { - return ItemContentRefusal.fromJson(readerToUse.reset()); - } else if ("input_text".equals(discriminatorValue)) { - return ItemContentInputText.fromJson(readerToUse.reset()); - } else if ("input_image".equals(discriminatorValue)) { - return ItemContentInputImage.fromJson(readerToUse.reset()); - } else if ("input_file".equals(discriminatorValue)) { - return ItemContentInputFile.fromJson(readerToUse.reset()); - } else if ("output_text".equals(discriminatorValue)) { - return ItemContentOutputText.fromJson(readerToUse.reset()); + if ("json_schema".equals(discriminatorValue)) { + return TextResponseFormatJsonSchema.fromJson(readerToUse.reset()); + } else if ("text".equals(discriminatorValue)) { + return TextResponseFormatConfigurationResponseFormatText.fromJson(readerToUse.reset()); + } else if ("json_object".equals(discriminatorValue)) { + return TextResponseFormatConfigurationResponseFormatJsonObject.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -99,19 +100,21 @@ public static ItemContent fromJson(JsonReader jsonReader) throws IOException { } @Generated - static ItemContent fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + static TextResponseFormatConfiguration fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ItemContent deserializedItemContent = new ItemContent(); + TextResponseFormatConfiguration deserializedTextResponseFormatConfiguration + = new TextResponseFormatConfiguration(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedItemContent.type = ItemContentType.fromString(reader.getString()); + deserializedTextResponseFormatConfiguration.type + = TextResponseFormatConfigurationType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedItemContent; + return deserializedTextResponseFormatConfiguration; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatJsonObject.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatJsonObject.java new file mode 100644 index 000000000000..294c3cfb2129 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatJsonObject.java @@ -0,0 +1,86 @@ +// 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; + +/** + * JSON object + * + * JSON object response format. An older method of generating JSON responses. + * Using `json_schema` is recommended for models that support it. Note that the + * model will not generate JSON without a system or user message instructing it + * to do so. + */ +@Immutable +public final class TextResponseFormatConfigurationResponseFormatJsonObject extends TextResponseFormatConfiguration { + + /* + * The type property. + */ + @Generated + private TextResponseFormatConfigurationType type = TextResponseFormatConfigurationType.JSON_OBJECT; + + /** + * Creates an instance of TextResponseFormatConfigurationResponseFormatJsonObject class. + */ + @Generated + public TextResponseFormatConfigurationResponseFormatJsonObject() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public TextResponseFormatConfigurationType 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 TextResponseFormatConfigurationResponseFormatJsonObject from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TextResponseFormatConfigurationResponseFormatJsonObject 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 TextResponseFormatConfigurationResponseFormatJsonObject. + */ + @Generated + public static TextResponseFormatConfigurationResponseFormatJsonObject fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + TextResponseFormatConfigurationResponseFormatJsonObject deserializedTextResponseFormatConfigurationResponseFormatJsonObject + = new TextResponseFormatConfigurationResponseFormatJsonObject(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedTextResponseFormatConfigurationResponseFormatJsonObject.type + = TextResponseFormatConfigurationType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + return deserializedTextResponseFormatConfigurationResponseFormatJsonObject; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonObject.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatText.java similarity index 53% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonObject.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatText.java index 0fd1decb71ff..087c217c15d4 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonObject.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationResponseFormatText.java @@ -11,22 +11,24 @@ import java.io.IOException; /** - * The ResponseTextFormatConfigurationJsonObject model. + * Text + * + * Default response format. Used to generate text responses. */ @Immutable -public final class ResponseTextFormatConfigurationJsonObject extends ResponseTextFormatConfiguration { +public final class TextResponseFormatConfigurationResponseFormatText extends TextResponseFormatConfiguration { /* * The type property. */ @Generated - private ResponseTextFormatConfigurationType type = ResponseTextFormatConfigurationType.JSON_OBJECT; + private TextResponseFormatConfigurationType type = TextResponseFormatConfigurationType.TEXT; /** - * Creates an instance of ResponseTextFormatConfigurationJsonObject class. + * Creates an instance of TextResponseFormatConfigurationResponseFormatText class. */ @Generated - public ResponseTextFormatConfigurationJsonObject() { + public TextResponseFormatConfigurationResponseFormatText() { } /** @@ -36,7 +38,7 @@ public ResponseTextFormatConfigurationJsonObject() { */ @Generated @Override - public ResponseTextFormatConfigurationType getType() { + public TextResponseFormatConfigurationType getType() { return this.type; } @@ -52,29 +54,29 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResponseTextFormatConfigurationJsonObject from the JsonReader. + * Reads an instance of TextResponseFormatConfigurationResponseFormatText from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResponseTextFormatConfigurationJsonObject 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 ResponseTextFormatConfigurationJsonObject. + * @return An instance of TextResponseFormatConfigurationResponseFormatText 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 TextResponseFormatConfigurationResponseFormatText. */ @Generated - public static ResponseTextFormatConfigurationJsonObject fromJson(JsonReader jsonReader) throws IOException { + public static TextResponseFormatConfigurationResponseFormatText fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ResponseTextFormatConfigurationJsonObject deserializedResponseTextFormatConfigurationJsonObject - = new ResponseTextFormatConfigurationJsonObject(); + TextResponseFormatConfigurationResponseFormatText deserializedTextResponseFormatConfigurationResponseFormatText + = new TextResponseFormatConfigurationResponseFormatText(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedResponseTextFormatConfigurationJsonObject.type - = ResponseTextFormatConfigurationType.fromString(reader.getString()); + deserializedTextResponseFormatConfigurationResponseFormatText.type + = TextResponseFormatConfigurationType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedResponseTextFormatConfigurationJsonObject; + return deserializedTextResponseFormatConfigurationResponseFormatText; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationType.java new file mode 100644 index 000000000000..4acc51c21691 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatConfigurationType.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.agents.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for TextResponseFormatConfigurationType. + */ +public final class TextResponseFormatConfigurationType + extends ExpandableStringEnum { + + /** + * Static value text for TextResponseFormatConfigurationType. + */ + @Generated + public static final TextResponseFormatConfigurationType TEXT = fromString("text"); + + /** + * Static value json_schema for TextResponseFormatConfigurationType. + */ + @Generated + public static final TextResponseFormatConfigurationType JSON_SCHEMA = fromString("json_schema"); + + /** + * Static value json_object for TextResponseFormatConfigurationType. + */ + @Generated + public static final TextResponseFormatConfigurationType JSON_OBJECT = fromString("json_object"); + + /** + * Creates a new instance of TextResponseFormatConfigurationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public TextResponseFormatConfigurationType() { + } + + /** + * Creates or finds a TextResponseFormatConfigurationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding TextResponseFormatConfigurationType. + */ + @Generated + public static TextResponseFormatConfigurationType fromString(String name) { + return fromString(name, TextResponseFormatConfigurationType.class); + } + + /** + * Gets known TextResponseFormatConfigurationType values. + * + * @return known TextResponseFormatConfigurationType values. + */ + @Generated + public static Collection values() { + return values(TextResponseFormatConfigurationType.class); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonSchema.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatJsonSchema.java similarity index 55% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonSchema.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatJsonSchema.java index 9ddac84dbfb0..c651f2a0fa77 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonSchema.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TextResponseFormatJsonSchema.java @@ -5,25 +5,25 @@ 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; /** + * JSON schema + * * JSON Schema response format. Used to generate structured JSON responses. * Learn more about [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs). */ @Fluent -public final class ResponseTextFormatConfigurationJsonSchema extends ResponseTextFormatConfiguration { +public final class TextResponseFormatJsonSchema extends TextResponseFormatConfiguration { /* * The type property. */ @Generated - private ResponseTextFormatConfigurationType type = ResponseTextFormatConfigurationType.JSON_SCHEMA; + private TextResponseFormatConfigurationType type = TextResponseFormatConfigurationType.JSON_SCHEMA; /* * A description of what the response format is for, used by the model to @@ -43,18 +43,26 @@ public final class ResponseTextFormatConfigurationJsonSchema extends ResponseTex * The schema property. */ @Generated - private final Map schema; + private final ResponseFormatJsonSchemaSchema schema; /* - * Whether to enable strict schema adherence when generating the output. - * If set to true, the model will always follow the exact schema defined - * in the `schema` field. Only a subset of JSON Schema is supported when - * `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). + * The strict property. */ @Generated private Boolean strict; + /** + * Creates an instance of TextResponseFormatJsonSchema class. + * + * @param name the name value to set. + * @param schema the schema value to set. + */ + @Generated + public TextResponseFormatJsonSchema(String name, ResponseFormatJsonSchemaSchema schema) { + this.name = name; + this.schema = schema; + } + /** * Get the type property: The type property. * @@ -62,7 +70,7 @@ public final class ResponseTextFormatConfigurationJsonSchema extends ResponseTex */ @Generated @Override - public ResponseTextFormatConfigurationType getType() { + public TextResponseFormatConfigurationType getType() { return this.type; } @@ -82,10 +90,10 @@ public String getDescription() { * determine how to respond in the format. * * @param description the description value to set. - * @return the ResponseTextFormatConfigurationJsonSchema object itself. + * @return the TextResponseFormatJsonSchema object itself. */ @Generated - public ResponseTextFormatConfigurationJsonSchema setDescription(String description) { + public TextResponseFormatJsonSchema setDescription(String description) { this.description = description; return this; } @@ -107,16 +115,12 @@ public String getName() { * @return the schema value. */ @Generated - public Map getSchema() { + public ResponseFormatJsonSchemaSchema getSchema() { return this.schema; } /** - * Get the strict property: Whether to enable strict schema adherence when generating the output. - * If set to true, the model will always follow the exact schema defined - * in the `schema` field. Only a subset of JSON Schema is supported when - * `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). + * Get the strict property: The strict property. * * @return the strict value. */ @@ -126,17 +130,13 @@ public Boolean isStrict() { } /** - * Set the strict property: Whether to enable strict schema adherence when generating the output. - * If set to true, the model will always follow the exact schema defined - * in the `schema` field. Only a subset of JSON Schema is supported when - * `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). + * Set the strict property: The strict property. * * @param strict the strict value to set. - * @return the ResponseTextFormatConfigurationJsonSchema object itself. + * @return the TextResponseFormatJsonSchema object itself. */ @Generated - public ResponseTextFormatConfigurationJsonSchema setStrict(Boolean strict) { + public TextResponseFormatJsonSchema setStrict(Boolean strict) { this.strict = strict; return this; } @@ -149,8 +149,7 @@ public ResponseTextFormatConfigurationJsonSchema setStrict(Boolean strict) { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); - jsonWriter.writeMapField("schema", this.schema, - (writer, element) -> writer.writeUntyped(element == null ? null : element.toObject(Object.class))); + jsonWriter.writeJsonField("schema", this.schema); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeStringField("description", this.description); jsonWriter.writeBooleanField("strict", this.strict); @@ -158,20 +157,20 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResponseTextFormatConfigurationJsonSchema from the JsonReader. + * Reads an instance of TextResponseFormatJsonSchema from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResponseTextFormatConfigurationJsonSchema if the JsonReader was pointing to an instance of - * it, or null if it was pointing to JSON null. + * @return An instance of TextResponseFormatJsonSchema 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 ResponseTextFormatConfigurationJsonSchema. + * @throws IOException If an error occurs while reading the TextResponseFormatJsonSchema. */ @Generated - public static ResponseTextFormatConfigurationJsonSchema fromJson(JsonReader jsonReader) throws IOException { + public static TextResponseFormatJsonSchema fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String name = null; - Map schema = null; - ResponseTextFormatConfigurationType type = ResponseTextFormatConfigurationType.JSON_SCHEMA; + ResponseFormatJsonSchemaSchema schema = null; + TextResponseFormatConfigurationType type = TextResponseFormatConfigurationType.JSON_SCHEMA; String description = null; Boolean strict = null; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -180,10 +179,9 @@ public static ResponseTextFormatConfigurationJsonSchema fromJson(JsonReader json if ("name".equals(fieldName)) { name = reader.getString(); } else if ("schema".equals(fieldName)) { - schema = reader.readMap(reader1 -> reader1 - .getNullable(nonNullReader -> BinaryData.fromObject(nonNullReader.readUntyped()))); + schema = ResponseFormatJsonSchemaSchema.fromJson(reader); } else if ("type".equals(fieldName)) { - type = ResponseTextFormatConfigurationType.fromString(reader.getString()); + type = TextResponseFormatConfigurationType.fromString(reader.getString()); } else if ("description".equals(fieldName)) { description = reader.getString(); } else if ("strict".equals(fieldName)) { @@ -192,24 +190,12 @@ public static ResponseTextFormatConfigurationJsonSchema fromJson(JsonReader json reader.skipChildren(); } } - ResponseTextFormatConfigurationJsonSchema deserializedResponseTextFormatConfigurationJsonSchema - = new ResponseTextFormatConfigurationJsonSchema(name, schema); - deserializedResponseTextFormatConfigurationJsonSchema.type = type; - deserializedResponseTextFormatConfigurationJsonSchema.description = description; - deserializedResponseTextFormatConfigurationJsonSchema.strict = strict; - return deserializedResponseTextFormatConfigurationJsonSchema; + TextResponseFormatJsonSchema deserializedTextResponseFormatJsonSchema + = new TextResponseFormatJsonSchema(name, schema); + deserializedTextResponseFormatJsonSchema.type = type; + deserializedTextResponseFormatJsonSchema.description = description; + deserializedTextResponseFormatJsonSchema.strict = strict; + return deserializedTextResponseFormatJsonSchema; }); } - - /** - * Creates an instance of ResponseTextFormatConfigurationJsonSchema class. - * - * @param name the name value to set. - * @param schema the schema value to set. - */ - @Generated - public ResponseTextFormatConfigurationJsonSchema(String name, Map schema) { - this.name = name; - this.schema = schema; - } } 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 6ef62a6135d4..a6f4cbe1b2f7 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 @@ -12,7 +12,7 @@ import java.io.IOException; /** - * The Tool model. + * A tool that can be used to generate a response. */ @Immutable public class Tool implements JsonSerializable { @@ -77,44 +77,52 @@ public static Tool fromJson(JsonReader jsonReader) throws IOException { } } // Use the discriminator value to determine which subtype should be deserialized. - if ("function".equals(discriminatorValue)) { - return FunctionTool.fromJson(readerToUse.reset()); - } else if ("file_search".equals(discriminatorValue)) { - return FileSearchTool.fromJson(readerToUse.reset()); - } else if ("computer_use_preview".equals(discriminatorValue)) { - return ComputerUsePreviewTool.fromJson(readerToUse.reset()); - } else if ("web_search_preview".equals(discriminatorValue)) { - return WebSearchPreviewTool.fromJson(readerToUse.reset()); - } else if ("code_interpreter".equals(discriminatorValue)) { - return CodeInterpreterTool.fromJson(readerToUse.reset()); - } else if ("image_generation".equals(discriminatorValue)) { - return ImageGenTool.fromJson(readerToUse.reset()); - } else if ("local_shell".equals(discriminatorValue)) { - return LocalShellTool.fromJson(readerToUse.reset()); - } else if ("mcp".equals(discriminatorValue)) { - return MCPTool.fromJson(readerToUse.reset()); - } else if ("bing_grounding".equals(discriminatorValue)) { - return BingGroundingAgentTool.fromJson(readerToUse.reset()); + if ("bing_grounding".equals(discriminatorValue)) { + return BingGroundingTool.fromJson(readerToUse.reset()); } else if ("fabric_dataagent_preview".equals(discriminatorValue)) { - return MicrosoftFabricAgentTool.fromJson(readerToUse.reset()); + return MicrosoftFabricPreviewTool.fromJson(readerToUse.reset()); } else if ("sharepoint_grounding_preview".equals(discriminatorValue)) { - return SharepointAgentTool.fromJson(readerToUse.reset()); + return SharepointPreviewTool.fromJson(readerToUse.reset()); } else if ("azure_ai_search".equals(discriminatorValue)) { - return AzureAISearchAgentTool.fromJson(readerToUse.reset()); + return AzureAISearchTool.fromJson(readerToUse.reset()); } else if ("openapi".equals(discriminatorValue)) { - return OpenApiAgentTool.fromJson(readerToUse.reset()); + return OpenApiTool.fromJson(readerToUse.reset()); } else if ("bing_custom_search_preview".equals(discriminatorValue)) { - return BingCustomSearchAgentTool.fromJson(readerToUse.reset()); + return BingCustomSearchPreviewTool.fromJson(readerToUse.reset()); } else if ("browser_automation_preview".equals(discriminatorValue)) { - return BrowserAutomationAgentTool.fromJson(readerToUse.reset()); + return BrowserAutomationPreviewTool.fromJson(readerToUse.reset()); } else if ("azure_function".equals(discriminatorValue)) { - return AzureFunctionAgentTool.fromJson(readerToUse.reset()); + return AzureFunctionTool.fromJson(readerToUse.reset()); } else if ("capture_structured_outputs".equals(discriminatorValue)) { return CaptureStructuredOutputsTool.fromJson(readerToUse.reset()); } else if ("a2a_preview".equals(discriminatorValue)) { - return A2ATool.fromJson(readerToUse.reset()); + return A2APreviewTool.fromJson(readerToUse.reset()); } else if ("memory_search".equals(discriminatorValue)) { - return MemorySearchTool.fromJson(readerToUse.reset()); + return MemorySearchPreviewTool.fromJson(readerToUse.reset()); + } else if ("code_interpreter".equals(discriminatorValue)) { + return CodeInterpreterTool.fromJson(readerToUse.reset()); + } else if ("function".equals(discriminatorValue)) { + return FunctionTool.fromJson(readerToUse.reset()); + } else if ("file_search".equals(discriminatorValue)) { + return FileSearchTool.fromJson(readerToUse.reset()); + } else if ("computer_use_preview".equals(discriminatorValue)) { + return ComputerUsePreviewTool.fromJson(readerToUse.reset()); + } else if ("web_search".equals(discriminatorValue)) { + return WebSearchTool.fromJson(readerToUse.reset()); + } else if ("mcp".equals(discriminatorValue)) { + return MCPTool.fromJson(readerToUse.reset()); + } else if ("image_generation".equals(discriminatorValue)) { + return ImageGenTool.fromJson(readerToUse.reset()); + } else if ("local_shell".equals(discriminatorValue)) { + return LocalShellToolParam.fromJson(readerToUse.reset()); + } else if ("shell".equals(discriminatorValue)) { + return FunctionShellToolParam.fromJson(readerToUse.reset()); + } else if ("custom".equals(discriminatorValue)) { + return CustomToolParam.fromJson(readerToUse.reset()); + } else if ("web_search_preview".equals(discriminatorValue)) { + return WebSearchPreviewTool.fromJson(readerToUse.reset()); + } else if ("apply_patch".equals(discriminatorValue)) { + return ApplyPatchToolParam.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } 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 9d6489ade620..fa31722d3978 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 @@ -8,7 +8,7 @@ import java.util.Collection; /** - * A tool that can be used to generate a response. + * Defines values for ToolType. */ public final class ToolType extends ExpandableStringEnum { @@ -156,4 +156,28 @@ public static ToolType fromString(String name) { public static Collection values() { return values(ToolType.class); } + + /** + * Static value web_search for ToolType. + */ + @Generated + public static final ToolType WEB_SEARCH = fromString("web_search"); + + /** + * Static value shell for ToolType. + */ + @Generated + public static final ToolType SHELL = fromString("shell"); + + /** + * Static value custom for ToolType. + */ + @Generated + public static final ToolType CUSTOM = fromString("custom"); + + /** + * Static value apply_patch for ToolType. + */ + @Generated + public static final ToolType APPLY_PATCH = fromString("apply_patch"); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TopLogProb.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TopLogProb.java index 75c90d75bc1c..ffa24f07eb43 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TopLogProb.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/TopLogProb.java @@ -13,6 +13,8 @@ import java.util.List; /** + * Top log probability + * * The top log probability of a token. */ @Immutable @@ -34,7 +36,7 @@ public final class TopLogProb implements JsonSerializable { * The bytes property. */ @Generated - private final List bytes; + private final List bytes; /** * Creates an instance of TopLogProb class. @@ -44,7 +46,7 @@ public final class TopLogProb implements JsonSerializable { * @param bytes the bytes value to set. */ @Generated - public TopLogProb(String token, double logprob, List bytes) { + public TopLogProb(String token, double logprob, List bytes) { this.token = token; this.logprob = logprob; this.bytes = bytes; @@ -76,7 +78,7 @@ public double getLogprob() { * @return the bytes value. */ @Generated - public List getBytes() { + public List getBytes() { return this.bytes; } @@ -89,7 +91,7 @@ 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.writeInt(element)); + jsonWriter.writeArrayField("bytes", this.bytes, (writer, element) -> writer.writeLong(element)); return jsonWriter.writeEndObject(); } @@ -107,7 +109,7 @@ public static TopLogProb fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String token = null; double logprob = 0.0; - List bytes = null; + List bytes = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -116,7 +118,7 @@ public static TopLogProb fromJson(JsonReader jsonReader) throws IOException { } else if ("logprob".equals(fieldName)) { logprob = reader.getDouble(); } else if ("bytes".equals(fieldName)) { - bytes = reader.readArray(reader1 -> reader1.getInt()); + bytes = reader.readArray(reader1 -> reader1.getLong()); } else { reader.skipChildren(); } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionTypeKeys.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Type.java similarity index 76% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionTypeKeys.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Type.java index d32f84af05b8..6c5ac0d2787d 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionTypeKeys.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Type.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Type + * * An action to type in text. */ @Immutable -public final class ComputerActionTypeKeys extends ComputerAction { +public final class Type extends ComputerAction { /* * The type property. @@ -29,12 +31,12 @@ public final class ComputerActionTypeKeys extends ComputerAction { private final String text; /** - * Creates an instance of ComputerActionTypeKeys class. + * Creates an instance of Type class. * * @param text the text value to set. */ @Generated - public ComputerActionTypeKeys(String text) { + public Type(String text) { this.text = text; } @@ -72,16 +74,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ComputerActionTypeKeys from the JsonReader. + * Reads an instance of Type from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionTypeKeys if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of Type 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 ComputerActionTypeKeys. + * @throws IOException If an error occurs while reading the Type. */ @Generated - public static ComputerActionTypeKeys fromJson(JsonReader jsonReader) throws IOException { + public static Type fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String text = null; ComputerActionType type = ComputerActionType.TYPE; @@ -96,9 +98,9 @@ public static ComputerActionTypeKeys fromJson(JsonReader jsonReader) throws IOEx reader.skipChildren(); } } - ComputerActionTypeKeys deserializedComputerActionTypeKeys = new ComputerActionTypeKeys(text); - deserializedComputerActionTypeKeys.type = type; - return deserializedComputerActionTypeKeys; + Type deserializedType = new Type(text); + deserializedType.type = type; + return deserializedType; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationUrlCitation.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UrlCitationBody.java similarity index 76% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationUrlCitation.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UrlCitationBody.java index 4be24f0ab8e0..4fbba362ee0e 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/AnnotationUrlCitation.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UrlCitationBody.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * URL citation + * * A citation for a web resource used to generate a model response. */ @Immutable -public final class AnnotationUrlCitation extends Annotation { +public final class UrlCitationBody extends Annotation { /* * The type property. @@ -32,13 +34,13 @@ public final class AnnotationUrlCitation extends Annotation { * The index of the first character of the URL citation in the message. */ @Generated - private final int startIndex; + private final long startIndex; /* * The index of the last character of the URL citation in the message. */ @Generated - private final int endIndex; + private final long endIndex; /* * The title of the web resource. @@ -47,7 +49,7 @@ public final class AnnotationUrlCitation extends Annotation { private final String title; /** - * Creates an instance of AnnotationUrlCitation class. + * Creates an instance of UrlCitationBody class. * * @param url the url value to set. * @param startIndex the startIndex value to set. @@ -55,7 +57,7 @@ public final class AnnotationUrlCitation extends Annotation { * @param title the title value to set. */ @Generated - public AnnotationUrlCitation(String url, int startIndex, int endIndex, String title) { + public UrlCitationBody(String url, long startIndex, long endIndex, String title) { this.url = url; this.startIndex = startIndex; this.endIndex = endIndex; @@ -89,7 +91,7 @@ public String getUrl() { * @return the startIndex value. */ @Generated - public int getStartIndex() { + public long getStartIndex() { return this.startIndex; } @@ -99,7 +101,7 @@ public int getStartIndex() { * @return the endIndex value. */ @Generated - public int getEndIndex() { + public long getEndIndex() { return this.endIndex; } @@ -121,28 +123,28 @@ public String getTitle() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("url", this.url); - jsonWriter.writeIntField("start_index", this.startIndex); - jsonWriter.writeIntField("end_index", this.endIndex); + 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 AnnotationUrlCitation from the JsonReader. + * Reads an instance of UrlCitationBody from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of AnnotationUrlCitation if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @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 AnnotationUrlCitation. + * @throws IOException If an error occurs while reading the UrlCitationBody. */ @Generated - public static AnnotationUrlCitation fromJson(JsonReader jsonReader) throws IOException { + public static UrlCitationBody fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String url = null; - int startIndex = 0; - int endIndex = 0; + long startIndex = 0L; + long endIndex = 0L; String title = null; AnnotationType type = AnnotationType.URL_CITATION; while (reader.nextToken() != JsonToken.END_OBJECT) { @@ -151,9 +153,9 @@ public static AnnotationUrlCitation fromJson(JsonReader jsonReader) throws IOExc if ("url".equals(fieldName)) { url = reader.getString(); } else if ("start_index".equals(fieldName)) { - startIndex = reader.getInt(); + startIndex = reader.getLong(); } else if ("end_index".equals(fieldName)) { - endIndex = reader.getInt(); + endIndex = reader.getLong(); } else if ("title".equals(fieldName)) { title = reader.getString(); } else if ("type".equals(fieldName)) { @@ -162,10 +164,9 @@ public static AnnotationUrlCitation fromJson(JsonReader jsonReader) throws IOExc reader.skipChildren(); } } - AnnotationUrlCitation deserializedAnnotationUrlCitation - = new AnnotationUrlCitation(url, startIndex, endIndex, title); - deserializedAnnotationUrlCitation.type = type; - return deserializedAnnotationUrlCitation; + 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/models/UserProfileMemoryItem.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java index dabd464e4d46..db966153f3d2 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java @@ -35,7 +35,7 @@ public final class UserProfileMemoryItem extends MemoryItem { * @param content the content value to set. */ @Generated - public UserProfileMemoryItem(String memoryId, OffsetDateTime updatedAt, String scope, String content) { + private UserProfileMemoryItem(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/ComputerActionWait.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Wait.java similarity index 69% rename from sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionWait.java rename to sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Wait.java index aaab373f0597..7018d1be60e8 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/ComputerActionWait.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/Wait.java @@ -11,10 +11,12 @@ import java.io.IOException; /** + * Wait + * * A wait action. */ @Immutable -public final class ComputerActionWait extends ComputerAction { +public final class Wait extends ComputerAction { /* * The type property. @@ -23,10 +25,10 @@ public final class ComputerActionWait extends ComputerAction { private ComputerActionType type = ComputerActionType.WAIT; /** - * Creates an instance of ComputerActionWait class. + * Creates an instance of Wait class. */ @Generated - public ComputerActionWait() { + public Wait() { } /** @@ -52,27 +54,27 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ComputerActionWait from the JsonReader. + * Reads an instance of Wait from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ComputerActionWait 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 ComputerActionWait. + * @return An instance of Wait 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 Wait. */ @Generated - public static ComputerActionWait fromJson(JsonReader jsonReader) throws IOException { + public static Wait fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ComputerActionWait deserializedComputerActionWait = new ComputerActionWait(); + Wait deserializedWait = new Wait(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedComputerActionWait.type = ComputerActionType.fromString(reader.getString()); + deserializedWait.type = ComputerActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - return deserializedComputerActionWait; + return deserializedWait; }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionFind.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionFind.java index 399b384b1904..937485f3f1d9 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionFind.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionFind.java @@ -6,21 +6,24 @@ 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": Searches for a pattern within a loaded page. */ @Immutable -public final class WebSearchActionFind extends WebSearchAction { +public final class WebSearchActionFind implements JsonSerializable { /* - * The type property. + * The action type. */ @Generated - private WebSearchActionType type = WebSearchActionType.FIND; + private final String type = "find_in_page"; /* * The URL of the page searched for the pattern. @@ -47,13 +50,12 @@ public WebSearchActionFind(String url, String pattern) { } /** - * Get the type property: The type property. + * Get the type property: The action type. * * @return the type value. */ @Generated - @Override - public WebSearchActionType getType() { + public String getType() { return this.type; } @@ -84,9 +86,9 @@ public String getPattern() { @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); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -104,7 +106,6 @@ public static WebSearchActionFind fromJson(JsonReader jsonReader) throws IOExcep return jsonReader.readObject(reader -> { String url = null; String pattern = null; - WebSearchActionType type = WebSearchActionType.FIND; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -112,15 +113,11 @@ public static WebSearchActionFind fromJson(JsonReader jsonReader) throws IOExcep url = reader.getString(); } else if ("pattern".equals(fieldName)) { pattern = reader.getString(); - } else if ("type".equals(fieldName)) { - type = WebSearchActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - WebSearchActionFind deserializedWebSearchActionFind = new WebSearchActionFind(url, pattern); - deserializedWebSearchActionFind.type = type; - return deserializedWebSearchActionFind; + return new WebSearchActionFind(url, pattern); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionOpenPage.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionOpenPage.java index 6d93d747755d..e1ef7170c245 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionOpenPage.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionOpenPage.java @@ -6,21 +6,24 @@ 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; /** + * Open page action + * * Action type "open_page" - Opens a specific URL from search results. */ @Immutable -public final class WebSearchActionOpenPage extends WebSearchAction { +public final class WebSearchActionOpenPage implements JsonSerializable { /* - * The type property. + * The action type. */ @Generated - private WebSearchActionType type = WebSearchActionType.OPEN_PAGE; + private final String type = "open_page"; /* * The URL opened by the model. @@ -39,13 +42,12 @@ public WebSearchActionOpenPage(String url) { } /** - * Get the type property: The type property. + * Get the type property: The action type. * * @return the type value. */ @Generated - @Override - public WebSearchActionType getType() { + public String getType() { return this.type; } @@ -66,8 +68,8 @@ 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("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -84,21 +86,16 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static WebSearchActionOpenPage fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String url = null; - WebSearchActionType type = WebSearchActionType.OPEN_PAGE; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("url".equals(fieldName)) { url = reader.getString(); - } else if ("type".equals(fieldName)) { - type = WebSearchActionType.fromString(reader.getString()); } else { reader.skipChildren(); } } - WebSearchActionOpenPage deserializedWebSearchActionOpenPage = new WebSearchActionOpenPage(url); - deserializedWebSearchActionOpenPage.type = type; - return deserializedWebSearchActionOpenPage; + return new WebSearchActionOpenPage(url); }); } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionSearch.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionSearch.java index 253321c5aa0a..999a0dea63e5 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionSearch.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchActionSearch.java @@ -6,25 +6,28 @@ 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 extends WebSearchAction { +public final class WebSearchActionSearch implements JsonSerializable { /* - * The type property. + * The action type. */ @Generated - private WebSearchActionType type = WebSearchActionType.SEARCH; + private final String type = "search"; /* - * The search query. + * [DEPRECATED] The search query. */ @Generated private final String query; @@ -48,18 +51,17 @@ public WebSearchActionSearch(String query) { } /** - * Get the type property: The type property. + * Get the type property: The action type. * * @return the type value. */ @Generated - @Override - public WebSearchActionType getType() { + public String getType() { return this.type; } /** - * Get the query property: The search query. + * Get the query property: [DEPRECATED] The search query. * * @return the query value. */ @@ -101,8 +103,9 @@ public WebSearchActionSearch setSources(List sourc @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("type", this.type); jsonWriter.writeStringField("query", this.query); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("queries", this.queries, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("sources", this.sources, (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -120,15 +123,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static WebSearchActionSearch fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { String query = null; - WebSearchActionType type = WebSearchActionType.SEARCH; + 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 ("type".equals(fieldName)) { - type = WebSearchActionType.fromString(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 { @@ -136,9 +139,43 @@ public static WebSearchActionSearch fromJson(JsonReader jsonReader) throws IOExc } } WebSearchActionSearch deserializedWebSearchActionSearch = new WebSearchActionSearch(query); - deserializedWebSearchActionSearch.type = type; + deserializedWebSearchActionSearch.queries = queries; deserializedWebSearchActionSearch.sources = sources; return deserializedWebSearchActionSearch; }); } + + /* + * Search queries + * + * The search queries. + */ + @Generated + private List queries; + + /** + * 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; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java new file mode 100644 index 000000000000..8effca5dc316 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java @@ -0,0 +1,217 @@ +// 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; + +/** + * Web search approximate location + * + * The approximate location of the user. + */ +@Fluent +public final class WebSearchApproximateLocation implements JsonSerializable { + + /* + * The type of location approximation. Always `approximate`. + */ + @Generated + private WebSearchApproximateLocationType type; + + /* + * The country property. + */ + @Generated + private String country; + + /* + * The region property. + */ + @Generated + private String region; + + /* + * The city property. + */ + @Generated + private String city; + + /* + * The timezone property. + */ + @Generated + private String timezone; + + /** + * Creates an instance of WebSearchApproximateLocation class. + */ + @Generated + public WebSearchApproximateLocation() { + } + + /** + * Get the type property: The type of location approximation. Always `approximate`. + * + * @return the type value. + */ + @Generated + public WebSearchApproximateLocationType getType() { + return this.type; + } + + /** + * Set the type property: The type of location approximation. Always `approximate`. + * + * @param type the type value to set. + * @return the WebSearchApproximateLocation object itself. + */ + @Generated + public WebSearchApproximateLocation setType(WebSearchApproximateLocationType type) { + this.type = type; + return this; + } + + /** + * Get the country property: The country property. + * + * @return the country value. + */ + @Generated + public String getCountry() { + return this.country; + } + + /** + * Set the country property: The country property. + * + * @param country the country value to set. + * @return the WebSearchApproximateLocation object itself. + */ + @Generated + public WebSearchApproximateLocation setCountry(String country) { + this.country = country; + return this; + } + + /** + * Get the region property: The region property. + * + * @return the region value. + */ + @Generated + public String getRegion() { + return this.region; + } + + /** + * Set the region property: The region property. + * + * @param region the region value to set. + * @return the WebSearchApproximateLocation object itself. + */ + @Generated + public WebSearchApproximateLocation setRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the city property: The city property. + * + * @return the city value. + */ + @Generated + public String getCity() { + return this.city; + } + + /** + * Set the city property: The city property. + * + * @param city the city value to set. + * @return the WebSearchApproximateLocation object itself. + */ + @Generated + public WebSearchApproximateLocation setCity(String city) { + this.city = city; + return this; + } + + /** + * Get the timezone property: The timezone property. + * + * @return the timezone value. + */ + @Generated + public String getTimezone() { + return this.timezone; + } + + /** + * Set the timezone property: The timezone property. + * + * @param timezone the timezone value to set. + * @return the WebSearchApproximateLocation object itself. + */ + @Generated + public WebSearchApproximateLocation setTimezone(String timezone) { + this.timezone = timezone; + 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("country", this.country); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("city", this.city); + jsonWriter.writeStringField("timezone", this.timezone); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebSearchApproximateLocation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebSearchApproximateLocation 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 WebSearchApproximateLocation. + */ + @Generated + public static WebSearchApproximateLocation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebSearchApproximateLocation deserializedWebSearchApproximateLocation = new WebSearchApproximateLocation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedWebSearchApproximateLocation.type + = WebSearchApproximateLocationType.fromString(reader.getString()); + } else if ("country".equals(fieldName)) { + deserializedWebSearchApproximateLocation.country = reader.getString(); + } else if ("region".equals(fieldName)) { + deserializedWebSearchApproximateLocation.region = reader.getString(); + } else if ("city".equals(fieldName)) { + deserializedWebSearchApproximateLocation.city = reader.getString(); + } else if ("timezone".equals(fieldName)) { + deserializedWebSearchApproximateLocation.timezone = reader.getString(); + } else { + reader.skipChildren(); + } + } + return deserializedWebSearchApproximateLocation; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocationType.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocationType.java new file mode 100644 index 000000000000..efbcfb94d123 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocationType.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; + +/** + * Defines values for WebSearchApproximateLocationType. + */ +public enum WebSearchApproximateLocationType { + /** + * Enum value approximate. + */ + APPROXIMATE("approximate"); + + /** + * The actual serialized value for a WebSearchApproximateLocationType instance. + */ + private final String value; + + WebSearchApproximateLocationType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WebSearchApproximateLocationType instance. + * + * @param value the serialized value to parse. + * @return the parsed WebSearchApproximateLocationType object, or null if unable to parse. + */ + public static WebSearchApproximateLocationType fromString(String value) { + if (value == null) { + return null; + } + WebSearchApproximateLocationType[] items = WebSearchApproximateLocationType.values(); + for (WebSearchApproximateLocationType 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/WebSearchConfiguration.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchConfiguration.java new file mode 100644 index 000000000000..b2c4c2feb3c3 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchConfiguration.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; + +/** + * A web search configuration for bing custom search. + */ +@Immutable +public final class WebSearchConfiguration implements JsonSerializable { + + /* + * Project connection id for grounding with bing custom search + */ + @Generated + private final String projectConnectionId; + + /* + * Name of the custom configuration instance given to config. + */ + @Generated + private final String instanceName; + + /** + * Creates an instance of WebSearchConfiguration class. + * + * @param projectConnectionId the projectConnectionId value to set. + * @param instanceName the instanceName value to set. + */ + @Generated + public WebSearchConfiguration(String projectConnectionId, String instanceName) { + this.projectConnectionId = projectConnectionId; + this.instanceName = instanceName; + } + + /** + * Get the projectConnectionId property: Project connection id for grounding with bing custom search. + * + * @return the projectConnectionId value. + */ + @Generated + public String getProjectConnectionId() { + return this.projectConnectionId; + } + + /** + * Get the instanceName property: Name of the custom configuration instance given to config. + * + * @return the instanceName value. + */ + @Generated + public String getInstanceName() { + return this.instanceName; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("project_connection_id", this.projectConnectionId); + jsonWriter.writeStringField("instance_name", this.instanceName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebSearchConfiguration from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebSearchConfiguration 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 WebSearchConfiguration. + */ + @Generated + public static WebSearchConfiguration fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String projectConnectionId = null; + String instanceName = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("project_connection_id".equals(fieldName)) { + projectConnectionId = reader.getString(); + } else if ("instance_name".equals(fieldName)) { + instanceName = reader.getString(); + } else { + reader.skipChildren(); + } + } + return new WebSearchConfiguration(projectConnectionId, instanceName); + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java index 5c5d91c3126b..04fdb0d3cd4b 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java @@ -11,7 +11,10 @@ import java.io.IOException; /** - * Note: web_search is not yet available via Azure OpenAI. + * Web search preview + * + * This tool searches the web for relevant results to use in a response. Learn more about the [web search + * tool](https://platform.openai.com/docs/guides/tools-web-search). */ @Fluent public final class WebSearchPreviewTool extends Tool { @@ -23,17 +26,17 @@ public final class WebSearchPreviewTool extends Tool { private ToolType type = ToolType.WEB_SEARCH_PREVIEW; /* - * The user's location. + * The user_location property. */ @Generated - private Location userLocation; + private ApproximateLocation userLocation; /* * High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or * `high`. `medium` is the default. */ @Generated - private WebSearchPreviewToolSearchContextSize searchContextSize; + private SearchContextSize searchContextSize; /** * Creates an instance of WebSearchPreviewTool class. @@ -54,27 +57,15 @@ public ToolType getType() { } /** - * Get the userLocation property: The user's location. + * Get the userLocation property: The user_location property. * * @return the userLocation value. */ @Generated - public Location getUserLocation() { + public ApproximateLocation getUserLocation() { return this.userLocation; } - /** - * Set the userLocation property: The user's location. - * - * @param userLocation the userLocation value to set. - * @return the WebSearchPreviewTool object itself. - */ - @Generated - public WebSearchPreviewTool setUserLocation(Location userLocation) { - this.userLocation = userLocation; - return this; - } - /** * Get the searchContextSize property: High level guidance for the amount of context window space to use for the * search. One of `low`, `medium`, or `high`. `medium` is the default. @@ -82,23 +73,10 @@ public WebSearchPreviewTool setUserLocation(Location userLocation) { * @return the searchContextSize value. */ @Generated - public WebSearchPreviewToolSearchContextSize getSearchContextSize() { + public SearchContextSize getSearchContextSize() { return this.searchContextSize; } - /** - * Set the searchContextSize property: High level guidance for the amount of context window space to use for the - * search. One of `low`, `medium`, or `high`. `medium` is the default. - * - * @param searchContextSize the searchContextSize value to set. - * @return the WebSearchPreviewTool object itself. - */ - @Generated - public WebSearchPreviewTool setSearchContextSize(WebSearchPreviewToolSearchContextSize searchContextSize) { - this.searchContextSize = searchContextSize; - return this; - } - /** * {@inheritDoc} */ @@ -131,10 +109,10 @@ public static WebSearchPreviewTool fromJson(JsonReader jsonReader) throws IOExce if ("type".equals(fieldName)) { deserializedWebSearchPreviewTool.type = ToolType.fromString(reader.getString()); } else if ("user_location".equals(fieldName)) { - deserializedWebSearchPreviewTool.userLocation = Location.fromJson(reader); + deserializedWebSearchPreviewTool.userLocation = ApproximateLocation.fromJson(reader); } else if ("search_context_size".equals(fieldName)) { deserializedWebSearchPreviewTool.searchContextSize - = WebSearchPreviewToolSearchContextSize.fromString(reader.getString()); + = SearchContextSize.fromString(reader.getString()); } else { reader.skipChildren(); } @@ -142,4 +120,29 @@ public static WebSearchPreviewTool fromJson(JsonReader jsonReader) throws IOExce return deserializedWebSearchPreviewTool; }); } + + /** + * Set the userLocation property: The user_location property. + * + * @param userLocation the userLocation value to set. + * @return the WebSearchPreviewTool object itself. + */ + @Generated + public WebSearchPreviewTool setUserLocation(ApproximateLocation userLocation) { + this.userLocation = userLocation; + return this; + } + + /** + * Set the searchContextSize property: High level guidance for the amount of context window space to use for the + * search. One of `low`, `medium`, or `high`. `medium` is the default. + * + * @param searchContextSize the searchContextSize value to set. + * @return the WebSearchPreviewTool object itself. + */ + @Generated + public WebSearchPreviewTool setSearchContextSize(SearchContextSize searchContextSize) { + this.searchContextSize = searchContextSize; + return this; + } } diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchTool.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchTool.java new file mode 100644 index 000000000000..820e13fe76bb --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchTool.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.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; + +/** + * Web search + * + * Search the Internet for sources related to the prompt. Learn more about the + * [web search tool](https://platform.openai.com/docs/guides/tools-web-search). + */ +@Fluent +public final class WebSearchTool extends Tool { + + /* + * The type property. + */ + @Generated + private ToolType type = ToolType.WEB_SEARCH; + + /* + * The filters property. + */ + @Generated + private WebSearchToolFilters filters; + + /* + * The user_location property. + */ + @Generated + private WebSearchApproximateLocation userLocation; + + /* + * High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or + * `high`. `medium` is the default. + */ + @Generated + private WebSearchToolSearchContextSize searchContextSize; + + /* + * The project connections attached to this tool. There can be a maximum of 1 connection + * resource attached to the tool. + */ + @Generated + private WebSearchConfiguration customSearchConfiguration; + + /** + * Creates an instance of WebSearchTool class. + */ + @Generated + public WebSearchTool() { + } + + /** + * Get the type property: The type property. + * + * @return the type value. + */ + @Generated + @Override + public ToolType getType() { + return this.type; + } + + /** + * Get the filters property: The filters property. + * + * @return the filters value. + */ + @Generated + public WebSearchToolFilters getFilters() { + return this.filters; + } + + /** + * Set the filters property: The filters property. + * + * @param filters the filters value to set. + * @return the WebSearchTool object itself. + */ + @Generated + public WebSearchTool setFilters(WebSearchToolFilters filters) { + this.filters = filters; + return this; + } + + /** + * Get the userLocation property: The user_location property. + * + * @return the userLocation value. + */ + @Generated + public WebSearchApproximateLocation getUserLocation() { + return this.userLocation; + } + + /** + * Set the userLocation property: The user_location property. + * + * @param userLocation the userLocation value to set. + * @return the WebSearchTool object itself. + */ + @Generated + public WebSearchTool setUserLocation(WebSearchApproximateLocation userLocation) { + this.userLocation = userLocation; + return this; + } + + /** + * Get the searchContextSize property: High level guidance for the amount of context window space to use for the + * search. One of `low`, `medium`, or `high`. `medium` is the default. + * + * @return the searchContextSize value. + */ + @Generated + public WebSearchToolSearchContextSize getSearchContextSize() { + return this.searchContextSize; + } + + /** + * Set the searchContextSize property: High level guidance for the amount of context window space to use for the + * search. One of `low`, `medium`, or `high`. `medium` is the default. + * + * @param searchContextSize the searchContextSize value to set. + * @return the WebSearchTool object itself. + */ + @Generated + public WebSearchTool setSearchContextSize(WebSearchToolSearchContextSize searchContextSize) { + this.searchContextSize = searchContextSize; + return this; + } + + /** + * Get the customSearchConfiguration property: The project connections attached to this tool. There can be a maximum + * of 1 connection + * resource attached to the tool. + * + * @return the customSearchConfiguration value. + */ + @Generated + public WebSearchConfiguration getCustomSearchConfiguration() { + return this.customSearchConfiguration; + } + + /** + * Set the customSearchConfiguration property: The project connections attached to this tool. There can be a maximum + * of 1 connection + * resource attached to the tool. + * + * @param customSearchConfiguration the customSearchConfiguration value to set. + * @return the WebSearchTool object itself. + */ + @Generated + public WebSearchTool setCustomSearchConfiguration(WebSearchConfiguration customSearchConfiguration) { + this.customSearchConfiguration = customSearchConfiguration; + 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.writeJsonField("filters", this.filters); + jsonWriter.writeJsonField("user_location", this.userLocation); + jsonWriter.writeStringField("search_context_size", + this.searchContextSize == null ? null : this.searchContextSize.toString()); + jsonWriter.writeJsonField("custom_search_configuration", this.customSearchConfiguration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebSearchTool from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebSearchTool 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 WebSearchTool. + */ + @Generated + public static WebSearchTool fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebSearchTool deserializedWebSearchTool = new WebSearchTool(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("type".equals(fieldName)) { + deserializedWebSearchTool.type = ToolType.fromString(reader.getString()); + } else if ("filters".equals(fieldName)) { + deserializedWebSearchTool.filters = WebSearchToolFilters.fromJson(reader); + } else if ("user_location".equals(fieldName)) { + deserializedWebSearchTool.userLocation = WebSearchApproximateLocation.fromJson(reader); + } else if ("search_context_size".equals(fieldName)) { + deserializedWebSearchTool.searchContextSize + = WebSearchToolSearchContextSize.fromString(reader.getString()); + } else if ("custom_search_configuration".equals(fieldName)) { + deserializedWebSearchTool.customSearchConfiguration = WebSearchConfiguration.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedWebSearchTool; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolCallItemParam.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolCallItemParam.java deleted file mode 100644 index f50a62f2ed6c..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolCallItemParam.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.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 results of a web search tool call. See the - * [web search guide](https://platform.openai.com/docs/guides/tools-web-search) for more information. - */ -@Immutable -public final class WebSearchToolCallItemParam extends ItemParam { - - /* - * The type property. - */ - @Generated - private ItemType type = ItemType.WEB_SEARCH_CALL; - - /* - * 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). - */ - @Generated - private final WebSearchAction action; - - /** - * Creates an instance of WebSearchToolCallItemParam class. - * - * @param action the action value to set. - */ - @Generated - public WebSearchToolCallItemParam(WebSearchAction action) { - this.action = action; - } - - /** - * Get the type property: The type property. - * - * @return the type value. - */ - @Generated - @Override - public ItemType getType() { - return this.type; - } - - /** - * 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). - * - * @return the action value. - */ - @Generated - public WebSearchAction getAction() { - return this.action; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("action", this.action); - jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of WebSearchToolCallItemParam from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of WebSearchToolCallItemParam 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 WebSearchToolCallItemParam. - */ - @Generated - public static WebSearchToolCallItemParam fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - WebSearchAction action = null; - ItemType type = ItemType.WEB_SEARCH_CALL; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - if ("action".equals(fieldName)) { - action = WebSearchAction.fromJson(reader); - } else if ("type".equals(fieldName)) { - type = ItemType.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - WebSearchToolCallItemParam deserializedWebSearchToolCallItemParam = new WebSearchToolCallItemParam(action); - deserializedWebSearchToolCallItemParam.type = type; - return deserializedWebSearchToolCallItemParam; - }); - } -} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolFilters.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolFilters.java new file mode 100644 index 000000000000..06875ca4bf78 --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolFilters.java @@ -0,0 +1,93 @@ +// 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; + +/** + * The WebSearchToolFilters model. + */ +@Fluent +public final class WebSearchToolFilters implements JsonSerializable { + + /* + * The allowed_domains property. + */ + @Generated + private List allowedDomains; + + /** + * Creates an instance of WebSearchToolFilters class. + */ + @Generated + public WebSearchToolFilters() { + } + + /** + * Get the allowedDomains property: The allowed_domains property. + * + * @return the allowedDomains value. + */ + @Generated + public List getAllowedDomains() { + return this.allowedDomains; + } + + /** + * Set the allowedDomains property: The allowed_domains property. + * + * @param allowedDomains the allowedDomains value to set. + * @return the WebSearchToolFilters object itself. + */ + @Generated + public WebSearchToolFilters setAllowedDomains(List allowedDomains) { + this.allowedDomains = allowedDomains; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("allowed_domains", this.allowedDomains, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WebSearchToolFilters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WebSearchToolFilters 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 WebSearchToolFilters. + */ + @Generated + public static WebSearchToolFilters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WebSearchToolFilters deserializedWebSearchToolFilters = new WebSearchToolFilters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("allowed_domains".equals(fieldName)) { + List allowedDomains = reader.readArray(reader1 -> reader1.getString()); + deserializedWebSearchToolFilters.allowedDomains = allowedDomains; + } else { + reader.skipChildren(); + } + } + return deserializedWebSearchToolFilters; + }); + } +} diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolSearchContextSize.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolSearchContextSize.java new file mode 100644 index 000000000000..2346cb5296fe --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/models/WebSearchToolSearchContextSize.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.models; + +/** + * Defines values for WebSearchToolSearchContextSize. + */ +public enum WebSearchToolSearchContextSize { + /** + * Enum value low. + */ + LOW("low"), + + /** + * Enum value medium. + */ + MEDIUM("medium"), + + /** + * Enum value high. + */ + HIGH("high"); + + /** + * The actual serialized value for a WebSearchToolSearchContextSize instance. + */ + private final String value; + + WebSearchToolSearchContextSize(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a WebSearchToolSearchContextSize instance. + * + * @param value the serialized value to parse. + * @return the parsed WebSearchToolSearchContextSize object, or null if unable to parse. + */ + public static WebSearchToolSearchContextSize fromString(String value) { + if (value == null) { + return null; + } + WebSearchToolSearchContextSize[] items = WebSearchToolSearchContextSize.values(); + for (WebSearchToolSearchContextSize 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/resources/META-INF/azure-ai-agents_apiview_properties.json b/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_apiview_properties.json index 7ad01ea6db03..5d6353457ac5 100644 --- a/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_apiview_properties.json +++ b/sdk/ai/azure-ai-agents/src/main/resources/META-INF/azure-ai-agents_apiview_properties.json @@ -20,6 +20,8 @@ "com.azure.ai.agents.AgentsAsyncClient.getAgentWithResponse": "Azure.AI.Projects.Agents.getAgent", "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.streamAgentContainerLogs": "Azure.AI.Projects.Agents.streamAgentContainerLogs", + "com.azure.ai.agents.AgentsAsyncClient.streamAgentContainerLogsWithResponse": "Azure.AI.Projects.Agents.streamAgentContainerLogs", "com.azure.ai.agents.AgentsAsyncClient.updateAgent": "Azure.AI.Projects.Agents.updateAgent", "com.azure.ai.agents.AgentsAsyncClient.updateAgentFromManifest": "Azure.AI.Projects.Agents.updateAgentFromManifest", "com.azure.ai.agents.AgentsAsyncClient.updateAgentFromManifestWithResponse": "Azure.AI.Projects.Agents.updateAgentFromManifest", @@ -43,6 +45,8 @@ "com.azure.ai.agents.AgentsClient.getAgentWithResponse": "Azure.AI.Projects.Agents.getAgent", "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.streamAgentContainerLogs": "Azure.AI.Projects.Agents.streamAgentContainerLogs", + "com.azure.ai.agents.AgentsClient.streamAgentContainerLogsWithResponse": "Azure.AI.Projects.Agents.streamAgentContainerLogs", "com.azure.ai.agents.AgentsClient.updateAgent": "Azure.AI.Projects.Agents.updateAgent", "com.azure.ai.agents.AgentsClient.updateAgentFromManifest": "Azure.AI.Projects.Agents.updateAgentFromManifest", "com.azure.ai.agents.AgentsClient.updateAgentFromManifestWithResponse": "Azure.AI.Projects.Agents.updateAgentFromManifest", @@ -90,12 +94,16 @@ "com.azure.ai.agents.implementation.models.CreateAgentVersionRequest1": "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.DeleteScopeRequest": "Azure.AI.Projects.deleteScope.Request.anonymous", + "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.ItemReferenceParam": "OpenAI.ItemReferenceParam", "com.azure.ai.agents.implementation.models.SearchMemoriesRequest": "Azure.AI.Projects.searchMemories.Request.anonymous", "com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest1": "Azure.AI.Projects.updateAgentFromManifest.Request.anonymous", "com.azure.ai.agents.implementation.models.UpdateAgentRequest1": "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.models.A2ATool": "Azure.AI.Projects.A2ATool", + "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.AgentDefinition": "Azure.AI.Projects.AgentDefinition", "com.azure.ai.agents.models.AgentDetails": "Azure.AI.Projects.AgentObject", @@ -106,125 +114,156 @@ "com.azure.ai.agents.models.AgentReference": "Azure.AI.Projects.AgentReference", "com.azure.ai.agents.models.AgentVersionDetails": "Azure.AI.Projects.AgentVersionObject", "com.azure.ai.agents.models.Annotation": "OpenAI.Annotation", - "com.azure.ai.agents.models.AnnotationFileCitation": "OpenAI.AnnotationFileCitation", - "com.azure.ai.agents.models.AnnotationFilePath": "OpenAI.AnnotationFilePath", "com.azure.ai.agents.models.AnnotationType": "OpenAI.AnnotationType", - "com.azure.ai.agents.models.AnnotationUrlCitation": "OpenAI.AnnotationUrlCitation", + "com.azure.ai.agents.models.ApplyPatchCallOutputStatusParam": "OpenAI.ApplyPatchCallOutputStatusParam", + "com.azure.ai.agents.models.ApplyPatchCallStatusParam": "OpenAI.ApplyPatchCallStatusParam", + "com.azure.ai.agents.models.ApplyPatchCreateFileOperationParam": "OpenAI.ApplyPatchCreateFileOperationParam", + "com.azure.ai.agents.models.ApplyPatchDeleteFileOperationParam": "OpenAI.ApplyPatchDeleteFileOperationParam", + "com.azure.ai.agents.models.ApplyPatchOperationParam": "OpenAI.ApplyPatchOperationParam", + "com.azure.ai.agents.models.ApplyPatchOperationParamType": "OpenAI.ApplyPatchOperationParamType", + "com.azure.ai.agents.models.ApplyPatchToolParam": "OpenAI.ApplyPatchToolParam", + "com.azure.ai.agents.models.ApplyPatchUpdateFileOperationParam": "OpenAI.ApplyPatchUpdateFileOperationParam", "com.azure.ai.agents.models.ApproximateLocation": "OpenAI.ApproximateLocation", - "com.azure.ai.agents.models.AzureAISearchAgentTool": "Azure.AI.Projects.AzureAISearchAgentTool", "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.AzureFunctionAgentTool": "Azure.AI.Projects.AzureFunctionAgentTool", "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.AzureFunctionDefinitionFunction": "Azure.AI.Projects.AzureFunctionDefinition.function.anonymous", "com.azure.ai.agents.models.AzureFunctionStorageQueue": "Azure.AI.Projects.AzureFunctionStorageQueue", - "com.azure.ai.agents.models.BingCustomSearchAgentTool": "Azure.AI.Projects.BingCustomSearchAgentTool", + "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.BingGroundingAgentTool": "Azure.AI.Projects.BingGroundingAgentTool", "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.BrowserAutomationAgentTool": "Azure.AI.Projects.BrowserAutomationAgentTool", + "com.azure.ai.agents.models.BingGroundingTool": "Azure.AI.Projects.BingGroundingTool", + "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.CodeInterpreterOutput": "OpenAI.CodeInterpreterOutput", + "com.azure.ai.agents.models.ClickButtonType": "OpenAI.ClickButtonType", + "com.azure.ai.agents.models.ClickParam": "OpenAI.ClickParam", + "com.azure.ai.agents.models.CodeInterpreterContainerAuto": "OpenAI.CodeInterpreterContainerAuto", "com.azure.ai.agents.models.CodeInterpreterOutputImage": "OpenAI.CodeInterpreterOutputImage", "com.azure.ai.agents.models.CodeInterpreterOutputLogs": "OpenAI.CodeInterpreterOutputLogs", - "com.azure.ai.agents.models.CodeInterpreterOutputType": "OpenAI.CodeInterpreterOutputType", "com.azure.ai.agents.models.CodeInterpreterTool": "OpenAI.CodeInterpreterTool", - "com.azure.ai.agents.models.CodeInterpreterToolAuto": "OpenAI.CodeInterpreterToolAuto", - "com.azure.ai.agents.models.CodeInterpreterToolCallItemParam": "OpenAI.CodeInterpreterToolCallItemParam", "com.azure.ai.agents.models.ComparisonFilter": "OpenAI.ComparisonFilter", "com.azure.ai.agents.models.ComparisonFilterType": "OpenAI.ComparisonFilter.type.anonymous", "com.azure.ai.agents.models.CompoundFilter": "OpenAI.CompoundFilter", "com.azure.ai.agents.models.CompoundFilterType": "OpenAI.CompoundFilter.type.anonymous", "com.azure.ai.agents.models.ComputerAction": "OpenAI.ComputerAction", - "com.azure.ai.agents.models.ComputerActionClick": "OpenAI.ComputerActionClick", - "com.azure.ai.agents.models.ComputerActionClickButton": "OpenAI.ComputerActionClick.button.anonymous", - "com.azure.ai.agents.models.ComputerActionDoubleClick": "OpenAI.ComputerActionDoubleClick", - "com.azure.ai.agents.models.ComputerActionDrag": "OpenAI.ComputerActionDrag", - "com.azure.ai.agents.models.ComputerActionKeyPress": "OpenAI.ComputerActionKeyPress", - "com.azure.ai.agents.models.ComputerActionMove": "OpenAI.ComputerActionMove", - "com.azure.ai.agents.models.ComputerActionScreenshot": "OpenAI.ComputerActionScreenshot", - "com.azure.ai.agents.models.ComputerActionScroll": "OpenAI.ComputerActionScroll", "com.azure.ai.agents.models.ComputerActionType": "OpenAI.ComputerActionType", - "com.azure.ai.agents.models.ComputerActionTypeKeys": "OpenAI.ComputerActionTypeKeys", - "com.azure.ai.agents.models.ComputerActionWait": "OpenAI.ComputerActionWait", - "com.azure.ai.agents.models.ComputerToolCallItemParam": "OpenAI.ComputerToolCallItemParam", - "com.azure.ai.agents.models.ComputerToolCallOutputItemOutput": "OpenAI.ComputerToolCallOutputItemOutput", - "com.azure.ai.agents.models.ComputerToolCallOutputItemOutputComputerScreenshot": "OpenAI.ComputerToolCallOutputItemOutputComputerScreenshot", - "com.azure.ai.agents.models.ComputerToolCallOutputItemOutputType": "OpenAI.ComputerToolCallOutputItemOutputType", - "com.azure.ai.agents.models.ComputerToolCallOutputItemParam": "OpenAI.ComputerToolCallOutputItemParam", - "com.azure.ai.agents.models.ComputerToolCallSafetyCheck": "OpenAI.ComputerToolCallSafetyCheck", + "com.azure.ai.agents.models.ComputerCallSafetyCheckParam": "OpenAI.ComputerCallSafetyCheckParam", + "com.azure.ai.agents.models.ComputerEnvironment": "OpenAI.ComputerEnvironment", + "com.azure.ai.agents.models.ComputerScreenshotImage": "OpenAI.ComputerScreenshotImage", "com.azure.ai.agents.models.ComputerUsePreviewTool": "OpenAI.ComputerUsePreviewTool", - "com.azure.ai.agents.models.ComputerUsePreviewToolEnvironment": "OpenAI.ComputerUsePreviewTool.environment.anonymous", "com.azure.ai.agents.models.ContainerAppAgentDefinition": "Azure.AI.Projects.ContainerAppAgentDefinition", - "com.azure.ai.agents.models.Coordinate": "OpenAI.Coordinate", + "com.azure.ai.agents.models.ContainerFileCitationBody": "OpenAI.ContainerFileCitationBody", + "com.azure.ai.agents.models.ContainerLogKind": "Azure.AI.Projects.ContainerLogKind", + "com.azure.ai.agents.models.ContainerMemoryLimit": "OpenAI.ContainerMemoryLimit", + "com.azure.ai.agents.models.CustomGrammarFormatParam": "OpenAI.CustomGrammarFormatParam", + "com.azure.ai.agents.models.CustomTextFormatParam": "OpenAI.CustomTextFormatParam", + "com.azure.ai.agents.models.CustomToolParam": "OpenAI.CustomToolParam", + "com.azure.ai.agents.models.CustomToolParamFormat": "OpenAI.CustomToolParamFormat", + "com.azure.ai.agents.models.CustomToolParamFormatType": "OpenAI.CustomToolParamFormatType", "com.azure.ai.agents.models.DeleteAgentResponse": "Azure.AI.Projects.DeleteAgentResponse", "com.azure.ai.agents.models.DeleteAgentVersionResponse": "Azure.AI.Projects.DeleteAgentVersionResponse", "com.azure.ai.agents.models.DeleteMemoryStoreResponse": "Azure.AI.Projects.DeleteMemoryStoreResponse", + "com.azure.ai.agents.models.DetailEnum": "OpenAI.DetailEnum", + "com.azure.ai.agents.models.DoubleClickAction": "OpenAI.DoubleClickAction", + "com.azure.ai.agents.models.Drag": "OpenAI.Drag", + "com.azure.ai.agents.models.DragPoint": "OpenAI.DragPoint", "com.azure.ai.agents.models.Error": "OpenAI.Error", "com.azure.ai.agents.models.FabricDataAgentToolParameters": "Azure.AI.Projects.FabricDataAgentToolParameters", + "com.azure.ai.agents.models.FileCitationBody": "OpenAI.FileCitationBody", + "com.azure.ai.agents.models.FilePath": "OpenAI.FilePath", "com.azure.ai.agents.models.FileSearchTool": "OpenAI.FileSearchTool", - "com.azure.ai.agents.models.FileSearchToolCallItemParam": "OpenAI.FileSearchToolCallItemParam", - "com.azure.ai.agents.models.FileSearchToolCallItemParamResult": "OpenAI.FileSearchToolCallItemParam.result.anonymous", + "com.azure.ai.agents.models.FileSearchToolCallResults": "OpenAI.FileSearchToolCallResults", + "com.azure.ai.agents.models.FunctionAndCustomToolCallOutput": "OpenAI.FunctionAndCustomToolCallOutput", + "com.azure.ai.agents.models.FunctionAndCustomToolCallOutputInputFileContent": "OpenAI.FunctionAndCustomToolCallOutputInputFileContent", + "com.azure.ai.agents.models.FunctionAndCustomToolCallOutputInputImageContent": "OpenAI.FunctionAndCustomToolCallOutputInputImageContent", + "com.azure.ai.agents.models.FunctionAndCustomToolCallOutputInputTextContent": "OpenAI.FunctionAndCustomToolCallOutputInputTextContent", + "com.azure.ai.agents.models.FunctionAndCustomToolCallOutputType": "OpenAI.FunctionAndCustomToolCallOutputType", + "com.azure.ai.agents.models.FunctionCallItemStatus": "OpenAI.FunctionCallItemStatus", + "com.azure.ai.agents.models.FunctionShellActionParam": "OpenAI.FunctionShellActionParam", + "com.azure.ai.agents.models.FunctionShellCallItemStatus": "OpenAI.FunctionShellCallItemStatus", + "com.azure.ai.agents.models.FunctionShellCallOutputContentParam": "OpenAI.FunctionShellCallOutputContentParam", + "com.azure.ai.agents.models.FunctionShellCallOutputExitOutcomeParam": "OpenAI.FunctionShellCallOutputExitOutcomeParam", + "com.azure.ai.agents.models.FunctionShellCallOutputOutcomeParam": "OpenAI.FunctionShellCallOutputOutcomeParam", + "com.azure.ai.agents.models.FunctionShellCallOutputOutcomeParamType": "OpenAI.FunctionShellCallOutputOutcomeParamType", + "com.azure.ai.agents.models.FunctionShellCallOutputTimeoutOutcomeParam": "OpenAI.FunctionShellCallOutputTimeoutOutcomeParam", + "com.azure.ai.agents.models.FunctionShellToolParam": "OpenAI.FunctionShellToolParam", "com.azure.ai.agents.models.FunctionTool": "OpenAI.FunctionTool", - "com.azure.ai.agents.models.FunctionToolCallItemParam": "OpenAI.FunctionToolCallItemParam", - "com.azure.ai.agents.models.FunctionToolCallOutputItemParam": "OpenAI.FunctionToolCallOutputItemParam", + "com.azure.ai.agents.models.GrammarSyntax": "OpenAI.GrammarSyntax1", "com.azure.ai.agents.models.HostedAgentDefinition": "Azure.AI.Projects.HostedAgentDefinition", + "com.azure.ai.agents.models.HybridSearchOptions": "OpenAI.HybridSearchOptions", "com.azure.ai.agents.models.ImageBasedHostedAgentDefinition": "Azure.AI.Projects.ImageBasedHostedAgentDefinition", + "com.azure.ai.agents.models.ImageDetail": "OpenAI.ImageDetail", "com.azure.ai.agents.models.ImageGenTool": "OpenAI.ImageGenTool", "com.azure.ai.agents.models.ImageGenToolBackground": "OpenAI.ImageGenTool.background.anonymous", - "com.azure.ai.agents.models.ImageGenToolCallItemParam": "OpenAI.ImageGenToolCallItemParam", - "com.azure.ai.agents.models.ImageGenToolInputImageMask": "OpenAI.ImageGenTool.input_image_mask.anonymous", - "com.azure.ai.agents.models.ImageGenToolModel": null, + "com.azure.ai.agents.models.ImageGenToolInputImageMask": "OpenAI.ImageGenToolInputImageMask", + "com.azure.ai.agents.models.ImageGenToolModel": "OpenAI.ImageGenTool.model.anonymous", "com.azure.ai.agents.models.ImageGenToolModeration": "OpenAI.ImageGenTool.moderation.anonymous", "com.azure.ai.agents.models.ImageGenToolOutputFormat": "OpenAI.ImageGenTool.output_format.anonymous", "com.azure.ai.agents.models.ImageGenToolQuality": "OpenAI.ImageGenTool.quality.anonymous", "com.azure.ai.agents.models.ImageGenToolSize": "OpenAI.ImageGenTool.size.anonymous", - "com.azure.ai.agents.models.ItemContent": "OpenAI.ItemContent", - "com.azure.ai.agents.models.ItemContentInputAudio": "OpenAI.ItemContentInputAudio", - "com.azure.ai.agents.models.ItemContentInputAudioFormat": "OpenAI.ItemContentInputAudio.format.anonymous", - "com.azure.ai.agents.models.ItemContentInputFile": "OpenAI.ItemContentInputFile", - "com.azure.ai.agents.models.ItemContentInputImage": "OpenAI.ItemContentInputImage", - "com.azure.ai.agents.models.ItemContentInputImageDetail": "OpenAI.ItemContentInputImage.detail.anonymous", - "com.azure.ai.agents.models.ItemContentInputText": "OpenAI.ItemContentInputText", - "com.azure.ai.agents.models.ItemContentOutputAudio": "OpenAI.ItemContentOutputAudio", - "com.azure.ai.agents.models.ItemContentOutputText": "OpenAI.ItemContentOutputText", - "com.azure.ai.agents.models.ItemContentRefusal": "OpenAI.ItemContentRefusal", - "com.azure.ai.agents.models.ItemContentType": "OpenAI.ItemContentType", - "com.azure.ai.agents.models.ItemParam": "OpenAI.ItemParam", - "com.azure.ai.agents.models.ItemReferenceItemParam": "OpenAI.ItemReferenceItemParam", - "com.azure.ai.agents.models.ItemType": "OpenAI.ItemType", - "com.azure.ai.agents.models.ListAgentsRequestOrder": "Azure.AI.Projects.listAgents.RequestOrder.anonymous", + "com.azure.ai.agents.models.IncludeEnum": "OpenAI.IncludeEnum", + "com.azure.ai.agents.models.InputContent": "OpenAI.InputContent", + "com.azure.ai.agents.models.InputContentInputFileContent": "OpenAI.InputContentInputFileContent", + "com.azure.ai.agents.models.InputContentInputImageContent": "OpenAI.InputContentInputImageContent", + "com.azure.ai.agents.models.InputContentInputTextContent": "OpenAI.InputContentInputTextContent", + "com.azure.ai.agents.models.InputContentType": "OpenAI.InputContentType", + "com.azure.ai.agents.models.InputFidelity": "OpenAI.InputFidelity", + "com.azure.ai.agents.models.InputFileContentParam": "OpenAI.InputFileContentParam", + "com.azure.ai.agents.models.InputImageContentParamAutoParam": "OpenAI.InputImageContentParamAutoParam", + "com.azure.ai.agents.models.InputItem": "OpenAI.InputItem", + "com.azure.ai.agents.models.InputItemApplyPatchToolCallItemParam": "OpenAI.InputItemApplyPatchToolCallItemParam", + "com.azure.ai.agents.models.InputItemApplyPatchToolCallOutputItemParam": "OpenAI.InputItemApplyPatchToolCallOutputItemParam", + "com.azure.ai.agents.models.InputItemCodeInterpreterToolCall": "OpenAI.InputItemCodeInterpreterToolCall", + "com.azure.ai.agents.models.InputItemCompactionSummaryItemParam": "OpenAI.InputItemCompactionSummaryItemParam", + "com.azure.ai.agents.models.InputItemComputerCallOutputItemParam": "OpenAI.InputItemComputerCallOutputItemParam", + "com.azure.ai.agents.models.InputItemComputerToolCall": "OpenAI.InputItemComputerToolCall", + "com.azure.ai.agents.models.InputItemCustomToolCall": "OpenAI.InputItemCustomToolCall", + "com.azure.ai.agents.models.InputItemCustomToolCallOutput": "OpenAI.InputItemCustomToolCallOutput", + "com.azure.ai.agents.models.InputItemFileSearchToolCall": "OpenAI.InputItemFileSearchToolCall", + "com.azure.ai.agents.models.InputItemFunctionCallOutputItemParam": "OpenAI.InputItemFunctionCallOutputItemParam", + "com.azure.ai.agents.models.InputItemFunctionShellCallItemParam": "OpenAI.InputItemFunctionShellCallItemParam", + "com.azure.ai.agents.models.InputItemFunctionShellCallOutputItemParam": "OpenAI.InputItemFunctionShellCallOutputItemParam", + "com.azure.ai.agents.models.InputItemFunctionToolCall": "OpenAI.InputItemFunctionToolCall", + "com.azure.ai.agents.models.InputItemImageGenToolCall": "OpenAI.InputItemImageGenToolCall", + "com.azure.ai.agents.models.InputItemLocalShellToolCall": "OpenAI.InputItemLocalShellToolCall", + "com.azure.ai.agents.models.InputItemLocalShellToolCallOutput": "OpenAI.InputItemLocalShellToolCallOutput", + "com.azure.ai.agents.models.InputItemLocalShellToolCallOutputStatus": "OpenAI.InputItemLocalShellToolCallOutput.status.anonymous", + "com.azure.ai.agents.models.InputItemMcpApprovalRequest": "OpenAI.InputItemMcpApprovalRequest", + "com.azure.ai.agents.models.InputItemMcpApprovalResponse": "OpenAI.InputItemMcpApprovalResponse", + "com.azure.ai.agents.models.InputItemMcpListTools": "OpenAI.InputItemMcpListTools", + "com.azure.ai.agents.models.InputItemMcpToolCall": "OpenAI.InputItemMcpToolCall", + "com.azure.ai.agents.models.InputItemOutputMessage": "OpenAI.InputItemOutputMessage", + "com.azure.ai.agents.models.InputItemReasoningItem": "OpenAI.InputItemReasoningItem", + "com.azure.ai.agents.models.InputItemType": "OpenAI.InputItemType", + "com.azure.ai.agents.models.InputItemWebSearchToolCall": "OpenAI.InputItemWebSearchToolCall", + "com.azure.ai.agents.models.InputTextContentParam": "OpenAI.InputTextContentParam", + "com.azure.ai.agents.models.KeyPressAction": "OpenAI.KeyPressAction", "com.azure.ai.agents.models.LocalShellExecAction": "OpenAI.LocalShellExecAction", - "com.azure.ai.agents.models.LocalShellTool": "OpenAI.LocalShellTool", - "com.azure.ai.agents.models.LocalShellToolCallItemParam": "OpenAI.LocalShellToolCallItemParam", - "com.azure.ai.agents.models.LocalShellToolCallOutputItemParam": "OpenAI.LocalShellToolCallOutputItemParam", - "com.azure.ai.agents.models.Location": "OpenAI.Location", - "com.azure.ai.agents.models.LocationType": "OpenAI.LocationType", + "com.azure.ai.agents.models.LocalShellToolParam": "OpenAI.LocalShellToolParam", "com.azure.ai.agents.models.LogProb": "OpenAI.LogProb", - "com.azure.ai.agents.models.MCPApprovalRequestItemParam": "OpenAI.MCPApprovalRequestItemParam", - "com.azure.ai.agents.models.MCPApprovalResponseItemParam": "OpenAI.MCPApprovalResponseItemParam", - "com.azure.ai.agents.models.MCPCallItemParam": "OpenAI.MCPCallItemParam", - "com.azure.ai.agents.models.MCPListToolsItemParam": "OpenAI.MCPListToolsItemParam", "com.azure.ai.agents.models.MCPListToolsTool": "OpenAI.MCPListToolsTool", + "com.azure.ai.agents.models.MCPListToolsToolAnnotations": "OpenAI.MCPListToolsToolAnnotations", + "com.azure.ai.agents.models.MCPListToolsToolInputSchema": "OpenAI.MCPListToolsToolInputSchema", "com.azure.ai.agents.models.MCPTool": "OpenAI.MCPTool", - "com.azure.ai.agents.models.MCPToolAllowedTools": "OpenAI.MCPTool.allowed_tools.anonymous", - "com.azure.ai.agents.models.MCPToolRequireApproval": "OpenAI.MCPTool.require_approval.anonymous", - "com.azure.ai.agents.models.MCPToolRequireApprovalAlways": "OpenAI.MCPTool.require_approval.always.anonymous", - "com.azure.ai.agents.models.MCPToolRequireApprovalNever": "OpenAI.MCPTool.require_approval.never.anonymous", + "com.azure.ai.agents.models.MCPToolCallStatus": "OpenAI.MCPToolCallStatus", + "com.azure.ai.agents.models.MCPToolConnectorId": "OpenAI.MCPTool.connector_id.anonymous", + "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.MemorySearchTool": "Azure.AI.Projects.MemorySearchTool", - "com.azure.ai.agents.models.MemorySearchToolCallItemParam": "Azure.AI.Projects.MemorySearchToolCallItemParam", + "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", @@ -232,14 +271,12 @@ "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.MemoryStoreOperationUsage": "Azure.AI.Projects.MemoryStoreOperationUsage", - "com.azure.ai.agents.models.MemoryStoreOperationUsageInputTokensDetails": "Azure.AI.Projects.MemoryStoreOperationUsage.input_tokens_details.anonymous", - "com.azure.ai.agents.models.MemoryStoreOperationUsageOutputTokensDetails": "Azure.AI.Projects.MemoryStoreOperationUsage.output_tokens_details.anonymous", "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.MicrosoftFabricAgentTool": "Azure.AI.Projects.MicrosoftFabricAgentTool", - "com.azure.ai.agents.models.OpenApiAgentTool": "Azure.AI.Projects.OpenApiAgentTool", + "com.azure.ai.agents.models.MicrosoftFabricPreviewTool": "Azure.AI.Projects.MicrosoftFabricPreviewTool", + "com.azure.ai.agents.models.Move": "OpenAI.Move", "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", @@ -249,50 +286,72 @@ "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.OutputContent": "OpenAI.OutputContent", + "com.azure.ai.agents.models.OutputContentOutputTextContent": "OpenAI.OutputContentOutputTextContent", + "com.azure.ai.agents.models.OutputContentRefusalContent": "OpenAI.OutputContentRefusalContent", + "com.azure.ai.agents.models.OutputContentType": "OpenAI.OutputContentType", + "com.azure.ai.agents.models.OutputItemCodeInterpreterToolCallStatus": "OpenAI.OutputItemCodeInterpreterToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputItemComputerToolCallStatus": "OpenAI.OutputItemComputerToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputItemFileSearchToolCallStatus": "OpenAI.OutputItemFileSearchToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputItemFunctionToolCallStatus": "OpenAI.OutputItemFunctionToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputItemImageGenToolCallStatus": "OpenAI.OutputItemImageGenToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputItemLocalShellToolCallStatus": "OpenAI.OutputItemLocalShellToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputItemOutputMessageStatus": "OpenAI.OutputItemOutputMessage.status.anonymous", + "com.azure.ai.agents.models.OutputItemReasoningItemStatus": "OpenAI.OutputItemReasoningItem.status.anonymous", + "com.azure.ai.agents.models.OutputItemWebSearchToolCallStatus": "OpenAI.OutputItemWebSearchToolCall.status.anonymous", + "com.azure.ai.agents.models.OutputMessageContent": "OpenAI.OutputMessageContent", + "com.azure.ai.agents.models.OutputMessageContentOutputTextContent": "OpenAI.OutputMessageContentOutputTextContent", + "com.azure.ai.agents.models.OutputMessageContentRefusalContent": "OpenAI.OutputMessageContentRefusalContent", + "com.azure.ai.agents.models.OutputMessageContentType": "OpenAI.OutputMessageContentType", + "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.PromptAgentDefinitionText": "Azure.AI.Projects.PromptAgentDefinition.text.anonymous", "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": "OpenAI.RankerVersionType", "com.azure.ai.agents.models.RankingOptions": "OpenAI.RankingOptions", - "com.azure.ai.agents.models.RankingOptionsRanker": "OpenAI.RankingOptions.ranker.anonymous", "com.azure.ai.agents.models.Reasoning": "OpenAI.Reasoning", - "com.azure.ai.agents.models.ReasoningEffort": "OpenAI.ReasoningEffort", + "com.azure.ai.agents.models.ReasoningEffort": "OpenAI.Reasoning.effort.anonymous", "com.azure.ai.agents.models.ReasoningGenerateSummary": "OpenAI.Reasoning.generate_summary.anonymous", - "com.azure.ai.agents.models.ReasoningItemParam": "OpenAI.ReasoningItemParam", - "com.azure.ai.agents.models.ReasoningItemSummaryPart": "OpenAI.ReasoningItemSummaryPart", - "com.azure.ai.agents.models.ReasoningItemSummaryPartType": "OpenAI.ReasoningItemSummaryPartType", - "com.azure.ai.agents.models.ReasoningItemSummaryTextPart": "OpenAI.ReasoningItemSummaryTextPart", "com.azure.ai.agents.models.ReasoningSummary": "OpenAI.Reasoning.summary.anonymous", - "com.azure.ai.agents.models.ResponseTextFormatConfiguration": "OpenAI.ResponseTextFormatConfiguration", - "com.azure.ai.agents.models.ResponseTextFormatConfigurationJsonObject": "OpenAI.ResponseTextFormatConfigurationJsonObject", - "com.azure.ai.agents.models.ResponseTextFormatConfigurationJsonSchema": "OpenAI.ResponseTextFormatConfigurationJsonSchema", - "com.azure.ai.agents.models.ResponseTextFormatConfigurationText": "OpenAI.ResponseTextFormatConfigurationText", - "com.azure.ai.agents.models.ResponseTextFormatConfigurationType": "OpenAI.ResponseTextFormatConfigurationType", - "com.azure.ai.agents.models.ResponsesAssistantMessageItemParam": "OpenAI.ResponsesAssistantMessageItemParam", - "com.azure.ai.agents.models.ResponsesDeveloperMessageItemParam": "OpenAI.ResponsesDeveloperMessageItemParam", - "com.azure.ai.agents.models.ResponsesMessageItemParam": "OpenAI.ResponsesMessageItemParam", - "com.azure.ai.agents.models.ResponsesMessageRole": "OpenAI.ResponsesMessageRole", - "com.azure.ai.agents.models.ResponsesSystemMessageItemParam": "OpenAI.ResponsesSystemMessageItemParam", - "com.azure.ai.agents.models.ResponsesUserMessageItemParam": "OpenAI.ResponsesUserMessageItemParam", - "com.azure.ai.agents.models.SharepointAgentTool": "Azure.AI.Projects.SharepointAgentTool", + "com.azure.ai.agents.models.ReasoningTextContent": "OpenAI.ReasoningTextContent", + "com.azure.ai.agents.models.ResponseFormatJsonSchemaSchema": "OpenAI.ResponseFormatJsonSchemaSchema", + "com.azure.ai.agents.models.ResponseUsageInputTokensDetails": "OpenAI.ResponseUsageInputTokensDetails", + "com.azure.ai.agents.models.ResponseUsageOutputTokensDetails": "OpenAI.ResponseUsageOutputTokensDetails", + "com.azure.ai.agents.models.Screenshot": "OpenAI.Screenshot", + "com.azure.ai.agents.models.Scroll": "OpenAI.Scroll", + "com.azure.ai.agents.models.SearchContextSize": "OpenAI.SearchContextSize", "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.StructuredInputDefinition": "Azure.AI.Projects.StructuredInputDefinition", "com.azure.ai.agents.models.StructuredOutputDefinition": "Azure.AI.Projects.StructuredOutputDefinition", + "com.azure.ai.agents.models.Summary": "OpenAI.Summary", + "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.TopLogProb": "OpenAI.TopLogProb", + "com.azure.ai.agents.models.Type": "OpenAI.Type", + "com.azure.ai.agents.models.UrlCitationBody": "OpenAI.UrlCitationBody", "com.azure.ai.agents.models.UserProfileMemoryItem": "Azure.AI.Projects.UserProfileMemoryItem", "com.azure.ai.agents.models.VectorStoreFileAttributes": "OpenAI.VectorStoreFileAttributes", - "com.azure.ai.agents.models.WebSearchAction": "OpenAI.WebSearchAction", + "com.azure.ai.agents.models.Wait": "OpenAI.Wait", "com.azure.ai.agents.models.WebSearchActionFind": "OpenAI.WebSearchActionFind", "com.azure.ai.agents.models.WebSearchActionOpenPage": "OpenAI.WebSearchActionOpenPage", "com.azure.ai.agents.models.WebSearchActionSearch": "OpenAI.WebSearchActionSearch", "com.azure.ai.agents.models.WebSearchActionSearchSources": "OpenAI.WebSearchActionSearchSources", - "com.azure.ai.agents.models.WebSearchActionType": "OpenAI.WebSearchActionType", + "com.azure.ai.agents.models.WebSearchApproximateLocation": "OpenAI.WebSearchApproximateLocation", + "com.azure.ai.agents.models.WebSearchApproximateLocationType": null, + "com.azure.ai.agents.models.WebSearchConfiguration": "Azure.AI.Projects.WebSearchConfiguration", "com.azure.ai.agents.models.WebSearchPreviewTool": "OpenAI.WebSearchPreviewTool", - "com.azure.ai.agents.models.WebSearchPreviewToolSearchContextSize": "OpenAI.WebSearchPreviewTool.search_context_size.anonymous", - "com.azure.ai.agents.models.WebSearchToolCallItemParam": "OpenAI.WebSearchToolCallItemParam", + "com.azure.ai.agents.models.WebSearchTool": "OpenAI.WebSearchTool", + "com.azure.ai.agents.models.WebSearchToolFilters": "OpenAI.WebSearchToolFilters", + "com.azure.ai.agents.models.WebSearchToolSearchContextSize": "OpenAI.WebSearchTool.search_context_size.anonymous", "com.azure.ai.agents.models.WorkflowAgentDefinition": "Azure.AI.Projects.WorkflowAgentDefinition" } } 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 84cc4f733278..525bf89b1562 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","apiVersion":"2025-11-15-preview","crossLanguageDefinitions":{"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.deleteAgent":"Azure.AI.Projects.Agents.deleteAgent","com.azure.ai.agents.AgentsAsyncClient.deleteAgentVersion":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsAsyncClient.deleteAgentVersionWithResponse":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsAsyncClient.deleteAgentWithResponse":"Azure.AI.Projects.Agents.deleteAgent","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.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsAsyncClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsAsyncClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","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.deleteAgent":"Azure.AI.Projects.Agents.deleteAgent","com.azure.ai.agents.AgentsClient.deleteAgentVersion":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsClient.deleteAgentVersionWithResponse":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsClient.deleteAgentWithResponse":"Azure.AI.Projects.Agents.deleteAgent","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.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","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.beginUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresAsyncClient.beginUpdateMemoriesWithModel":"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.deleteMemoryStore":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.deleteMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.deleteScope":"Azure.AI.Projects.MemoryStores.deleteScope","com.azure.ai.agents.MemoryStoresAsyncClient.deleteScopeWithResponse":"Azure.AI.Projects.MemoryStores.deleteScope","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.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresAsyncClient.searchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresAsyncClient.searchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","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.beginUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresClient.beginUpdateMemoriesWithModel":"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.deleteMemoryStore":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresClient.deleteMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresClient.deleteScope":"Azure.AI.Projects.MemoryStores.deleteScope","com.azure.ai.agents.MemoryStoresClient.deleteScopeWithResponse":"Azure.AI.Projects.MemoryStores.deleteScope","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.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresClient.searchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresClient.searchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","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.implementation.models.CreateAgentFromManifestRequest1":"Azure.AI.Projects.createAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentRequest1":"Azure.AI.Projects.createAgent.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionFromManifestRequest1":"Azure.AI.Projects.createAgentVersionFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionRequest1":"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.DeleteScopeRequest":"Azure.AI.Projects.deleteScope.Request.anonymous","com.azure.ai.agents.implementation.models.SearchMemoriesRequest":"Azure.AI.Projects.searchMemories.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest1":"Azure.AI.Projects.updateAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentRequest1":"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.models.A2ATool":"Azure.AI.Projects.A2ATool","com.azure.ai.agents.models.AISearchIndexResource":"Azure.AI.Projects.AISearchIndexResource","com.azure.ai.agents.models.AgentDefinition":"Azure.AI.Projects.AgentDefinition","com.azure.ai.agents.models.AgentDetails":"Azure.AI.Projects.AgentObject","com.azure.ai.agents.models.AgentId":"Azure.AI.Projects.AgentId","com.azure.ai.agents.models.AgentKind":"Azure.AI.Projects.AgentKind","com.azure.ai.agents.models.AgentObjectVersions":"Azure.AI.Projects.AgentObject.versions.anonymous","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.AgentVersionDetails":"Azure.AI.Projects.AgentVersionObject","com.azure.ai.agents.models.Annotation":"OpenAI.Annotation","com.azure.ai.agents.models.AnnotationFileCitation":"OpenAI.AnnotationFileCitation","com.azure.ai.agents.models.AnnotationFilePath":"OpenAI.AnnotationFilePath","com.azure.ai.agents.models.AnnotationType":"OpenAI.AnnotationType","com.azure.ai.agents.models.AnnotationUrlCitation":"OpenAI.AnnotationUrlCitation","com.azure.ai.agents.models.ApproximateLocation":"OpenAI.ApproximateLocation","com.azure.ai.agents.models.AzureAISearchAgentTool":"Azure.AI.Projects.AzureAISearchAgentTool","com.azure.ai.agents.models.AzureAISearchQueryType":"Azure.AI.Projects.AzureAISearchQueryType","com.azure.ai.agents.models.AzureAISearchToolResource":"Azure.AI.Projects.AzureAISearchToolResource","com.azure.ai.agents.models.AzureFunctionAgentTool":"Azure.AI.Projects.AzureFunctionAgentTool","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.AzureFunctionDefinitionFunction":"Azure.AI.Projects.AzureFunctionDefinition.function.anonymous","com.azure.ai.agents.models.AzureFunctionStorageQueue":"Azure.AI.Projects.AzureFunctionStorageQueue","com.azure.ai.agents.models.BingCustomSearchAgentTool":"Azure.AI.Projects.BingCustomSearchAgentTool","com.azure.ai.agents.models.BingCustomSearchConfiguration":"Azure.AI.Projects.BingCustomSearchConfiguration","com.azure.ai.agents.models.BingCustomSearchToolParameters":"Azure.AI.Projects.BingCustomSearchToolParameters","com.azure.ai.agents.models.BingGroundingAgentTool":"Azure.AI.Projects.BingGroundingAgentTool","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.BrowserAutomationAgentTool":"Azure.AI.Projects.BrowserAutomationAgentTool","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.CodeInterpreterOutput":"OpenAI.CodeInterpreterOutput","com.azure.ai.agents.models.CodeInterpreterOutputImage":"OpenAI.CodeInterpreterOutputImage","com.azure.ai.agents.models.CodeInterpreterOutputLogs":"OpenAI.CodeInterpreterOutputLogs","com.azure.ai.agents.models.CodeInterpreterOutputType":"OpenAI.CodeInterpreterOutputType","com.azure.ai.agents.models.CodeInterpreterTool":"OpenAI.CodeInterpreterTool","com.azure.ai.agents.models.CodeInterpreterToolAuto":"OpenAI.CodeInterpreterToolAuto","com.azure.ai.agents.models.CodeInterpreterToolCallItemParam":"OpenAI.CodeInterpreterToolCallItemParam","com.azure.ai.agents.models.ComparisonFilter":"OpenAI.ComparisonFilter","com.azure.ai.agents.models.ComparisonFilterType":"OpenAI.ComparisonFilter.type.anonymous","com.azure.ai.agents.models.CompoundFilter":"OpenAI.CompoundFilter","com.azure.ai.agents.models.CompoundFilterType":"OpenAI.CompoundFilter.type.anonymous","com.azure.ai.agents.models.ComputerAction":"OpenAI.ComputerAction","com.azure.ai.agents.models.ComputerActionClick":"OpenAI.ComputerActionClick","com.azure.ai.agents.models.ComputerActionClickButton":"OpenAI.ComputerActionClick.button.anonymous","com.azure.ai.agents.models.ComputerActionDoubleClick":"OpenAI.ComputerActionDoubleClick","com.azure.ai.agents.models.ComputerActionDrag":"OpenAI.ComputerActionDrag","com.azure.ai.agents.models.ComputerActionKeyPress":"OpenAI.ComputerActionKeyPress","com.azure.ai.agents.models.ComputerActionMove":"OpenAI.ComputerActionMove","com.azure.ai.agents.models.ComputerActionScreenshot":"OpenAI.ComputerActionScreenshot","com.azure.ai.agents.models.ComputerActionScroll":"OpenAI.ComputerActionScroll","com.azure.ai.agents.models.ComputerActionType":"OpenAI.ComputerActionType","com.azure.ai.agents.models.ComputerActionTypeKeys":"OpenAI.ComputerActionTypeKeys","com.azure.ai.agents.models.ComputerActionWait":"OpenAI.ComputerActionWait","com.azure.ai.agents.models.ComputerToolCallItemParam":"OpenAI.ComputerToolCallItemParam","com.azure.ai.agents.models.ComputerToolCallOutputItemOutput":"OpenAI.ComputerToolCallOutputItemOutput","com.azure.ai.agents.models.ComputerToolCallOutputItemOutputComputerScreenshot":"OpenAI.ComputerToolCallOutputItemOutputComputerScreenshot","com.azure.ai.agents.models.ComputerToolCallOutputItemOutputType":"OpenAI.ComputerToolCallOutputItemOutputType","com.azure.ai.agents.models.ComputerToolCallOutputItemParam":"OpenAI.ComputerToolCallOutputItemParam","com.azure.ai.agents.models.ComputerToolCallSafetyCheck":"OpenAI.ComputerToolCallSafetyCheck","com.azure.ai.agents.models.ComputerUsePreviewTool":"OpenAI.ComputerUsePreviewTool","com.azure.ai.agents.models.ComputerUsePreviewToolEnvironment":"OpenAI.ComputerUsePreviewTool.environment.anonymous","com.azure.ai.agents.models.ContainerAppAgentDefinition":"Azure.AI.Projects.ContainerAppAgentDefinition","com.azure.ai.agents.models.Coordinate":"OpenAI.Coordinate","com.azure.ai.agents.models.DeleteAgentResponse":"Azure.AI.Projects.DeleteAgentResponse","com.azure.ai.agents.models.DeleteAgentVersionResponse":"Azure.AI.Projects.DeleteAgentVersionResponse","com.azure.ai.agents.models.DeleteMemoryStoreResponse":"Azure.AI.Projects.DeleteMemoryStoreResponse","com.azure.ai.agents.models.Error":"OpenAI.Error","com.azure.ai.agents.models.FabricDataAgentToolParameters":"Azure.AI.Projects.FabricDataAgentToolParameters","com.azure.ai.agents.models.FileSearchTool":"OpenAI.FileSearchTool","com.azure.ai.agents.models.FileSearchToolCallItemParam":"OpenAI.FileSearchToolCallItemParam","com.azure.ai.agents.models.FileSearchToolCallItemParamResult":"OpenAI.FileSearchToolCallItemParam.result.anonymous","com.azure.ai.agents.models.FunctionTool":"OpenAI.FunctionTool","com.azure.ai.agents.models.FunctionToolCallItemParam":"OpenAI.FunctionToolCallItemParam","com.azure.ai.agents.models.FunctionToolCallOutputItemParam":"OpenAI.FunctionToolCallOutputItemParam","com.azure.ai.agents.models.HostedAgentDefinition":"Azure.AI.Projects.HostedAgentDefinition","com.azure.ai.agents.models.ImageBasedHostedAgentDefinition":"Azure.AI.Projects.ImageBasedHostedAgentDefinition","com.azure.ai.agents.models.ImageGenTool":"OpenAI.ImageGenTool","com.azure.ai.agents.models.ImageGenToolBackground":"OpenAI.ImageGenTool.background.anonymous","com.azure.ai.agents.models.ImageGenToolCallItemParam":"OpenAI.ImageGenToolCallItemParam","com.azure.ai.agents.models.ImageGenToolInputImageMask":"OpenAI.ImageGenTool.input_image_mask.anonymous","com.azure.ai.agents.models.ImageGenToolModel":null,"com.azure.ai.agents.models.ImageGenToolModeration":"OpenAI.ImageGenTool.moderation.anonymous","com.azure.ai.agents.models.ImageGenToolOutputFormat":"OpenAI.ImageGenTool.output_format.anonymous","com.azure.ai.agents.models.ImageGenToolQuality":"OpenAI.ImageGenTool.quality.anonymous","com.azure.ai.agents.models.ImageGenToolSize":"OpenAI.ImageGenTool.size.anonymous","com.azure.ai.agents.models.ItemContent":"OpenAI.ItemContent","com.azure.ai.agents.models.ItemContentInputAudio":"OpenAI.ItemContentInputAudio","com.azure.ai.agents.models.ItemContentInputAudioFormat":"OpenAI.ItemContentInputAudio.format.anonymous","com.azure.ai.agents.models.ItemContentInputFile":"OpenAI.ItemContentInputFile","com.azure.ai.agents.models.ItemContentInputImage":"OpenAI.ItemContentInputImage","com.azure.ai.agents.models.ItemContentInputImageDetail":"OpenAI.ItemContentInputImage.detail.anonymous","com.azure.ai.agents.models.ItemContentInputText":"OpenAI.ItemContentInputText","com.azure.ai.agents.models.ItemContentOutputAudio":"OpenAI.ItemContentOutputAudio","com.azure.ai.agents.models.ItemContentOutputText":"OpenAI.ItemContentOutputText","com.azure.ai.agents.models.ItemContentRefusal":"OpenAI.ItemContentRefusal","com.azure.ai.agents.models.ItemContentType":"OpenAI.ItemContentType","com.azure.ai.agents.models.ItemParam":"OpenAI.ItemParam","com.azure.ai.agents.models.ItemReferenceItemParam":"OpenAI.ItemReferenceItemParam","com.azure.ai.agents.models.ItemType":"OpenAI.ItemType","com.azure.ai.agents.models.ListAgentsRequestOrder":"Azure.AI.Projects.listAgents.RequestOrder.anonymous","com.azure.ai.agents.models.LocalShellExecAction":"OpenAI.LocalShellExecAction","com.azure.ai.agents.models.LocalShellTool":"OpenAI.LocalShellTool","com.azure.ai.agents.models.LocalShellToolCallItemParam":"OpenAI.LocalShellToolCallItemParam","com.azure.ai.agents.models.LocalShellToolCallOutputItemParam":"OpenAI.LocalShellToolCallOutputItemParam","com.azure.ai.agents.models.Location":"OpenAI.Location","com.azure.ai.agents.models.LocationType":"OpenAI.LocationType","com.azure.ai.agents.models.LogProb":"OpenAI.LogProb","com.azure.ai.agents.models.MCPApprovalRequestItemParam":"OpenAI.MCPApprovalRequestItemParam","com.azure.ai.agents.models.MCPApprovalResponseItemParam":"OpenAI.MCPApprovalResponseItemParam","com.azure.ai.agents.models.MCPCallItemParam":"OpenAI.MCPCallItemParam","com.azure.ai.agents.models.MCPListToolsItemParam":"OpenAI.MCPListToolsItemParam","com.azure.ai.agents.models.MCPListToolsTool":"OpenAI.MCPListToolsTool","com.azure.ai.agents.models.MCPTool":"OpenAI.MCPTool","com.azure.ai.agents.models.MCPToolAllowedTools":"OpenAI.MCPTool.allowed_tools.anonymous","com.azure.ai.agents.models.MCPToolRequireApproval":"OpenAI.MCPTool.require_approval.anonymous","com.azure.ai.agents.models.MCPToolRequireApprovalAlways":"OpenAI.MCPTool.require_approval.always.anonymous","com.azure.ai.agents.models.MCPToolRequireApprovalNever":"OpenAI.MCPTool.require_approval.never.anonymous","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.MemorySearchTool":"Azure.AI.Projects.MemorySearchTool","com.azure.ai.agents.models.MemorySearchToolCallItemParam":"Azure.AI.Projects.MemorySearchToolCallItemParam","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.MemoryStoreDeleteScopeResponse":"Azure.AI.Projects.MemoryStoreDeleteScopeResponse","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.MemoryStoreOperationUsage":"Azure.AI.Projects.MemoryStoreOperationUsage","com.azure.ai.agents.models.MemoryStoreOperationUsageInputTokensDetails":"Azure.AI.Projects.MemoryStoreOperationUsage.input_tokens_details.anonymous","com.azure.ai.agents.models.MemoryStoreOperationUsageOutputTokensDetails":"Azure.AI.Projects.MemoryStoreOperationUsage.output_tokens_details.anonymous","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.MicrosoftFabricAgentTool":"Azure.AI.Projects.MicrosoftFabricAgentTool","com.azure.ai.agents.models.OpenApiAgentTool":"Azure.AI.Projects.OpenApiAgentTool","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.PromptAgentDefinition":"Azure.AI.Projects.PromptAgentDefinition","com.azure.ai.agents.models.PromptAgentDefinitionText":"Azure.AI.Projects.PromptAgentDefinition.text.anonymous","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.RankingOptions":"OpenAI.RankingOptions","com.azure.ai.agents.models.RankingOptionsRanker":"OpenAI.RankingOptions.ranker.anonymous","com.azure.ai.agents.models.Reasoning":"OpenAI.Reasoning","com.azure.ai.agents.models.ReasoningEffort":"OpenAI.ReasoningEffort","com.azure.ai.agents.models.ReasoningGenerateSummary":"OpenAI.Reasoning.generate_summary.anonymous","com.azure.ai.agents.models.ReasoningItemParam":"OpenAI.ReasoningItemParam","com.azure.ai.agents.models.ReasoningItemSummaryPart":"OpenAI.ReasoningItemSummaryPart","com.azure.ai.agents.models.ReasoningItemSummaryPartType":"OpenAI.ReasoningItemSummaryPartType","com.azure.ai.agents.models.ReasoningItemSummaryTextPart":"OpenAI.ReasoningItemSummaryTextPart","com.azure.ai.agents.models.ReasoningSummary":"OpenAI.Reasoning.summary.anonymous","com.azure.ai.agents.models.ResponseTextFormatConfiguration":"OpenAI.ResponseTextFormatConfiguration","com.azure.ai.agents.models.ResponseTextFormatConfigurationJsonObject":"OpenAI.ResponseTextFormatConfigurationJsonObject","com.azure.ai.agents.models.ResponseTextFormatConfigurationJsonSchema":"OpenAI.ResponseTextFormatConfigurationJsonSchema","com.azure.ai.agents.models.ResponseTextFormatConfigurationText":"OpenAI.ResponseTextFormatConfigurationText","com.azure.ai.agents.models.ResponseTextFormatConfigurationType":"OpenAI.ResponseTextFormatConfigurationType","com.azure.ai.agents.models.ResponsesAssistantMessageItemParam":"OpenAI.ResponsesAssistantMessageItemParam","com.azure.ai.agents.models.ResponsesDeveloperMessageItemParam":"OpenAI.ResponsesDeveloperMessageItemParam","com.azure.ai.agents.models.ResponsesMessageItemParam":"OpenAI.ResponsesMessageItemParam","com.azure.ai.agents.models.ResponsesMessageRole":"OpenAI.ResponsesMessageRole","com.azure.ai.agents.models.ResponsesSystemMessageItemParam":"OpenAI.ResponsesSystemMessageItemParam","com.azure.ai.agents.models.ResponsesUserMessageItemParam":"OpenAI.ResponsesUserMessageItemParam","com.azure.ai.agents.models.SharepointAgentTool":"Azure.AI.Projects.SharepointAgentTool","com.azure.ai.agents.models.SharepointGroundingToolParameters":"Azure.AI.Projects.SharepointGroundingToolParameters","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.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.TopLogProb":"OpenAI.TopLogProb","com.azure.ai.agents.models.UserProfileMemoryItem":"Azure.AI.Projects.UserProfileMemoryItem","com.azure.ai.agents.models.VectorStoreFileAttributes":"OpenAI.VectorStoreFileAttributes","com.azure.ai.agents.models.WebSearchAction":"OpenAI.WebSearchAction","com.azure.ai.agents.models.WebSearchActionFind":"OpenAI.WebSearchActionFind","com.azure.ai.agents.models.WebSearchActionOpenPage":"OpenAI.WebSearchActionOpenPage","com.azure.ai.agents.models.WebSearchActionSearch":"OpenAI.WebSearchActionSearch","com.azure.ai.agents.models.WebSearchActionSearchSources":"OpenAI.WebSearchActionSearchSources","com.azure.ai.agents.models.WebSearchActionType":"OpenAI.WebSearchActionType","com.azure.ai.agents.models.WebSearchPreviewTool":"OpenAI.WebSearchPreviewTool","com.azure.ai.agents.models.WebSearchPreviewToolSearchContextSize":"OpenAI.WebSearchPreviewTool.search_context_size.anonymous","com.azure.ai.agents.models.WebSearchToolCallItemParam":"OpenAI.WebSearchToolCallItemParam","com.azure.ai.agents.models.WorkflowAgentDefinition":"Azure.AI.Projects.WorkflowAgentDefinition"},"generatedFiles":["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/implementation/AgentsClientImpl.java","src/main/java/com/azure/ai/agents/implementation/AgentsImpl.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/models/CreateAgentFromManifestRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionFromManifestRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryStoreRequest.java","src/main/java/com/azure/ai/agents/implementation/models/DeleteScopeRequest.java","src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentFromManifestRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentRequest1.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/package-info.java","src/main/java/com/azure/ai/agents/implementation/package-info.java","src/main/java/com/azure/ai/agents/models/A2ATool.java","src/main/java/com/azure/ai/agents/models/AISearchIndexResource.java","src/main/java/com/azure/ai/agents/models/AgentDefinition.java","src/main/java/com/azure/ai/agents/models/AgentDetails.java","src/main/java/com/azure/ai/agents/models/AgentId.java","src/main/java/com/azure/ai/agents/models/AgentKind.java","src/main/java/com/azure/ai/agents/models/AgentObjectVersions.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/AgentVersionDetails.java","src/main/java/com/azure/ai/agents/models/Annotation.java","src/main/java/com/azure/ai/agents/models/AnnotationFileCitation.java","src/main/java/com/azure/ai/agents/models/AnnotationFilePath.java","src/main/java/com/azure/ai/agents/models/AnnotationType.java","src/main/java/com/azure/ai/agents/models/AnnotationUrlCitation.java","src/main/java/com/azure/ai/agents/models/ApproximateLocation.java","src/main/java/com/azure/ai/agents/models/AzureAISearchAgentTool.java","src/main/java/com/azure/ai/agents/models/AzureAISearchQueryType.java","src/main/java/com/azure/ai/agents/models/AzureAISearchToolResource.java","src/main/java/com/azure/ai/agents/models/AzureFunctionAgentTool.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/AzureFunctionDefinitionFunction.java","src/main/java/com/azure/ai/agents/models/AzureFunctionStorageQueue.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchAgentTool.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchConfiguration.java","src/main/java/com/azure/ai/agents/models/BingCustomSearchToolParameters.java","src/main/java/com/azure/ai/agents/models/BingGroundingAgentTool.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/BrowserAutomationAgentTool.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/CodeInterpreterOutput.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputImage.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputLogs.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputType.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterToolAuto.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterToolCallItemParam.java","src/main/java/com/azure/ai/agents/models/ComparisonFilter.java","src/main/java/com/azure/ai/agents/models/ComparisonFilterType.java","src/main/java/com/azure/ai/agents/models/CompoundFilter.java","src/main/java/com/azure/ai/agents/models/CompoundFilterType.java","src/main/java/com/azure/ai/agents/models/ComputerAction.java","src/main/java/com/azure/ai/agents/models/ComputerActionClick.java","src/main/java/com/azure/ai/agents/models/ComputerActionClickButton.java","src/main/java/com/azure/ai/agents/models/ComputerActionDoubleClick.java","src/main/java/com/azure/ai/agents/models/ComputerActionDrag.java","src/main/java/com/azure/ai/agents/models/ComputerActionKeyPress.java","src/main/java/com/azure/ai/agents/models/ComputerActionMove.java","src/main/java/com/azure/ai/agents/models/ComputerActionScreenshot.java","src/main/java/com/azure/ai/agents/models/ComputerActionScroll.java","src/main/java/com/azure/ai/agents/models/ComputerActionType.java","src/main/java/com/azure/ai/agents/models/ComputerActionTypeKeys.java","src/main/java/com/azure/ai/agents/models/ComputerActionWait.java","src/main/java/com/azure/ai/agents/models/ComputerToolCallItemParam.java","src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutput.java","src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputComputerScreenshot.java","src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemOutputType.java","src/main/java/com/azure/ai/agents/models/ComputerToolCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/ComputerToolCallSafetyCheck.java","src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java","src/main/java/com/azure/ai/agents/models/ComputerUsePreviewToolEnvironment.java","src/main/java/com/azure/ai/agents/models/ContainerAppAgentDefinition.java","src/main/java/com/azure/ai/agents/models/Coordinate.java","src/main/java/com/azure/ai/agents/models/DeleteAgentResponse.java","src/main/java/com/azure/ai/agents/models/DeleteAgentVersionResponse.java","src/main/java/com/azure/ai/agents/models/DeleteMemoryStoreResponse.java","src/main/java/com/azure/ai/agents/models/Error.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/FileSearchToolCallItemParam.java","src/main/java/com/azure/ai/agents/models/FileSearchToolCallItemParamResult.java","src/main/java/com/azure/ai/agents/models/FunctionTool.java","src/main/java/com/azure/ai/agents/models/FunctionToolCallItemParam.java","src/main/java/com/azure/ai/agents/models/FunctionToolCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/HostedAgentDefinition.java","src/main/java/com/azure/ai/agents/models/ImageBasedHostedAgentDefinition.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/ImageGenToolCallItemParam.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/ItemContent.java","src/main/java/com/azure/ai/agents/models/ItemContentInputAudio.java","src/main/java/com/azure/ai/agents/models/ItemContentInputAudioFormat.java","src/main/java/com/azure/ai/agents/models/ItemContentInputFile.java","src/main/java/com/azure/ai/agents/models/ItemContentInputImage.java","src/main/java/com/azure/ai/agents/models/ItemContentInputImageDetail.java","src/main/java/com/azure/ai/agents/models/ItemContentInputText.java","src/main/java/com/azure/ai/agents/models/ItemContentOutputAudio.java","src/main/java/com/azure/ai/agents/models/ItemContentOutputText.java","src/main/java/com/azure/ai/agents/models/ItemContentRefusal.java","src/main/java/com/azure/ai/agents/models/ItemContentType.java","src/main/java/com/azure/ai/agents/models/ItemParam.java","src/main/java/com/azure/ai/agents/models/ItemReferenceItemParam.java","src/main/java/com/azure/ai/agents/models/ItemType.java","src/main/java/com/azure/ai/agents/models/ListAgentsRequestOrder.java","src/main/java/com/azure/ai/agents/models/LocalShellExecAction.java","src/main/java/com/azure/ai/agents/models/LocalShellTool.java","src/main/java/com/azure/ai/agents/models/LocalShellToolCallItemParam.java","src/main/java/com/azure/ai/agents/models/LocalShellToolCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/Location.java","src/main/java/com/azure/ai/agents/models/LocationType.java","src/main/java/com/azure/ai/agents/models/LogProb.java","src/main/java/com/azure/ai/agents/models/MCPApprovalRequestItemParam.java","src/main/java/com/azure/ai/agents/models/MCPApprovalResponseItemParam.java","src/main/java/com/azure/ai/agents/models/MCPCallItemParam.java","src/main/java/com/azure/ai/agents/models/MCPListToolsItemParam.java","src/main/java/com/azure/ai/agents/models/MCPListToolsTool.java","src/main/java/com/azure/ai/agents/models/MCPTool.java","src/main/java/com/azure/ai/agents/models/MCPToolAllowedTools.java","src/main/java/com/azure/ai/agents/models/MCPToolRequireApproval.java","src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalAlways.java","src/main/java/com/azure/ai/agents/models/MCPToolRequireApprovalNever.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/MemorySearchTool.java","src/main/java/com/azure/ai/agents/models/MemorySearchToolCallItemParam.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/MemoryStoreDeleteScopeResponse.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/MemoryStoreOperationUsage.java","src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageInputTokensDetails.java","src/main/java/com/azure/ai/agents/models/MemoryStoreOperationUsageOutputTokensDetails.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/MicrosoftFabricAgentTool.java","src/main/java/com/azure/ai/agents/models/OpenApiAgentTool.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/PromptAgentDefinition.java","src/main/java/com/azure/ai/agents/models/PromptAgentDefinitionText.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/RankingOptions.java","src/main/java/com/azure/ai/agents/models/RankingOptionsRanker.java","src/main/java/com/azure/ai/agents/models/Reasoning.java","src/main/java/com/azure/ai/agents/models/ReasoningEffort.java","src/main/java/com/azure/ai/agents/models/ReasoningGenerateSummary.java","src/main/java/com/azure/ai/agents/models/ReasoningItemParam.java","src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPart.java","src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryPartType.java","src/main/java/com/azure/ai/agents/models/ReasoningItemSummaryTextPart.java","src/main/java/com/azure/ai/agents/models/ReasoningSummary.java","src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfiguration.java","src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonObject.java","src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationJsonSchema.java","src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationText.java","src/main/java/com/azure/ai/agents/models/ResponseTextFormatConfigurationType.java","src/main/java/com/azure/ai/agents/models/ResponsesAssistantMessageItemParam.java","src/main/java/com/azure/ai/agents/models/ResponsesDeveloperMessageItemParam.java","src/main/java/com/azure/ai/agents/models/ResponsesMessageItemParam.java","src/main/java/com/azure/ai/agents/models/ResponsesMessageRole.java","src/main/java/com/azure/ai/agents/models/ResponsesSystemMessageItemParam.java","src/main/java/com/azure/ai/agents/models/ResponsesUserMessageItemParam.java","src/main/java/com/azure/ai/agents/models/SharepointAgentTool.java","src/main/java/com/azure/ai/agents/models/SharepointGroundingToolParameters.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/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/TopLogProb.java","src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java","src/main/java/com/azure/ai/agents/models/VectorStoreFileAttributes.java","src/main/java/com/azure/ai/agents/models/WebSearchAction.java","src/main/java/com/azure/ai/agents/models/WebSearchActionFind.java","src/main/java/com/azure/ai/agents/models/WebSearchActionOpenPage.java","src/main/java/com/azure/ai/agents/models/WebSearchActionSearch.java","src/main/java/com/azure/ai/agents/models/WebSearchActionSearchSources.java","src/main/java/com/azure/ai/agents/models/WebSearchActionType.java","src/main/java/com/azure/ai/agents/models/WebSearchPreviewTool.java","src/main/java/com/azure/ai/agents/models/WebSearchPreviewToolSearchContextSize.java","src/main/java/com/azure/ai/agents/models/WebSearchToolCallItemParam.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","apiVersion":"2025-11-15-preview","crossLanguageDefinitions":{"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.deleteAgent":"Azure.AI.Projects.Agents.deleteAgent","com.azure.ai.agents.AgentsAsyncClient.deleteAgentVersion":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsAsyncClient.deleteAgentVersionWithResponse":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsAsyncClient.deleteAgentWithResponse":"Azure.AI.Projects.Agents.deleteAgent","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.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsAsyncClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsAsyncClient.streamAgentContainerLogs":"Azure.AI.Projects.Agents.streamAgentContainerLogs","com.azure.ai.agents.AgentsAsyncClient.streamAgentContainerLogsWithResponse":"Azure.AI.Projects.Agents.streamAgentContainerLogs","com.azure.ai.agents.AgentsAsyncClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","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.deleteAgent":"Azure.AI.Projects.Agents.deleteAgent","com.azure.ai.agents.AgentsClient.deleteAgentVersion":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsClient.deleteAgentVersionWithResponse":"Azure.AI.Projects.Agents.deleteAgentVersion","com.azure.ai.agents.AgentsClient.deleteAgentWithResponse":"Azure.AI.Projects.Agents.deleteAgent","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.listAgentVersions":"Azure.AI.Projects.Agents.listAgentVersions","com.azure.ai.agents.AgentsClient.listAgents":"Azure.AI.Projects.Agents.listAgents","com.azure.ai.agents.AgentsClient.streamAgentContainerLogs":"Azure.AI.Projects.Agents.streamAgentContainerLogs","com.azure.ai.agents.AgentsClient.streamAgentContainerLogsWithResponse":"Azure.AI.Projects.Agents.streamAgentContainerLogs","com.azure.ai.agents.AgentsClient.updateAgent":"Azure.AI.Projects.Agents.updateAgent","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.beginUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresAsyncClient.beginUpdateMemoriesWithModel":"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.deleteMemoryStore":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.deleteMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresAsyncClient.deleteScope":"Azure.AI.Projects.MemoryStores.deleteScope","com.azure.ai.agents.MemoryStoresAsyncClient.deleteScopeWithResponse":"Azure.AI.Projects.MemoryStores.deleteScope","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.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresAsyncClient.searchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresAsyncClient.searchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","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.beginUpdateMemories":"Azure.AI.Projects.MemoryStores.updateMemories","com.azure.ai.agents.MemoryStoresClient.beginUpdateMemoriesWithModel":"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.deleteMemoryStore":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresClient.deleteMemoryStoreWithResponse":"Azure.AI.Projects.MemoryStores.deleteMemoryStore","com.azure.ai.agents.MemoryStoresClient.deleteScope":"Azure.AI.Projects.MemoryStores.deleteScope","com.azure.ai.agents.MemoryStoresClient.deleteScopeWithResponse":"Azure.AI.Projects.MemoryStores.deleteScope","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.listMemoryStores":"Azure.AI.Projects.MemoryStores.listMemoryStores","com.azure.ai.agents.MemoryStoresClient.searchMemories":"Azure.AI.Projects.MemoryStores.searchMemories","com.azure.ai.agents.MemoryStoresClient.searchMemoriesWithResponse":"Azure.AI.Projects.MemoryStores.searchMemories","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.implementation.models.CreateAgentFromManifestRequest1":"Azure.AI.Projects.createAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentRequest1":"Azure.AI.Projects.createAgent.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionFromManifestRequest1":"Azure.AI.Projects.createAgentVersionFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.CreateAgentVersionRequest1":"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.DeleteScopeRequest":"Azure.AI.Projects.deleteScope.Request.anonymous","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.ItemReferenceParam":"OpenAI.ItemReferenceParam","com.azure.ai.agents.implementation.models.SearchMemoriesRequest":"Azure.AI.Projects.searchMemories.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentFromManifestRequest1":"Azure.AI.Projects.updateAgentFromManifest.Request.anonymous","com.azure.ai.agents.implementation.models.UpdateAgentRequest1":"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.models.A2APreviewTool":"Azure.AI.Projects.A2APreviewTool","com.azure.ai.agents.models.AISearchIndexResource":"Azure.AI.Projects.AISearchIndexResource","com.azure.ai.agents.models.AgentDefinition":"Azure.AI.Projects.AgentDefinition","com.azure.ai.agents.models.AgentDetails":"Azure.AI.Projects.AgentObject","com.azure.ai.agents.models.AgentId":"Azure.AI.Projects.AgentId","com.azure.ai.agents.models.AgentKind":"Azure.AI.Projects.AgentKind","com.azure.ai.agents.models.AgentObjectVersions":"Azure.AI.Projects.AgentObject.versions.anonymous","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.AgentVersionDetails":"Azure.AI.Projects.AgentVersionObject","com.azure.ai.agents.models.Annotation":"OpenAI.Annotation","com.azure.ai.agents.models.AnnotationType":"OpenAI.AnnotationType","com.azure.ai.agents.models.ApplyPatchCallOutputStatusParam":"OpenAI.ApplyPatchCallOutputStatusParam","com.azure.ai.agents.models.ApplyPatchCallStatusParam":"OpenAI.ApplyPatchCallStatusParam","com.azure.ai.agents.models.ApplyPatchCreateFileOperationParam":"OpenAI.ApplyPatchCreateFileOperationParam","com.azure.ai.agents.models.ApplyPatchDeleteFileOperationParam":"OpenAI.ApplyPatchDeleteFileOperationParam","com.azure.ai.agents.models.ApplyPatchOperationParam":"OpenAI.ApplyPatchOperationParam","com.azure.ai.agents.models.ApplyPatchOperationParamType":"OpenAI.ApplyPatchOperationParamType","com.azure.ai.agents.models.ApplyPatchToolParam":"OpenAI.ApplyPatchToolParam","com.azure.ai.agents.models.ApplyPatchUpdateFileOperationParam":"OpenAI.ApplyPatchUpdateFileOperationParam","com.azure.ai.agents.models.ApproximateLocation":"OpenAI.ApproximateLocation","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.AzureFunctionBinding":"Azure.AI.Projects.AzureFunctionBinding","com.azure.ai.agents.models.AzureFunctionDefinition":"Azure.AI.Projects.AzureFunctionDefinition","com.azure.ai.agents.models.AzureFunctionDefinitionFunction":"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.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.ClickButtonType":"OpenAI.ClickButtonType","com.azure.ai.agents.models.ClickParam":"OpenAI.ClickParam","com.azure.ai.agents.models.CodeInterpreterContainerAuto":"OpenAI.CodeInterpreterContainerAuto","com.azure.ai.agents.models.CodeInterpreterOutputImage":"OpenAI.CodeInterpreterOutputImage","com.azure.ai.agents.models.CodeInterpreterOutputLogs":"OpenAI.CodeInterpreterOutputLogs","com.azure.ai.agents.models.CodeInterpreterTool":"OpenAI.CodeInterpreterTool","com.azure.ai.agents.models.ComparisonFilter":"OpenAI.ComparisonFilter","com.azure.ai.agents.models.ComparisonFilterType":"OpenAI.ComparisonFilter.type.anonymous","com.azure.ai.agents.models.CompoundFilter":"OpenAI.CompoundFilter","com.azure.ai.agents.models.CompoundFilterType":"OpenAI.CompoundFilter.type.anonymous","com.azure.ai.agents.models.ComputerAction":"OpenAI.ComputerAction","com.azure.ai.agents.models.ComputerActionType":"OpenAI.ComputerActionType","com.azure.ai.agents.models.ComputerCallSafetyCheckParam":"OpenAI.ComputerCallSafetyCheckParam","com.azure.ai.agents.models.ComputerEnvironment":"OpenAI.ComputerEnvironment","com.azure.ai.agents.models.ComputerScreenshotImage":"OpenAI.ComputerScreenshotImage","com.azure.ai.agents.models.ComputerUsePreviewTool":"OpenAI.ComputerUsePreviewTool","com.azure.ai.agents.models.ContainerAppAgentDefinition":"Azure.AI.Projects.ContainerAppAgentDefinition","com.azure.ai.agents.models.ContainerFileCitationBody":"OpenAI.ContainerFileCitationBody","com.azure.ai.agents.models.ContainerLogKind":"Azure.AI.Projects.ContainerLogKind","com.azure.ai.agents.models.ContainerMemoryLimit":"OpenAI.ContainerMemoryLimit","com.azure.ai.agents.models.CustomGrammarFormatParam":"OpenAI.CustomGrammarFormatParam","com.azure.ai.agents.models.CustomTextFormatParam":"OpenAI.CustomTextFormatParam","com.azure.ai.agents.models.CustomToolParam":"OpenAI.CustomToolParam","com.azure.ai.agents.models.CustomToolParamFormat":"OpenAI.CustomToolParamFormat","com.azure.ai.agents.models.CustomToolParamFormatType":"OpenAI.CustomToolParamFormatType","com.azure.ai.agents.models.DeleteAgentResponse":"Azure.AI.Projects.DeleteAgentResponse","com.azure.ai.agents.models.DeleteAgentVersionResponse":"Azure.AI.Projects.DeleteAgentVersionResponse","com.azure.ai.agents.models.DeleteMemoryStoreResponse":"Azure.AI.Projects.DeleteMemoryStoreResponse","com.azure.ai.agents.models.DetailEnum":"OpenAI.DetailEnum","com.azure.ai.agents.models.DoubleClickAction":"OpenAI.DoubleClickAction","com.azure.ai.agents.models.Drag":"OpenAI.Drag","com.azure.ai.agents.models.DragPoint":"OpenAI.DragPoint","com.azure.ai.agents.models.Error":"OpenAI.Error","com.azure.ai.agents.models.FabricDataAgentToolParameters":"Azure.AI.Projects.FabricDataAgentToolParameters","com.azure.ai.agents.models.FileCitationBody":"OpenAI.FileCitationBody","com.azure.ai.agents.models.FilePath":"OpenAI.FilePath","com.azure.ai.agents.models.FileSearchTool":"OpenAI.FileSearchTool","com.azure.ai.agents.models.FileSearchToolCallResults":"OpenAI.FileSearchToolCallResults","com.azure.ai.agents.models.FunctionAndCustomToolCallOutput":"OpenAI.FunctionAndCustomToolCallOutput","com.azure.ai.agents.models.FunctionAndCustomToolCallOutputInputFileContent":"OpenAI.FunctionAndCustomToolCallOutputInputFileContent","com.azure.ai.agents.models.FunctionAndCustomToolCallOutputInputImageContent":"OpenAI.FunctionAndCustomToolCallOutputInputImageContent","com.azure.ai.agents.models.FunctionAndCustomToolCallOutputInputTextContent":"OpenAI.FunctionAndCustomToolCallOutputInputTextContent","com.azure.ai.agents.models.FunctionAndCustomToolCallOutputType":"OpenAI.FunctionAndCustomToolCallOutputType","com.azure.ai.agents.models.FunctionCallItemStatus":"OpenAI.FunctionCallItemStatus","com.azure.ai.agents.models.FunctionShellActionParam":"OpenAI.FunctionShellActionParam","com.azure.ai.agents.models.FunctionShellCallItemStatus":"OpenAI.FunctionShellCallItemStatus","com.azure.ai.agents.models.FunctionShellCallOutputContentParam":"OpenAI.FunctionShellCallOutputContentParam","com.azure.ai.agents.models.FunctionShellCallOutputExitOutcomeParam":"OpenAI.FunctionShellCallOutputExitOutcomeParam","com.azure.ai.agents.models.FunctionShellCallOutputOutcomeParam":"OpenAI.FunctionShellCallOutputOutcomeParam","com.azure.ai.agents.models.FunctionShellCallOutputOutcomeParamType":"OpenAI.FunctionShellCallOutputOutcomeParamType","com.azure.ai.agents.models.FunctionShellCallOutputTimeoutOutcomeParam":"OpenAI.FunctionShellCallOutputTimeoutOutcomeParam","com.azure.ai.agents.models.FunctionShellToolParam":"OpenAI.FunctionShellToolParam","com.azure.ai.agents.models.FunctionTool":"OpenAI.FunctionTool","com.azure.ai.agents.models.GrammarSyntax":"OpenAI.GrammarSyntax1","com.azure.ai.agents.models.HostedAgentDefinition":"Azure.AI.Projects.HostedAgentDefinition","com.azure.ai.agents.models.HybridSearchOptions":"OpenAI.HybridSearchOptions","com.azure.ai.agents.models.ImageBasedHostedAgentDefinition":"Azure.AI.Projects.ImageBasedHostedAgentDefinition","com.azure.ai.agents.models.ImageDetail":"OpenAI.ImageDetail","com.azure.ai.agents.models.ImageGenTool":"OpenAI.ImageGenTool","com.azure.ai.agents.models.ImageGenToolBackground":"OpenAI.ImageGenTool.background.anonymous","com.azure.ai.agents.models.ImageGenToolInputImageMask":"OpenAI.ImageGenToolInputImageMask","com.azure.ai.agents.models.ImageGenToolModel":"OpenAI.ImageGenTool.model.anonymous","com.azure.ai.agents.models.ImageGenToolModeration":"OpenAI.ImageGenTool.moderation.anonymous","com.azure.ai.agents.models.ImageGenToolOutputFormat":"OpenAI.ImageGenTool.output_format.anonymous","com.azure.ai.agents.models.ImageGenToolQuality":"OpenAI.ImageGenTool.quality.anonymous","com.azure.ai.agents.models.ImageGenToolSize":"OpenAI.ImageGenTool.size.anonymous","com.azure.ai.agents.models.IncludeEnum":"OpenAI.IncludeEnum","com.azure.ai.agents.models.InputContent":"OpenAI.InputContent","com.azure.ai.agents.models.InputContentInputFileContent":"OpenAI.InputContentInputFileContent","com.azure.ai.agents.models.InputContentInputImageContent":"OpenAI.InputContentInputImageContent","com.azure.ai.agents.models.InputContentInputTextContent":"OpenAI.InputContentInputTextContent","com.azure.ai.agents.models.InputContentType":"OpenAI.InputContentType","com.azure.ai.agents.models.InputFidelity":"OpenAI.InputFidelity","com.azure.ai.agents.models.InputFileContentParam":"OpenAI.InputFileContentParam","com.azure.ai.agents.models.InputImageContentParamAutoParam":"OpenAI.InputImageContentParamAutoParam","com.azure.ai.agents.models.InputItem":"OpenAI.InputItem","com.azure.ai.agents.models.InputItemApplyPatchToolCallItemParam":"OpenAI.InputItemApplyPatchToolCallItemParam","com.azure.ai.agents.models.InputItemApplyPatchToolCallOutputItemParam":"OpenAI.InputItemApplyPatchToolCallOutputItemParam","com.azure.ai.agents.models.InputItemCodeInterpreterToolCall":"OpenAI.InputItemCodeInterpreterToolCall","com.azure.ai.agents.models.InputItemCompactionSummaryItemParam":"OpenAI.InputItemCompactionSummaryItemParam","com.azure.ai.agents.models.InputItemComputerCallOutputItemParam":"OpenAI.InputItemComputerCallOutputItemParam","com.azure.ai.agents.models.InputItemComputerToolCall":"OpenAI.InputItemComputerToolCall","com.azure.ai.agents.models.InputItemCustomToolCall":"OpenAI.InputItemCustomToolCall","com.azure.ai.agents.models.InputItemCustomToolCallOutput":"OpenAI.InputItemCustomToolCallOutput","com.azure.ai.agents.models.InputItemFileSearchToolCall":"OpenAI.InputItemFileSearchToolCall","com.azure.ai.agents.models.InputItemFunctionCallOutputItemParam":"OpenAI.InputItemFunctionCallOutputItemParam","com.azure.ai.agents.models.InputItemFunctionShellCallItemParam":"OpenAI.InputItemFunctionShellCallItemParam","com.azure.ai.agents.models.InputItemFunctionShellCallOutputItemParam":"OpenAI.InputItemFunctionShellCallOutputItemParam","com.azure.ai.agents.models.InputItemFunctionToolCall":"OpenAI.InputItemFunctionToolCall","com.azure.ai.agents.models.InputItemImageGenToolCall":"OpenAI.InputItemImageGenToolCall","com.azure.ai.agents.models.InputItemLocalShellToolCall":"OpenAI.InputItemLocalShellToolCall","com.azure.ai.agents.models.InputItemLocalShellToolCallOutput":"OpenAI.InputItemLocalShellToolCallOutput","com.azure.ai.agents.models.InputItemLocalShellToolCallOutputStatus":"OpenAI.InputItemLocalShellToolCallOutput.status.anonymous","com.azure.ai.agents.models.InputItemMcpApprovalRequest":"OpenAI.InputItemMcpApprovalRequest","com.azure.ai.agents.models.InputItemMcpApprovalResponse":"OpenAI.InputItemMcpApprovalResponse","com.azure.ai.agents.models.InputItemMcpListTools":"OpenAI.InputItemMcpListTools","com.azure.ai.agents.models.InputItemMcpToolCall":"OpenAI.InputItemMcpToolCall","com.azure.ai.agents.models.InputItemOutputMessage":"OpenAI.InputItemOutputMessage","com.azure.ai.agents.models.InputItemReasoningItem":"OpenAI.InputItemReasoningItem","com.azure.ai.agents.models.InputItemType":"OpenAI.InputItemType","com.azure.ai.agents.models.InputItemWebSearchToolCall":"OpenAI.InputItemWebSearchToolCall","com.azure.ai.agents.models.InputTextContentParam":"OpenAI.InputTextContentParam","com.azure.ai.agents.models.KeyPressAction":"OpenAI.KeyPressAction","com.azure.ai.agents.models.LocalShellExecAction":"OpenAI.LocalShellExecAction","com.azure.ai.agents.models.LocalShellToolParam":"OpenAI.LocalShellToolParam","com.azure.ai.agents.models.LogProb":"OpenAI.LogProb","com.azure.ai.agents.models.MCPListToolsTool":"OpenAI.MCPListToolsTool","com.azure.ai.agents.models.MCPListToolsToolAnnotations":"OpenAI.MCPListToolsToolAnnotations","com.azure.ai.agents.models.MCPListToolsToolInputSchema":"OpenAI.MCPListToolsToolInputSchema","com.azure.ai.agents.models.MCPTool":"OpenAI.MCPTool","com.azure.ai.agents.models.MCPToolCallStatus":"OpenAI.MCPToolCallStatus","com.azure.ai.agents.models.MCPToolConnectorId":"OpenAI.MCPTool.connector_id.anonymous","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.MemoryStoreDeleteScopeResponse":"Azure.AI.Projects.MemoryStoreDeleteScopeResponse","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.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.Move":"OpenAI.Move","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.OutputContent":"OpenAI.OutputContent","com.azure.ai.agents.models.OutputContentOutputTextContent":"OpenAI.OutputContentOutputTextContent","com.azure.ai.agents.models.OutputContentRefusalContent":"OpenAI.OutputContentRefusalContent","com.azure.ai.agents.models.OutputContentType":"OpenAI.OutputContentType","com.azure.ai.agents.models.OutputItemCodeInterpreterToolCallStatus":"OpenAI.OutputItemCodeInterpreterToolCall.status.anonymous","com.azure.ai.agents.models.OutputItemComputerToolCallStatus":"OpenAI.OutputItemComputerToolCall.status.anonymous","com.azure.ai.agents.models.OutputItemFileSearchToolCallStatus":"OpenAI.OutputItemFileSearchToolCall.status.anonymous","com.azure.ai.agents.models.OutputItemFunctionToolCallStatus":"OpenAI.OutputItemFunctionToolCall.status.anonymous","com.azure.ai.agents.models.OutputItemImageGenToolCallStatus":"OpenAI.OutputItemImageGenToolCall.status.anonymous","com.azure.ai.agents.models.OutputItemLocalShellToolCallStatus":"OpenAI.OutputItemLocalShellToolCall.status.anonymous","com.azure.ai.agents.models.OutputItemOutputMessageStatus":"OpenAI.OutputItemOutputMessage.status.anonymous","com.azure.ai.agents.models.OutputItemReasoningItemStatus":"OpenAI.OutputItemReasoningItem.status.anonymous","com.azure.ai.agents.models.OutputItemWebSearchToolCallStatus":"OpenAI.OutputItemWebSearchToolCall.status.anonymous","com.azure.ai.agents.models.OutputMessageContent":"OpenAI.OutputMessageContent","com.azure.ai.agents.models.OutputMessageContentOutputTextContent":"OpenAI.OutputMessageContentOutputTextContent","com.azure.ai.agents.models.OutputMessageContentRefusalContent":"OpenAI.OutputMessageContentRefusalContent","com.azure.ai.agents.models.OutputMessageContentType":"OpenAI.OutputMessageContentType","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.PromptAgentDefinitionText":"Azure.AI.Projects.PromptAgentDefinition.text.anonymous","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":"OpenAI.RankerVersionType","com.azure.ai.agents.models.RankingOptions":"OpenAI.RankingOptions","com.azure.ai.agents.models.Reasoning":"OpenAI.Reasoning","com.azure.ai.agents.models.ReasoningEffort":"OpenAI.Reasoning.effort.anonymous","com.azure.ai.agents.models.ReasoningGenerateSummary":"OpenAI.Reasoning.generate_summary.anonymous","com.azure.ai.agents.models.ReasoningSummary":"OpenAI.Reasoning.summary.anonymous","com.azure.ai.agents.models.ReasoningTextContent":"OpenAI.ReasoningTextContent","com.azure.ai.agents.models.ResponseFormatJsonSchemaSchema":"OpenAI.ResponseFormatJsonSchemaSchema","com.azure.ai.agents.models.ResponseUsageInputTokensDetails":"OpenAI.ResponseUsageInputTokensDetails","com.azure.ai.agents.models.ResponseUsageOutputTokensDetails":"OpenAI.ResponseUsageOutputTokensDetails","com.azure.ai.agents.models.Screenshot":"OpenAI.Screenshot","com.azure.ai.agents.models.Scroll":"OpenAI.Scroll","com.azure.ai.agents.models.SearchContextSize":"OpenAI.SearchContextSize","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.StructuredInputDefinition":"Azure.AI.Projects.StructuredInputDefinition","com.azure.ai.agents.models.StructuredOutputDefinition":"Azure.AI.Projects.StructuredOutputDefinition","com.azure.ai.agents.models.Summary":"OpenAI.Summary","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.TopLogProb":"OpenAI.TopLogProb","com.azure.ai.agents.models.Type":"OpenAI.Type","com.azure.ai.agents.models.UrlCitationBody":"OpenAI.UrlCitationBody","com.azure.ai.agents.models.UserProfileMemoryItem":"Azure.AI.Projects.UserProfileMemoryItem","com.azure.ai.agents.models.VectorStoreFileAttributes":"OpenAI.VectorStoreFileAttributes","com.azure.ai.agents.models.Wait":"OpenAI.Wait","com.azure.ai.agents.models.WebSearchActionFind":"OpenAI.WebSearchActionFind","com.azure.ai.agents.models.WebSearchActionOpenPage":"OpenAI.WebSearchActionOpenPage","com.azure.ai.agents.models.WebSearchActionSearch":"OpenAI.WebSearchActionSearch","com.azure.ai.agents.models.WebSearchActionSearchSources":"OpenAI.WebSearchActionSearchSources","com.azure.ai.agents.models.WebSearchApproximateLocation":"OpenAI.WebSearchApproximateLocation","com.azure.ai.agents.models.WebSearchApproximateLocationType":null,"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":"OpenAI.WebSearchTool.search_context_size.anonymous","com.azure.ai.agents.models.WorkflowAgentDefinition":"Azure.AI.Projects.WorkflowAgentDefinition"},"generatedFiles":["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/implementation/AgentsClientImpl.java","src/main/java/com/azure/ai/agents/implementation/AgentsImpl.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/models/CreateAgentFromManifestRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionFromManifestRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateAgentVersionRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/CreateMemoryStoreRequest.java","src/main/java/com/azure/ai/agents/implementation/models/DeleteScopeRequest.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/ItemReferenceParam.java","src/main/java/com/azure/ai/agents/implementation/models/SearchMemoriesRequest.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentFromManifestRequest1.java","src/main/java/com/azure/ai/agents/implementation/models/UpdateAgentRequest1.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/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/AgentDefinition.java","src/main/java/com/azure/ai/agents/models/AgentDetails.java","src/main/java/com/azure/ai/agents/models/AgentId.java","src/main/java/com/azure/ai/agents/models/AgentKind.java","src/main/java/com/azure/ai/agents/models/AgentObjectVersions.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/AgentVersionDetails.java","src/main/java/com/azure/ai/agents/models/Annotation.java","src/main/java/com/azure/ai/agents/models/AnnotationType.java","src/main/java/com/azure/ai/agents/models/ApplyPatchCallOutputStatusParam.java","src/main/java/com/azure/ai/agents/models/ApplyPatchCallStatusParam.java","src/main/java/com/azure/ai/agents/models/ApplyPatchCreateFileOperationParam.java","src/main/java/com/azure/ai/agents/models/ApplyPatchDeleteFileOperationParam.java","src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParam.java","src/main/java/com/azure/ai/agents/models/ApplyPatchOperationParamType.java","src/main/java/com/azure/ai/agents/models/ApplyPatchToolParam.java","src/main/java/com/azure/ai/agents/models/ApplyPatchUpdateFileOperationParam.java","src/main/java/com/azure/ai/agents/models/ApproximateLocation.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/AzureFunctionBinding.java","src/main/java/com/azure/ai/agents/models/AzureFunctionDefinition.java","src/main/java/com/azure/ai/agents/models/AzureFunctionDefinitionFunction.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/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/ClickButtonType.java","src/main/java/com/azure/ai/agents/models/ClickParam.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterContainerAuto.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputImage.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterOutputLogs.java","src/main/java/com/azure/ai/agents/models/CodeInterpreterTool.java","src/main/java/com/azure/ai/agents/models/ComparisonFilter.java","src/main/java/com/azure/ai/agents/models/ComparisonFilterType.java","src/main/java/com/azure/ai/agents/models/CompoundFilter.java","src/main/java/com/azure/ai/agents/models/CompoundFilterType.java","src/main/java/com/azure/ai/agents/models/ComputerAction.java","src/main/java/com/azure/ai/agents/models/ComputerActionType.java","src/main/java/com/azure/ai/agents/models/ComputerCallSafetyCheckParam.java","src/main/java/com/azure/ai/agents/models/ComputerEnvironment.java","src/main/java/com/azure/ai/agents/models/ComputerScreenshotImage.java","src/main/java/com/azure/ai/agents/models/ComputerUsePreviewTool.java","src/main/java/com/azure/ai/agents/models/ContainerAppAgentDefinition.java","src/main/java/com/azure/ai/agents/models/ContainerFileCitationBody.java","src/main/java/com/azure/ai/agents/models/ContainerLogKind.java","src/main/java/com/azure/ai/agents/models/ContainerMemoryLimit.java","src/main/java/com/azure/ai/agents/models/CustomGrammarFormatParam.java","src/main/java/com/azure/ai/agents/models/CustomTextFormatParam.java","src/main/java/com/azure/ai/agents/models/CustomToolParam.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/DeleteAgentResponse.java","src/main/java/com/azure/ai/agents/models/DeleteAgentVersionResponse.java","src/main/java/com/azure/ai/agents/models/DeleteMemoryStoreResponse.java","src/main/java/com/azure/ai/agents/models/DetailEnum.java","src/main/java/com/azure/ai/agents/models/DoubleClickAction.java","src/main/java/com/azure/ai/agents/models/Drag.java","src/main/java/com/azure/ai/agents/models/DragPoint.java","src/main/java/com/azure/ai/agents/models/Error.java","src/main/java/com/azure/ai/agents/models/FabricDataAgentToolParameters.java","src/main/java/com/azure/ai/agents/models/FileCitationBody.java","src/main/java/com/azure/ai/agents/models/FilePath.java","src/main/java/com/azure/ai/agents/models/FileSearchTool.java","src/main/java/com/azure/ai/agents/models/FileSearchToolCallResults.java","src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutput.java","src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputFileContent.java","src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputImageContent.java","src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputInputTextContent.java","src/main/java/com/azure/ai/agents/models/FunctionAndCustomToolCallOutputType.java","src/main/java/com/azure/ai/agents/models/FunctionCallItemStatus.java","src/main/java/com/azure/ai/agents/models/FunctionShellActionParam.java","src/main/java/com/azure/ai/agents/models/FunctionShellCallItemStatus.java","src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputContentParam.java","src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputExitOutcomeParam.java","src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputOutcomeParam.java","src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputOutcomeParamType.java","src/main/java/com/azure/ai/agents/models/FunctionShellCallOutputTimeoutOutcomeParam.java","src/main/java/com/azure/ai/agents/models/FunctionShellToolParam.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/HostedAgentDefinition.java","src/main/java/com/azure/ai/agents/models/HybridSearchOptions.java","src/main/java/com/azure/ai/agents/models/ImageBasedHostedAgentDefinition.java","src/main/java/com/azure/ai/agents/models/ImageDetail.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/InputContent.java","src/main/java/com/azure/ai/agents/models/InputContentInputFileContent.java","src/main/java/com/azure/ai/agents/models/InputContentInputImageContent.java","src/main/java/com/azure/ai/agents/models/InputContentInputTextContent.java","src/main/java/com/azure/ai/agents/models/InputContentType.java","src/main/java/com/azure/ai/agents/models/InputFidelity.java","src/main/java/com/azure/ai/agents/models/InputFileContentParam.java","src/main/java/com/azure/ai/agents/models/InputImageContentParamAutoParam.java","src/main/java/com/azure/ai/agents/models/InputItem.java","src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemApplyPatchToolCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemCodeInterpreterToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemCompactionSummaryItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemComputerCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemComputerToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemCustomToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemCustomToolCallOutput.java","src/main/java/com/azure/ai/agents/models/InputItemFileSearchToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemFunctionCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemFunctionShellCallOutputItemParam.java","src/main/java/com/azure/ai/agents/models/InputItemFunctionToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemImageGenToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutput.java","src/main/java/com/azure/ai/agents/models/InputItemLocalShellToolCallOutputStatus.java","src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalRequest.java","src/main/java/com/azure/ai/agents/models/InputItemMcpApprovalResponse.java","src/main/java/com/azure/ai/agents/models/InputItemMcpListTools.java","src/main/java/com/azure/ai/agents/models/InputItemMcpToolCall.java","src/main/java/com/azure/ai/agents/models/InputItemOutputMessage.java","src/main/java/com/azure/ai/agents/models/InputItemReasoningItem.java","src/main/java/com/azure/ai/agents/models/InputItemType.java","src/main/java/com/azure/ai/agents/models/InputItemWebSearchToolCall.java","src/main/java/com/azure/ai/agents/models/InputTextContentParam.java","src/main/java/com/azure/ai/agents/models/KeyPressAction.java","src/main/java/com/azure/ai/agents/models/LocalShellExecAction.java","src/main/java/com/azure/ai/agents/models/LocalShellToolParam.java","src/main/java/com/azure/ai/agents/models/LogProb.java","src/main/java/com/azure/ai/agents/models/MCPListToolsTool.java","src/main/java/com/azure/ai/agents/models/MCPListToolsToolAnnotations.java","src/main/java/com/azure/ai/agents/models/MCPListToolsToolInputSchema.java","src/main/java/com/azure/ai/agents/models/MCPTool.java","src/main/java/com/azure/ai/agents/models/MCPToolCallStatus.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/MemoryStoreDeleteScopeResponse.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/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/Move.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/OutputContent.java","src/main/java/com/azure/ai/agents/models/OutputContentOutputTextContent.java","src/main/java/com/azure/ai/agents/models/OutputContentRefusalContent.java","src/main/java/com/azure/ai/agents/models/OutputContentType.java","src/main/java/com/azure/ai/agents/models/OutputItemCodeInterpreterToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemComputerToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemFileSearchToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemFunctionToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemImageGenToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemLocalShellToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemOutputMessageStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemReasoningItemStatus.java","src/main/java/com/azure/ai/agents/models/OutputItemWebSearchToolCallStatus.java","src/main/java/com/azure/ai/agents/models/OutputMessageContent.java","src/main/java/com/azure/ai/agents/models/OutputMessageContentOutputTextContent.java","src/main/java/com/azure/ai/agents/models/OutputMessageContentRefusalContent.java","src/main/java/com/azure/ai/agents/models/OutputMessageContentType.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/PromptAgentDefinitionText.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/Reasoning.java","src/main/java/com/azure/ai/agents/models/ReasoningEffort.java","src/main/java/com/azure/ai/agents/models/ReasoningGenerateSummary.java","src/main/java/com/azure/ai/agents/models/ReasoningSummary.java","src/main/java/com/azure/ai/agents/models/ReasoningTextContent.java","src/main/java/com/azure/ai/agents/models/ResponseFormatJsonSchemaSchema.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/Screenshot.java","src/main/java/com/azure/ai/agents/models/Scroll.java","src/main/java/com/azure/ai/agents/models/SearchContextSize.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/StructuredInputDefinition.java","src/main/java/com/azure/ai/agents/models/StructuredOutputDefinition.java","src/main/java/com/azure/ai/agents/models/Summary.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/TopLogProb.java","src/main/java/com/azure/ai/agents/models/Type.java","src/main/java/com/azure/ai/agents/models/UrlCitationBody.java","src/main/java/com/azure/ai/agents/models/UserProfileMemoryItem.java","src/main/java/com/azure/ai/agents/models/VectorStoreFileAttributes.java","src/main/java/com/azure/ai/agents/models/Wait.java","src/main/java/com/azure/ai/agents/models/WebSearchActionFind.java","src/main/java/com/azure/ai/agents/models/WebSearchActionOpenPage.java","src/main/java/com/azure/ai/agents/models/WebSearchActionSearch.java","src/main/java/com/azure/ai/agents/models/WebSearchActionSearchSources.java","src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocation.java","src/main/java/com/azure/ai/agents/models/WebSearchApproximateLocationType.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/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/FileSearchAgent.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/FileSearchAgent.java new file mode 100644 index 000000000000..7ecee4f82d3c --- /dev/null +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/FileSearchAgent.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.agents; + +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collections; +import java.util.concurrent.TimeUnit; + +import com.azure.ai.agents.models.AgentReference; +import com.azure.ai.agents.models.AgentVersionDetails; +import com.azure.ai.agents.models.FileSearchTool; +import com.azure.ai.agents.models.PromptAgentDefinition; +import com.azure.core.credential.TokenCredential; +import com.azure.core.util.Configuration; +import com.azure.identity.AuthenticationUtil; +import com.azure.identity.DefaultAzureCredentialBuilder; +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.credential.BearerTokenCredential; +import com.openai.models.conversations.Conversation; +import com.openai.models.files.FileCreateParams; +import com.openai.models.files.FileObject; +import com.openai.models.files.FilePurpose; +import com.openai.models.responses.Response; +import com.openai.models.responses.ResponseCreateParams; +import com.openai.models.responses.ResponseFileSearchToolCall; +import com.openai.models.responses.ResponseOutputItem; +import com.openai.models.responses.ResponseOutputMessage; +import com.openai.models.vectorstores.VectorStore; +import com.openai.models.vectorstores.VectorStoreCreateParams; + +/** + * This sample demonstrates how to create an Azure AI Agent with the File Search tool + * and use it to get responses that involve searching uploaded files. + * It creates a vector store, uploads a file, and then uses the agent to search the file. + */ +public class FileSearchAgent { + public static void main(String[] args) { + String endpoint = Configuration.getGlobalConfiguration().get("AZURE_AGENTS_ENDPOINT"); + String model = Configuration.getGlobalConfiguration().get("AZURE_AGENTS_MODEL"); + + TokenCredential credential = new DefaultAzureCredentialBuilder().build(); + + AgentsClientBuilder builder = new AgentsClientBuilder() + .credential(credential) + .serviceVersion(AgentsServiceVersion.getLatest()) + .endpoint(endpoint); + + AgentsClient agentsClient = builder.buildAgentsClient(); + ResponsesClient responsesClient = builder.buildResponsesClient(); + ConversationsClient conversationsClient = builder.buildConversationsClient(); + + // Create OpenAI client for vector store and file operations + OpenAIClient openAIClient = OpenAIOkHttpClient.builder() + .baseUrl(endpoint) + .credential(BearerTokenCredential.create(AuthenticationUtil.getBearerTokenSupplier( + credential, "https://cognitiveservices.azure.com/.default"))) + .build(); + + AgentVersionDetails agent = null; + Conversation conversation = null; + VectorStore vectorStore = null; + FileObject uploadedFile = null; + Path tempFile = null; + + try { + String sampleContent = "The Solar System consists of the Sun and the celestial objects bound to it by gravity. " + + "The eight planets in order from the Sun are: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. " + + "Earth is the third planet from the Sun and the only known planet to harbor life. " + + "Jupiter is the largest planet, while Mercury is the smallest. "; + + tempFile = Files.createTempFile("sample_document", ".txt"); + Files.write(tempFile, sampleContent.getBytes(StandardCharsets.UTF_8)); + + uploadedFile = openAIClient.files().create(FileCreateParams.builder() + .file(tempFile) + .purpose(FilePurpose.ASSISTANTS) + .build()); + System.out.println("Uploaded file: " + uploadedFile.id()); + + vectorStore = openAIClient.vectorStores().create(VectorStoreCreateParams.builder() + .name("SampleVectorStore") + .fileIds(Collections.singletonList(uploadedFile.id())) + .build()); + System.out.println("Created vector store: " + vectorStore.id()); + + System.out.println("Waiting for vector store to process files..."); + sleepSeconds(5); // Wait for vector store to be ready + + // Create a FileSearchTool with the vector store ID + FileSearchTool tool = new FileSearchTool(Collections.singletonList(vectorStore.id())); + + // Create the agent definition with File Search tool enabled + PromptAgentDefinition agentDefinition = new PromptAgentDefinition(model) + .setInstructions("You are a helpful assistant that can search through uploaded files to answer questions. " + + "When asked about information, use the file search tool to find relevant content from the files.") + .setTools(Collections.singletonList(tool)); + + agent = agentsClient.createAgentVersion("MyFileSearchAgent", agentDefinition); + System.out.printf("Agent created (id: %s, version: %s)\n", agent.getId(), agent.getVersion()); + + AgentReference agentReference = new AgentReference(agent.getName()).setVersion(agent.getVersion()); + + conversation = conversationsClient.getConversationService().create(); + System.out.println("Created Conversation: " + conversation.id()); + + Response response = responsesClient.createWithAgentConversation(agentReference, conversation.id(), + ResponseCreateParams.builder().input("What is the largest planet in the Solar System?")); + + // Process and display the response + System.out.println("\n=== Agent Response ==="); + for (ResponseOutputItem outputItem : response.output()) { + // Handle message output + if (outputItem.message().isPresent()) { + ResponseOutputMessage message = outputItem.message().get(); + message.content().forEach(content -> { + content.outputText().ifPresent(text -> { + System.out.println("Assistant: " + text.text()); + }); + }); + } + + // Handle file search tool call output + if (outputItem.fileSearchCall().isPresent()) { + ResponseFileSearchToolCall fileSearchCall = outputItem.fileSearchCall().get(); + System.out.println("\n--- File Search Execution ---"); + System.out.println("Call ID: " + fileSearchCall.id()); + System.out.println("Status: " + fileSearchCall.status()); + fileSearchCall.results().ifPresent(results -> { + System.out.println("Results found: " + results.size()); + results.forEach(result -> { + System.out.println(" - File ID: " + result.fileId()); + result.filename().ifPresent(name -> System.out.println(" Filename: " + name)); + result.score().ifPresent(score -> System.out.println(" Score: " + score)); + result.text().ifPresent(text -> System.out.println(" Text: " + text)); + }); + }); + } + } + + System.out.println("\nResponse ID: " + response.id()); + System.out.println("Model Used: " + response.model()); + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + e.printStackTrace(); + } finally { + // Cleanup created resources + if (tempFile != null) { + try { + Files.deleteIfExists(tempFile); + } catch (Exception e) { + System.err.println("Failed to delete temp file: " + e.getMessage()); + } + } + if (conversation != null) { + conversationsClient.getConversationService().delete(conversation.id()); + System.out.println("Conversation deleted successfully."); + } + if (agent != null) { + agentsClient.deleteAgentVersion(agent.getName(), agent.getVersion()); + System.out.println("Agent deleted successfully."); + } + if (vectorStore != null) { + openAIClient.vectorStores().delete(vectorStore.id()); + System.out.println("Vector store deleted successfully."); + } + if (uploadedFile != null) { + openAIClient.files().delete(uploadedFile.id()); + System.out.println("File deleted successfully."); + } + } + } + + private static void sleepSeconds(long seconds) { + try { + TimeUnit.SECONDS.sleep(seconds); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException("Sleep interrupted", e); + } + } +} \ No newline at end of file diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MemorySearchAgent.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MemorySearchAgent.java index 2de0ac2a1823..a25f1f12cd77 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MemorySearchAgent.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MemorySearchAgent.java @@ -5,7 +5,7 @@ import com.azure.ai.agents.models.AgentReference; import com.azure.ai.agents.models.AgentVersionDetails; -import com.azure.ai.agents.models.MemorySearchTool; +import com.azure.ai.agents.models.MemorySearchPreviewTool; import com.azure.ai.agents.models.MemoryStoreDefaultDefinition; import com.azure.ai.agents.models.MemoryStoreDefaultOptions; import com.azure.ai.agents.models.MemoryStoreDetails; @@ -36,7 +36,7 @@ public static void main(String[] args) { AgentsClientBuilder builder = new AgentsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) .endpoint(endpoint) - .serviceVersion(AgentsServiceVersion.V2025_05_15_PREVIEW); + .serviceVersion(AgentsServiceVersion.V2025_11_15_PREVIEW); AgentsClient agentsClient = builder.buildAgentsClient(); MemoryStoresClient memoryStoresClient = builder.buildMemoryStoresClient(); @@ -62,7 +62,7 @@ public static void main(String[] args) { = memoryStoresClient.createMemoryStore(memoryStoreName, definition, description, null); System.out.printf("Created memory store: %s (%s)\n", memoryStore.getName(), memoryStore.getId()); - MemorySearchTool tool = new MemorySearchTool(memoryStore.getName(), scope) + MemorySearchPreviewTool tool = new MemorySearchPreviewTool(memoryStore.getName(), scope) .setUpdateDelay(1); // Wait 1 second of inactivity before extracting memories PromptAgentDefinition agentDefinition = new PromptAgentDefinition(agentModel) diff --git a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MultipleAgentsConversation.java b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MultipleAgentsConversation.java index a1d8942a7b58..97d191c759c1 100644 --- a/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MultipleAgentsConversation.java +++ b/sdk/ai/azure-ai-agents/src/samples/java/com/azure/ai/agents/MultipleAgentsConversation.java @@ -29,7 +29,7 @@ public static void main(String[] args) { // Code sample for creating an agent AgentsClientBuilder builder = new AgentsClientBuilder() .credential(new DefaultAzureCredentialBuilder().build()) - .serviceVersion(AgentsServiceVersion.V2025_05_15_PREVIEW) + .serviceVersion(AgentsServiceVersion.V2025_11_15_PREVIEW) .endpoint(endpoint); AgentsClient agentsClient = builder.buildAgentsClient(); ResponsesClient responsesClient = builder.buildResponsesClient(); diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresAsyncTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresAsyncTests.java index 53b15506b493..1cde164a2440 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresAsyncTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresAsyncTests.java @@ -3,7 +3,6 @@ package com.azure.ai.agents; -import com.azure.ai.agents.models.ListAgentsRequestOrder; import com.azure.ai.agents.models.MemoryOperation; import com.azure.ai.agents.models.MemorySearchItem; import com.azure.ai.agents.models.MemorySearchOptions; @@ -14,14 +13,14 @@ import com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult; import com.azure.ai.agents.models.MemoryStoreUpdateResponse; import com.azure.ai.agents.models.MemoryStoreUpdateStatus; -import com.azure.ai.agents.models.ResponsesAssistantMessageItemParam; -import com.azure.ai.agents.models.ResponsesUserMessageItemParam; +import com.azure.ai.agents.models.PageOrder; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; -import com.azure.core.util.BinaryData; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.openai.models.responses.EasyInputMessage; +import com.openai.models.responses.ResponseInputItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import reactor.core.publisher.Mono; @@ -75,7 +74,7 @@ public void basicMemoryStoresCrud(HttpClient httpClient, AgentsServiceVersion se assertEquals(createdStore.getName(), updatedStore.getName()); assertEquals(updatedDescription, updatedStore.getDescription()); - return memoryStoreClient.listMemoryStores(10, ListAgentsRequestOrder.DESC, null, null) + return memoryStoreClient.listMemoryStores(10, PageOrder.DESC, null, null) .collectList() .doOnNext(stores -> { assertNotNull(stores); @@ -124,10 +123,10 @@ public void basicMemoryStores(HttpClient httpClient, AgentsServiceVersion servic = new MemoryStoreDefaultDefinition(deploymentName, embeddingDeploymentName); definition.setOptions(new MemoryStoreDefaultOptions(true, true)); - ResponsesUserMessageItemParam userMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(userMessageContent)); - ResponsesUserMessageItemParam queryMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(queryMessageContent)); + ResponseInputItem userMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(userMessageContent).build()); + ResponseInputItem queryMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(queryMessageContent).build()); MemorySearchOptions searchOptions = new MemorySearchOptions(); searchOptions.setMaxMemories(5); @@ -197,16 +196,16 @@ public void advancedMemoryStores(HttpClient httpClient, AgentsServiceVersion ser = new MemoryStoreDefaultDefinition(deploymentName, embeddingDeploymentName); definition.setOptions(options); - ResponsesUserMessageItemParam initialMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(firstMessageContent)); - ResponsesUserMessageItemParam chainedMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(chainedMessageContent)); - ResponsesUserMessageItemParam searchQuery - = new ResponsesUserMessageItemParam(BinaryData.fromString(queryMessageContent)); - ResponsesAssistantMessageItemParam agentMessage - = new ResponsesAssistantMessageItemParam(BinaryData.fromString(followupContextContent)); - ResponsesUserMessageItemParam followupQuery - = new ResponsesUserMessageItemParam(BinaryData.fromString(followupQuestionContent)); + ResponseInputItem initialMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(firstMessageContent).build()); + ResponseInputItem chainedMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(chainedMessageContent).build()); + ResponseInputItem searchQuery = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(queryMessageContent).build()); + ResponseInputItem agentMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.ASSISTANT).content(followupContextContent).build()); + ResponseInputItem followupQuery = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(followupQuestionContent).build()); MemorySearchOptions searchOptions = new MemorySearchOptions(); searchOptions.setMaxMemories(5); diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresTests.java index bfd10246c8fa..a9005d8f026f 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/MemoryStoresTests.java @@ -4,7 +4,6 @@ package com.azure.ai.agents; import com.azure.ai.agents.models.DeleteMemoryStoreResponse; -import com.azure.ai.agents.models.ListAgentsRequestOrder; import com.azure.ai.agents.models.MemoryOperation; import com.azure.ai.agents.models.MemorySearchItem; import com.azure.ai.agents.models.MemorySearchOptions; @@ -16,13 +15,13 @@ import com.azure.ai.agents.models.MemoryStoreUpdateCompletedResult; import com.azure.ai.agents.models.MemoryStoreUpdateResponse; import com.azure.ai.agents.models.MemoryStoreUpdateStatus; -import com.azure.ai.agents.models.ResponsesAssistantMessageItemParam; -import com.azure.ai.agents.models.ResponsesUserMessageItemParam; +import com.azure.ai.agents.models.PageOrder; import com.azure.core.exception.ResourceNotFoundException; import com.azure.core.http.HttpClient; -import com.azure.core.util.BinaryData; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.SyncPoller; +import com.openai.models.responses.EasyInputMessage; +import com.openai.models.responses.ResponseInputItem; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -78,8 +77,7 @@ public void basicMemoryStoresCrud(HttpClient httpClient, AgentsServiceVersion se // List Memory Stores and ensure the updated one is present boolean found = false; - for (MemoryStoreDetails store : memoryStoreClient.listMemoryStores(10, ListAgentsRequestOrder.DESC, null, - null)) { + for (MemoryStoreDetails store : memoryStoreClient.listMemoryStores(10, PageOrder.DESC, null, null)) { assertNotNull(store.getId()); assertNotNull(store.getName()); if (store.getName().equals(updatedStore.getName())) { @@ -128,8 +126,8 @@ public void basicMemoryStores(HttpClient httpClient, AgentsServiceVersion servic assertEquals(description, memoryStore.getDescription()); // Add memories to the memory store - ResponsesUserMessageItemParam userMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(userMessageContent)); + ResponseInputItem userMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(userMessageContent).build()); // beginUpdateMemories returns a poller SyncPoller updatePoller = memoryStoreClient.beginUpdateMemories(memoryStoreName, scope, Arrays.asList(userMessage), null, 1); @@ -151,9 +149,8 @@ public void basicMemoryStores(HttpClient httpClient, AgentsServiceVersion servic assertNotNull(operation.getMemoryItem().getContent()); } - // Retrieve memories from the memory store - ResponsesUserMessageItemParam queryMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(queryMessageContent)); + ResponseInputItem queryMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(queryMessageContent).build()); MemorySearchOptions searchOptions = new MemorySearchOptions(); searchOptions.setMaxMemories(5); MemoryStoreSearchResponse searchResponse = memoryStoreClient.searchMemories(memoryStoreName, scope, @@ -207,8 +204,8 @@ public void advancedMemoryStores(HttpClient httpClient, AgentsServiceVersion ser assertNotNull(memoryStore); assertEquals(memoryStoreName, memoryStore.getName()); - ResponsesUserMessageItemParam initialMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(firstMessageContent)); + ResponseInputItem initialMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(firstMessageContent).build()); SyncPoller initialPoller = memoryStoreClient.beginUpdateMemories(memoryStoreName, scope, Arrays.asList(initialMessage), null, 300); @@ -217,8 +214,8 @@ public void advancedMemoryStores(HttpClient httpClient, AgentsServiceVersion ser String initialUpdateId = initialResponse.getUpdateId(); assertNotNull(initialUpdateId); - ResponsesUserMessageItemParam chainedMessage - = new ResponsesUserMessageItemParam(BinaryData.fromString(chainedMessageContent)); + ResponseInputItem chainedMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(chainedMessageContent).build()); SyncPoller chainedPoller = memoryStoreClient .beginUpdateMemories(memoryStoreName, scope, Arrays.asList(chainedMessage), initialUpdateId, 0); @@ -239,8 +236,8 @@ public void advancedMemoryStores(HttpClient httpClient, AgentsServiceVersion ser assertNotNull(operation.getMemoryItem().getContent()); } - ResponsesUserMessageItemParam searchQuery - = new ResponsesUserMessageItemParam(BinaryData.fromString(queryMessageContent)); + ResponseInputItem searchQuery = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(queryMessageContent).build()); MemorySearchOptions searchOptions = new MemorySearchOptions(); searchOptions.setMaxMemories(5); @@ -256,10 +253,10 @@ public void advancedMemoryStores(HttpClient httpClient, AgentsServiceVersion ser String previousSearchId = searchResponse.getSearchId(); assertNotNull(previousSearchId); - ResponsesAssistantMessageItemParam agentMessage - = new ResponsesAssistantMessageItemParam(BinaryData.fromString(followupContextContent)); - ResponsesUserMessageItemParam followupQuery - = new ResponsesUserMessageItemParam(BinaryData.fromString(followupQuestionContent)); + ResponseInputItem agentMessage = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.ASSISTANT).content(followupContextContent).build()); + ResponseInputItem followupQuery = ResponseInputItem.ofEasyInputMessage( + EasyInputMessage.builder().role(EasyInputMessage.Role.USER).content(followupQuestionContent).build()); MemoryStoreSearchResponse followupSearch = memoryStoreClient.searchMemories(memoryStoreName, scope, Arrays.asList(agentMessage, followupQuery), previousSearchId, searchOptions); diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/TestUtils.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/TestUtils.java index 5d96b6c8e7b3..1c037d488538 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/TestUtils.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/TestUtils.java @@ -33,7 +33,7 @@ public class TestUtils { static Stream getTestParameters() { List argumentsList = new ArrayList<>(); getHttpClients().forEach( - httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V2025_05_15_PREVIEW))); + httpClient -> argumentsList.add(Arguments.of(httpClient, AgentsServiceVersion.V2025_11_15_PREVIEW))); return argumentsList.stream(); } diff --git a/sdk/ai/azure-ai-agents/tsp-location.yaml b/sdk/ai/azure-ai-agents/tsp-location.yaml new file mode 100644 index 000000000000..e759f1477c50 --- /dev/null +++ b/sdk/ai/azure-ai-agents/tsp-location.yaml @@ -0,0 +1,10 @@ +directory: specification/ai-foundry/data-plane/Foundry/src/sdk-agents +commit: c7c5a29c027db07030c37fa0d092154c8fe4d3a7 +repo: Azure/azure-rest-api-specs +additionalDirectories: + - specification/ai-foundry/data-plane/Foundry/src/agents + - specification/ai-foundry/data-plane/Foundry/src/common + - specification/ai-foundry/data-plane/Foundry/src/memory_stores + - specification/ai-foundry/data-plane/Foundry/src/responses + - specification/ai-foundry/data-plane/Foundry/src/tools + - specification/ai-foundry/data-plane/Foundry/src/conversations diff --git a/sdk/ai/azure-ai-projects/tsp-location.yaml b/sdk/ai/azure-ai-projects/tsp-location.yaml index df77dc5454b5..5b8644ae17c7 100644 --- a/sdk/ai/azure-ai-projects/tsp-location.yaml +++ b/sdk/ai/azure-ai-projects/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/ai-foundry/data-plane/Foundry -commit: 8888596f5812e0fdac75ba3f41a8449fb82e22a1 +commit: 595834703e33cf688976fa1d23ea7661fa898ec8 repo: Azure/azure-rest-api-specs entrypointFile: client.java.tsp \ No newline at end of file