Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/lintingconfigs/revapi/track2/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
"regex": true,
"code": "java\\.annotation\\.(added|attributeValueChanged)",
"old": ".*",
"annotationType": "com\\.azure\\.core\\.annotation\\.Service(Method|Client)",
"annotationType": "com\\.azure\\.core\\.annotation\\.Service(Method|Client|ClientBuilder)",
"justification": "These are SDK metadata annotations and don't affect runtime behavior."
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.azure.ai.agents.models.AgentKind;
import com.azure.ai.agents.models.AgentSessionResource;
import com.azure.ai.agents.models.AgentVersionDetails;
import com.azure.ai.agents.models.CreateAgentVersionInput;
import com.azure.ai.agents.models.PageOrder;
import com.azure.ai.agents.models.UpdateAgentDetailsPatchRequest;
import com.azure.ai.agents.models.VersionIndicator;
Expand Down Expand Up @@ -58,7 +59,7 @@ public final class AgentsAsyncClient {
/**
* Retrieves the agent.
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -161,7 +162,7 @@ public Mono<Response<BinaryData>> getAgentWithResponse(String agentName, Request
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -181,9 +182,9 @@ public Mono<Response<BinaryData>> getAgentWithResponse(String agentName, Request
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -307,7 +308,7 @@ public Mono<Void> deleteAgentVersion(String agentName, String agentVersion) {
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -477,7 +478,7 @@ public Mono<AgentVersionDetails> createAgentVersion(String agentName, AgentDefin
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -533,9 +534,9 @@ public Mono<AgentVersionDetails> createAgentVersion(String agentName, AgentDefin
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -639,7 +640,7 @@ Mono<Response<BinaryData>> createAgentWithResponse(BinaryData createAgentRequest
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -659,9 +660,9 @@ Mono<Response<BinaryData>> createAgentWithResponse(BinaryData createAgentRequest
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -792,7 +793,7 @@ Mono<AgentDetails> updateAgent(String agentName, AgentDefinition definition) {
/**
* Creates an agent from a manifest.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -808,9 +809,9 @@ Mono<AgentDetails> updateAgent(String agentName, AgentDefinition definition) {
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -907,7 +908,7 @@ Mono<Response<BinaryData>> createAgentFromManifestWithResponse(BinaryData create
* Updates the agent from a manifest by adding a new version if there are any changes to the agent definition.
* If no changes, returns the existing agent version.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -922,9 +923,9 @@ Mono<Response<BinaryData>> createAgentFromManifestWithResponse(BinaryData create
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1021,7 +1022,7 @@ Mono<Response<BinaryData>> updateAgentFromManifestWithResponse(String agentName,
/**
* Create a new agent version from a manifest.
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -1036,9 +1037,9 @@ Mono<Response<BinaryData>> updateAgentFromManifestWithResponse(String agentName,
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1262,7 +1263,7 @@ public Mono<AgentVersionDetails> createAgentVersionFromManifest(String agentName
/**
* Retrieves a specific version of an agent.
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1471,7 +1472,7 @@ public PagedFlux<AgentVersionDetails> listAgentVersions(String agentName, Intege
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1627,7 +1628,7 @@ Mono<AgentDetails> createAgentFromManifest(String agentName, String manifestId,
* </table>
* You can add these to a request with {@link RequestOptions#addQueryParam}
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1798,7 +1799,7 @@ public Mono<Response<Void>> deleteAgentWithResponse(String agentName, RequestOpt
/**
* Deletes an agent.
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1826,7 +1827,7 @@ Mono<Response<BinaryData>> internalDeleteAgentWithResponse(String agentName, Req
/**
* Deletes a specific version of an agent.
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1868,7 +1869,7 @@ Mono<Response<BinaryData>> internalDeleteAgentVersionWithResponse(String agentNa
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand All @@ -1879,9 +1880,9 @@ Mono<Response<BinaryData>> internalDeleteAgentVersionWithResponse(String agentNa
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -1929,7 +1930,7 @@ public Mono<Response<BinaryData>> createSessionWithResponse(String agentName, St
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -2025,7 +2026,7 @@ public Mono<Response<Void>> deleteSessionWithResponse(String agentName, String s
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -2478,7 +2479,7 @@ public PagedFlux<AgentSessionResource> listSessions(String agentName) {
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -2521,7 +2522,7 @@ public Mono<Response<BinaryData>> getSessionLogStreamWithResponse(String agentNa
* </table>
* You can add these to a request with {@link RequestOptions#addHeader}
* <p><strong>Request Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -2563,9 +2564,9 @@ public Mono<Response<BinaryData>> getSessionLogStreamWithResponse(String agentNa
* }
* }
* </pre>
*
*
* <p><strong>Response Body Schema</strong></p>
*
*
* <pre>
* {@code
* {
Expand Down Expand Up @@ -2766,4 +2767,35 @@ public Mono<AgentVersionDetails> createAgentVersion(String agentName, AgentDefin
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
}

/**
* Create a new agent version.
*
* @param agentName The unique name that identifies the agent. Name can be used to retrieve/update/delete the agent.
* - Must start and end with alphanumeric characters,
* - Can contain hyphens in the middle
* - Must not exceed 63 characters.
* @param foundryFeatures A feature flag opt-in required when using preview operations or modifying persisted
* @param createAgentVersionInput The request body for creating an agent version, which includes the agent definition and optional metadata.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws HttpResponseException thrown if the request is rejected by server.
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response body on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AgentVersionDetails> createAgentVersion(String agentName, AgentDefinitionOptInKeys foundryFeatures,
CreateAgentVersionInput createAgentVersionInput) {
// Generated convenience method for createAgentVersionWithResponse
RequestOptions requestOptions = new RequestOptions();
BinaryData createAgentVersionRequest = BinaryData.fromObject(createAgentVersionInput);
if (foundryFeatures != null) {
requestOptions.setHeader(HttpHeaderName.fromString("Foundry-Features"), foundryFeatures.toString());
}
return createAgentVersionWithResponse(agentName, createAgentVersionRequest, requestOptions)
.flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(AgentVersionDetails.class));
}
}
Loading