diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs
index 9ca9276138fe..9ae3647578ff 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClient.cs
@@ -6,6 +6,7 @@
#nullable disable
using System;
+using System.Threading;
using Azure.Core;
using Azure.Core.Pipeline;
@@ -15,13 +16,10 @@ namespace Azure.AI.Projects
/// The AIProject service client.
public partial class AIProjectClient
{
- private static readonly string[] AuthorizationScopes = new string[] { "https://management.azure.com/.default" };
+ private static readonly string[] AuthorizationScopes = new string[] { "https://ai.azure.com/.default" };
private readonly TokenCredential _tokenCredential;
private readonly HttpPipeline _pipeline;
private readonly Uri _endpoint;
- private readonly string _subscriptionId;
- private readonly string _resourceGroupName;
- private readonly string _projectName;
/// The ClientDiagnostics is used to provide tracing support for the client library.
internal ClientDiagnostics ClientDiagnostics { get; }
@@ -30,55 +28,106 @@ public partial class AIProjectClient
public virtual HttpPipeline Pipeline => _pipeline;
/// Initializes a new instance of AIProjectClient.
- /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
- /// The Azure subscription ID.
- /// The name of the Azure Resource Group.
- /// The Azure AI Foundry project name.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
/// A credential used to authenticate to an Azure Service.
- /// , , , or is null.
- /// , or is an empty string, and was expected to be non-empty.
- public AIProjectClient(Uri endpoint, string subscriptionId, string resourceGroupName, string projectName, TokenCredential credential) : this(endpoint, subscriptionId, resourceGroupName, projectName, credential, new AIProjectClientOptions())
+ /// or is null.
+ public AIProjectClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AIProjectClientOptions())
{
}
- /// Initializes a new instance of AgentsClient.
+ /// Initializes a new instance of AIProjectClient.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// A credential used to authenticate to an Azure Service.
+ /// The options for configuring the client.
+ /// or is null.
+ public AIProjectClient(Uri endpoint, TokenCredential credential, AIProjectClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new AIProjectClientOptions();
+
+ ClientDiagnostics = new ClientDiagnostics(options, true);
+ _tokenCredential = credential;
+ _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier());
+ _endpoint = endpoint;
+ }
+
+ private ServicePatterns _cachedServicePatterns;
+
+ /// Initializes a new instance of ServicePatterns.
+ public virtual ServicePatterns GetServicePatternsClient()
+ {
+ return Volatile.Read(ref _cachedServicePatterns) ?? Interlocked.CompareExchange(ref _cachedServicePatterns, new ServicePatterns(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint), null) ?? _cachedServicePatterns;
+ }
+
+ /// Initializes a new instance of ConnectionsClient.
/// The API version to use for this operation.
/// is null.
- public virtual AgentsClient GetAgentsClient(string apiVersion = "2024-07-01-preview")
+ public virtual ConnectionsClient GetConnectionsClient(string apiVersion = "2025-05-15-preview")
{
Argument.AssertNotNull(apiVersion, nameof(apiVersion));
- return new AgentsClient(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _subscriptionId, _resourceGroupName, _projectName, apiVersion);
+ return new ConnectionsClient(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
}
- /// Initializes a new instance of ConnectionsClient.
+ /// Initializes a new instance of EvaluationsClient.
/// The API version to use for this operation.
/// is null.
- public virtual ConnectionsClient GetConnectionsClient(string apiVersion = "2024-07-01-preview")
+ public virtual EvaluationsClient GetEvaluationsClient(string apiVersion = "2025-05-15-preview")
{
Argument.AssertNotNull(apiVersion, nameof(apiVersion));
- return new ConnectionsClient(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _subscriptionId, _resourceGroupName, _projectName, apiVersion);
+ return new EvaluationsClient(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
}
- /// Initializes a new instance of TelemetryClient.
+ /// Initializes a new instance of Datasets.
/// The API version to use for this operation.
/// is null.
- public virtual TelemetryClient GetTelemetryClient(string apiVersion = "2024-07-01-preview")
+ public virtual Datasets GetDatasetsClient(string apiVersion = "2025-05-15-preview")
{
Argument.AssertNotNull(apiVersion, nameof(apiVersion));
- return new TelemetryClient(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _subscriptionId, _resourceGroupName, _projectName, apiVersion);
+ return new Datasets(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
}
- /// Initializes a new instance of EvaluationsClient.
+ /// Initializes a new instance of Indexes.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Indexes GetIndexesClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Indexes(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Deployments.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Deployments GetDeploymentsClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Deployments(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of RedTeams.
/// The API version to use for this operation.
/// is null.
- public virtual EvaluationsClient GetEvaluationsClient(string apiVersion = "2024-07-01-preview")
+ public virtual RedTeams GetRedTeamsClient(string apiVersion = "2025-05-15-preview")
{
Argument.AssertNotNull(apiVersion, nameof(apiVersion));
- return new EvaluationsClient(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, _subscriptionId, _resourceGroupName, _projectName, apiVersion);
+ return new RedTeams(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion);
}
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClientOptions.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClientOptions.cs
index ee91a3c1030c..bd7e9bf96efb 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClientOptions.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectClientOptions.cs
@@ -13,13 +13,15 @@ namespace Azure.AI.Projects
/// Client options for AIProjectClient.
public partial class AIProjectClientOptions : ClientOptions
{
- private const ServiceVersion LatestVersion = ServiceVersion.V2024_07_01_Preview;
+ private const ServiceVersion LatestVersion = ServiceVersion.V2025_05_15_Preview;
/// The version of the service to use.
public enum ServiceVersion
{
- /// Service version "2024-07-01-preview".
- V2024_07_01_Preview = 1,
+ /// Service version "2025-05-01".
+ V2025_05_01 = 1,
+ /// Service version "2025-05-15-preview".
+ V2025_05_15_Preview = 2,
}
internal string Version { get; }
@@ -29,7 +31,8 @@ public AIProjectClientOptions(ServiceVersion version = LatestVersion)
{
Version = version switch
{
- ServiceVersion.V2024_07_01_Preview => "2024-07-01-preview",
+ ServiceVersion.V2025_05_01 => "2025-05-01",
+ ServiceVersion.V2025_05_15_Preview => "2025-05-15-preview",
_ => throw new NotSupportedException()
};
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs
index acd83ee1a217..4e1d42a02a2f 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsClientBuilderExtensions.cs
@@ -16,14 +16,16 @@ public static partial class AIProjectsClientBuilderExtensions
{
/// Registers a instance.
/// The builder to register with.
- /// The Azure AI Foundry project endpoint, in the form `https://<azure-region>.api.azureml.ms` or `https://<private-link-guid>.<azure-region>.api.azureml.ms`, where <azure-region> is the Azure region where the project is deployed (e.g. westus) and <private-link-guid> is the GUID of the Enterprise private link.
- /// The Azure subscription ID.
- /// The name of the Azure Resource Group.
- /// The Azure AI Foundry project name.
- public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint, string subscriptionId, string resourceGroupName, string projectName)
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint)
where TBuilder : IAzureClientFactoryBuilderWithCredential
{
- return builder.RegisterClientFactory((options, cred) => new AIProjectClient(endpoint, subscriptionId, resourceGroupName, projectName, cred, options));
+ return builder.RegisterClientFactory((options, cred) => new AIProjectClient(endpoint, cred, options));
}
/// Registers a instance.
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
index 8d636f59179e..c14834a5d317 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AIProjectsModelFactory.cs
@@ -14,661 +14,85 @@ namespace Azure.AI.Projects
/// Model factory for models.
public static partial class AIProjectsModelFactory
{
- /// Initializes a new instance of .
- /// The type of binding, which is always 'storage_queue'.
- /// Storage queue.
- /// A new instance for mocking.
- public static AzureFunctionBinding AzureFunctionBinding(AzureFunctionBindingType type = default, AzureFunctionStorageQueue storageQueue = null)
- {
- return new AzureFunctionBinding(type, storageQueue, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Type.
- /// The JSON schema, describing response format.
- /// A new instance for mocking.
- public static ResponseFormatJsonSchemaType ResponseFormatJsonSchemaType(ResponseFormatJsonSchemaTypeType type = default, ResponseFormatJsonSchema jsonSchema = null)
- {
- return new ResponseFormatJsonSchemaType(type, jsonSchema, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- ///
- /// The role of the entity that is creating the message. Allowed values include:
- /// `user`, which indicates the message is sent by an actual user (and should be
- /// used in most cases to represent user-generated messages), and `assistant`,
- /// which indicates the message is generated by the agent (use this value to insert
- /// messages from the agent into the conversation).
- ///
- ///
- /// The content of the initial message. This may be a basic string (if you only
- /// need text) or an array of typed content blocks (for example, text, image_file,
- /// image_url, and so on).
+ /// Initializes a new instance of .
+ /// The friendly name of the connection, provided by the user.
+ /// A unique identifier for the connection, generated by the service.
+ /// Category of the connection.
+ /// The connection URL to be used for this service.
+ /// Whether the connection is tagged as the default connection of its type.
+ ///
+ /// The credentials used by the connection
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , , , and .
///
- /// A list of files attached to the message, and the tools they should be added to.
- /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
- /// A new instance for mocking.
- public static ThreadMessageOptions ThreadMessageOptions(MessageRole role = default, BinaryData content = null, IEnumerable attachments = null, IDictionary metadata = null)
+ /// Metadata of the connection.
+ /// A new instance for mocking.
+ public static Connection Connection(string name = null, string id = null, ConnectionType type = default, string target = null, bool isDefault = default, BaseCredentials credentials = null, IReadOnlyDictionary metadata = null)
{
- attachments ??= new List();
metadata ??= new Dictionary();
- return new ThreadMessageOptions(role, content, attachments?.ToList(), metadata, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The plain text content for this block.
- /// A new instance for mocking.
- public static MessageInputTextBlock MessageInputTextBlock(string text = null)
- {
- return new MessageInputTextBlock(MessageBlockType.Text, serializedAdditionalRawData: null, text);
- }
-
- /// Initializes a new instance of .
- /// Information about the referenced image file, including file ID and optional detail level.
- /// A new instance for mocking.
- public static MessageInputImageFileBlock MessageInputImageFileBlock(MessageImageFileParam imageFile = null)
- {
- return new MessageInputImageFileBlock(MessageBlockType.ImageFile, serializedAdditionalRawData: null, imageFile);
- }
-
- /// Initializes a new instance of .
- /// The ID of the previously uploaded image file.
- /// Optional detail level for the image (auto, low, or high).
- /// A new instance for mocking.
- public static MessageImageFileParam MessageImageFileParam(string fileId = null, ImageDetailLevel? detail = null)
- {
- return new MessageImageFileParam(fileId, detail, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Information about the external image URL, including the URL and optional detail level.
- /// A new instance for mocking.
- public static MessageInputImageUrlBlock MessageInputImageUrlBlock(MessageImageUrlParam imageUrl = null)
- {
- return new MessageInputImageUrlBlock(MessageBlockType.ImageUrl, serializedAdditionalRawData: null, imageUrl);
- }
-
- /// Initializes a new instance of .
- /// The publicly accessible URL of the external image.
- /// Optional detail level for the image (auto, low, or high). Defaults to 'auto' if not specified.
- /// A new instance for mocking.
- public static MessageImageUrlParam MessageImageUrlParam(string url = null, ImageDetailLevel? detail = null)
- {
- return new MessageImageUrlParam(url, detail, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The provided reason describing why the message was marked as incomplete.
- /// A new instance for mocking.
- public static MessageIncompleteDetails MessageIncompleteDetails(MessageIncompleteDetailsReason reason = default)
- {
- return new MessageIncompleteDetails(reason, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The object type.
- /// The textual content associated with this text annotation item.
- /// A new instance for mocking.
- public static MessageTextAnnotation MessageTextAnnotation(string type = null, string text = null)
- {
- return new UnknownMessageTextAnnotation(type, text, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The textual content associated with this text annotation item.
- /// The details of the URL citation.
- /// The first text index associated with this text annotation.
- /// The last text index associated with this text annotation.
- /// A new instance for mocking.
- public static MessageTextUrlCitationAnnotation MessageTextUrlCitationAnnotation(string text = null, MessageTextUrlCitationDetails urlCitation = null, int? startIndex = null, int? endIndex = null)
- {
- return new MessageTextUrlCitationAnnotation(
- "url_citation",
- text,
- serializedAdditionalRawData: null,
- urlCitation,
- startIndex,
- endIndex);
- }
-
- /// Initializes a new instance of .
- /// The URL associated with this citation.
- /// The title of the URL.
- /// A new instance for mocking.
- public static MessageTextUrlCitationDetails MessageTextUrlCitationDetails(string url = null, string title = null)
- {
- return new MessageTextUrlCitationDetails(url, title, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The object type.
- /// The ID of the tool call. This ID must be referenced when submitting tool outputs.
- /// A new instance for mocking.
- public static RequiredToolCall RequiredToolCall(string type = null, string id = null)
- {
- return new UnknownRequiredToolCall(type, serializedAdditionalRawData: null, id);
- }
-
- /// Initializes a new instance of .
- /// The status for the error.
- /// The human-readable text associated with the error.
- /// A new instance for mocking.
- public static RunError RunError(string code = null, string message = null)
- {
- return new RunError(code, message, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The reason why the run is incomplete. This indicates which specific token limit was reached during the run.
- /// A new instance for mocking.
- public static IncompleteRunDetails IncompleteRunDetails(IncompleteDetailsReason reason = default)
- {
- return new IncompleteRunDetails(reason, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Number of completion tokens used over the course of the run.
- /// Number of prompt tokens used over the course of the run.
- /// Total number of tokens used (prompt + completion).
- /// A new instance for mocking.
- public static RunCompletionUsage RunCompletionUsage(long completionTokens = default, long promptTokens = default, long totalTokens = default)
- {
- return new RunCompletionUsage(completionTokens, promptTokens, totalTokens, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Information about the message creation associated with this run step.
- /// A new instance for mocking.
- public static RunStepMessageCreationDetails RunStepMessageCreationDetails(RunStepMessageCreationReference messageCreation = null)
- {
- return new RunStepMessageCreationDetails(RunStepType.MessageCreation, serializedAdditionalRawData: null, messageCreation);
- }
-
- /// Initializes a new instance of .
- /// The ID of the message created by this run step.
- /// A new instance for mocking.
- public static RunStepMessageCreationReference RunStepMessageCreationReference(string messageId = null)
- {
- return new RunStepMessageCreationReference(messageId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- ///
- /// A list of tool call details for this run step.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , and .
- ///
- /// A new instance for mocking.
- public static RunStepToolCallDetails RunStepToolCallDetails(IEnumerable toolCalls = null)
- {
- toolCalls ??= new List();
-
- return new RunStepToolCallDetails(RunStepType.ToolCalls, serializedAdditionalRawData: null, toolCalls?.ToList());
- }
-
- /// Initializes a new instance of .
- /// The object type.
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// A new instance for mocking.
- public static RunStepToolCall RunStepToolCall(string type = null, string id = null)
- {
- return new UnknownRunStepToolCall(type, id, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The serialized log output emitted by the code interpreter.
- /// A new instance for mocking.
- public static RunStepCodeInterpreterLogOutput RunStepCodeInterpreterLogOutput(string logs = null)
- {
- return new RunStepCodeInterpreterLogOutput("logs", serializedAdditionalRawData: null, logs);
- }
-
- /// Initializes a new instance of .
- /// Referential information for the image associated with this output.
- /// A new instance for mocking.
- public static RunStepCodeInterpreterImageOutput RunStepCodeInterpreterImageOutput(RunStepCodeInterpreterImageReference image = null)
- {
- return new RunStepCodeInterpreterImageOutput("image", serializedAdditionalRawData: null, image);
- }
-
- /// Initializes a new instance of .
- /// The ID of the file associated with this image.
- /// A new instance for mocking.
- public static RunStepCodeInterpreterImageReference RunStepCodeInterpreterImageReference(string fileId = null)
- {
- return new RunStepCodeInterpreterImageReference(fileId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// For now, this is always going to be an empty object.
- /// A new instance for mocking.
- public static RunStepFileSearchToolCall RunStepFileSearchToolCall(string id = null, RunStepFileSearchToolCallResults fileSearch = null)
- {
- return new RunStepFileSearchToolCall("file_search", id, serializedAdditionalRawData: null, fileSearch);
- }
-
- /// Initializes a new instance of .
- /// Ranking options for file search.
- /// The array of a file search results.
- /// A new instance for mocking.
- public static RunStepFileSearchToolCallResults RunStepFileSearchToolCallResults(FileSearchRankingOptions rankingOptions = null, IEnumerable results = null)
- {
- results ??= new List();
-
- return new RunStepFileSearchToolCallResults(rankingOptions, results?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The ID of the file that result was found in.
- /// The name of the file that result was found in.
- /// The score of the result. All values must be a floating point number between 0 and 1.
- /// The content of the result that was found. The content is only included if requested via the include query parameter.
- /// A new instance for mocking.
- public static RunStepFileSearchToolCallResult RunStepFileSearchToolCallResult(string fileId = null, string fileName = null, float score = default, IEnumerable content = null)
- {
- content ??= new List();
-
- return new RunStepFileSearchToolCallResult(fileId, fileName, score, content?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The type of the content.
- /// The text content of the file.
- /// A new instance for mocking.
- public static FileSearchToolCallContent FileSearchToolCallContent(FileSearchToolCallContentType type = default, string text = null)
- {
- return new FileSearchToolCallContent(type, text, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepBingGroundingToolCall RunStepBingGroundingToolCall(string id = null, IReadOnlyDictionary bingGrounding = null)
- {
- bingGrounding ??= new Dictionary();
-
- return new RunStepBingGroundingToolCall("bing_grounding", id, serializedAdditionalRawData: null, bingGrounding);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepAzureAISearchToolCall RunStepAzureAISearchToolCall(string id = null, IReadOnlyDictionary azureAISearch = null)
- {
- azureAISearch ??= new Dictionary();
-
- return new RunStepAzureAISearchToolCall("azure_ai_search", id, serializedAdditionalRawData: null, azureAISearch);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepSharepointToolCall RunStepSharepointToolCall(string id = null, IReadOnlyDictionary sharePoint = null)
- {
- sharePoint ??= new Dictionary();
-
- return new RunStepSharepointToolCall("sharepoint_grounding", id, serializedAdditionalRawData: null, sharePoint);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepMicrosoftFabricToolCall RunStepMicrosoftFabricToolCall(string id = null, IReadOnlyDictionary microsoftFabric = null)
- {
- microsoftFabric ??= new Dictionary();
-
- return new RunStepMicrosoftFabricToolCall("fabric_dataagent", id, serializedAdditionalRawData: null, microsoftFabric);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepCustomSearchToolCall RunStepCustomSearchToolCall(string id = null, IReadOnlyDictionary bingCustomSearch = null)
- {
- bingCustomSearch ??= new Dictionary();
-
- return new RunStepCustomSearchToolCall("bing_custom_search", id, serializedAdditionalRawData: null, bingCustomSearch);
- }
-
- /// Initializes a new instance of .
- /// The ID of the tool call. This ID must be referenced when you submit tool outputs.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepOpenAPIToolCall RunStepOpenAPIToolCall(string id = null, IReadOnlyDictionary openAPI = null)
- {
- openAPI ??= new Dictionary();
-
- return new RunStepOpenAPIToolCall("openapi", id, serializedAdditionalRawData: null, openAPI);
- }
-
- /// Initializes a new instance of .
- /// The error code for this error.
- /// The human-readable text associated with this error.
- /// A new instance for mocking.
- public static RunStepError RunStepError(RunStepErrorCode code = default, string message = null)
- {
- return new RunStepError(code, message, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Number of completion tokens used over the course of the run step.
- /// Number of prompt tokens used over the course of the run step.
- /// Total number of tokens used (prompt + completion).
- /// A new instance for mocking.
- public static RunStepCompletionUsage RunStepCompletionUsage(long completionTokens = default, long promptTokens = default, long totalTokens = default)
- {
- return new RunStepCompletionUsage(completionTokens, promptTokens, totalTokens, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The object type, which is always list.
- /// The requested list of items.
- /// The first ID represented in this list.
- /// The last ID represented in this list.
- /// A value indicating whether there are additional values available not captured in this list.
- /// A new instance for mocking.
- public static AgentPageableListOfVectorStore AgentPageableListOfVectorStore(AgentPageableListOfVectorStoreObject @object = default, IEnumerable data = null, string firstId = null, string lastId = null, bool hasMore = default)
- {
- data ??= new List();
-
- return new AgentPageableListOfVectorStore(
- @object,
- data?.ToList(),
- firstId,
- lastId,
- hasMore,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The identifier, which can be referenced in API endpoints.
- /// The object type, which is always `vector_store`.
- /// The Unix timestamp (in seconds) for when the vector store was created.
- /// The name of the vector store.
- /// The total number of bytes used by the files in the vector store.
- /// Files count grouped by status processed or being processed by this vector store.
- /// The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use.
- /// Details on when this vector store expires.
- /// The Unix timestamp (in seconds) for when the vector store will expire.
- /// The Unix timestamp (in seconds) for when the vector store was last active.
- /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
- /// A new instance for mocking.
- public static VectorStore VectorStore(string id = null, VectorStoreObject @object = default, DateTimeOffset createdAt = default, string name = null, int usageBytes = default, VectorStoreFileCount fileCounts = null, VectorStoreStatus status = default, VectorStoreExpirationPolicy expiresAfter = null, DateTimeOffset? expiresAt = null, DateTimeOffset? lastActiveAt = null, IReadOnlyDictionary metadata = null)
- {
- metadata ??= new Dictionary();
-
- return new VectorStore(
- id,
- @object,
- createdAt,
+ return new Connection(
name,
- usageBytes,
- fileCounts,
- status,
- expiresAfter,
- expiresAt,
- lastActiveAt,
- metadata,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The number of files that are currently being processed.
- /// The number of files that have been successfully processed.
- /// The number of files that have failed to process.
- /// The number of files that were cancelled.
- /// The total number of files.
- /// A new instance for mocking.
- public static VectorStoreFileCount VectorStoreFileCount(int inProgress = default, int completed = default, int failed = default, int cancelled = default, int total = default)
- {
- return new VectorStoreFileCount(
- inProgress,
- completed,
- failed,
- cancelled,
- total,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The options for the static chunking strategy.
- /// A new instance for mocking.
- public static VectorStoreStaticChunkingStrategyRequest VectorStoreStaticChunkingStrategyRequest(VectorStoreStaticChunkingStrategyOptions @static = null)
- {
- return new VectorStoreStaticChunkingStrategyRequest(VectorStoreChunkingStrategyRequestType.Static, serializedAdditionalRawData: null, @static);
- }
-
- /// Initializes a new instance of .
- /// The ID of the resource specified for deletion.
- /// A value indicating whether deletion was successful.
- /// The object type, which is always 'vector_store.deleted'.
- /// A new instance for mocking.
- public static VectorStoreDeletionStatus VectorStoreDeletionStatus(string id = null, bool deleted = default, VectorStoreDeletionStatusObject @object = default)
- {
- return new VectorStoreDeletionStatus(id, deleted, @object, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The object type, which is always list.
- /// The requested list of items.
- /// The first ID represented in this list.
- /// The last ID represented in this list.
- /// A value indicating whether there are additional values available not captured in this list.
- /// A new instance for mocking.
- public static AgentPageableListOfVectorStoreFile AgentPageableListOfVectorStoreFile(AgentPageableListOfVectorStoreFileObject @object = default, IEnumerable data = null, string firstId = null, string lastId = null, bool hasMore = default)
- {
- data ??= new List();
-
- return new AgentPageableListOfVectorStoreFile(
- @object,
- data?.ToList(),
- firstId,
- lastId,
- hasMore,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The identifier, which can be referenced in API endpoints.
- /// The object type, which is always `vector_store.file`.
- ///
- /// The total vector store usage in bytes. Note that this may be different from the original file
- /// size.
- ///
- /// The Unix timestamp (in seconds) for when the vector store file was created.
- /// The ID of the vector store that the file is attached to.
- /// The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use.
- /// The last error associated with this vector store file. Will be `null` if there are no errors.
- ///
- /// The strategy used to chunk the file.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// A new instance for mocking.
- public static VectorStoreFile VectorStoreFile(string id = null, VectorStoreFileObject @object = default, int usageBytes = default, DateTimeOffset createdAt = default, string vectorStoreId = null, VectorStoreFileStatus status = default, VectorStoreFileError lastError = null, VectorStoreChunkingStrategyResponse chunkingStrategy = null)
- {
- return new VectorStoreFile(
id,
- @object,
- usageBytes,
- createdAt,
- vectorStoreId,
- status,
- lastError,
- chunkingStrategy,
- serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// One of `server_error` or `rate_limit_exceeded`.
- /// A human-readable description of the error.
- /// A new instance for mocking.
- public static VectorStoreFileError VectorStoreFileError(VectorStoreFileErrorCode code = default, string message = null)
- {
- return new VectorStoreFileError(code, message, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The options for the static chunking strategy.
- /// A new instance for mocking.
- public static VectorStoreStaticChunkingStrategyResponse VectorStoreStaticChunkingStrategyResponse(VectorStoreStaticChunkingStrategyOptions @static = null)
- {
- return new VectorStoreStaticChunkingStrategyResponse(VectorStoreChunkingStrategyResponseType.Static, serializedAdditionalRawData: null, @static);
- }
-
- /// Initializes a new instance of .
- /// The ID of the resource specified for deletion.
- /// A value indicating whether deletion was successful.
- /// The object type, which is always 'vector_store.deleted'.
- /// A new instance for mocking.
- public static VectorStoreFileDeletionStatus VectorStoreFileDeletionStatus(string id = null, bool deleted = default, VectorStoreFileDeletionStatusObject @object = default)
- {
- return new VectorStoreFileDeletionStatus(id, deleted, @object, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The identifier, which can be referenced in API endpoints.
- /// The object type, which is always `vector_store.file_batch`.
- /// The Unix timestamp (in seconds) for when the vector store files batch was created.
- /// The ID of the vector store that the file is attached to.
- /// The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`.
- /// Files count grouped by status processed or being processed by this vector store.
- /// A new instance for mocking.
- public static VectorStoreFileBatch VectorStoreFileBatch(string id = null, VectorStoreFileBatchObject @object = default, DateTimeOffset createdAt = default, string vectorStoreId = null, VectorStoreFileBatchStatus status = default, VectorStoreFileCount fileCounts = null)
- {
- return new VectorStoreFileBatch(
- id,
- @object,
- createdAt,
- vectorStoreId,
- status,
- fileCounts,
+ type,
+ target,
+ isDefault,
+ credentials,
+ metadata,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// A unique identifier for the resource.
- /// The name of the resource.
- /// The properties of the resource.
- /// A new instance for mocking.
- public static GetWorkspaceResponse GetWorkspaceResponse(string id = null, string name = null, WorkspaceProperties properties = null)
- {
- return new GetWorkspaceResponse(id, name, properties, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Authentication type of the connection target.
- /// A new instance for mocking.
- public static WorkspaceProperties WorkspaceProperties(string applicationInsights = null)
+ /// Initializes a new instance of .
+ /// API Key.
+ /// A new instance for mocking.
+ public static ApiKeyCredentials ApiKeyCredentials(string apiKey = null)
{
- return new WorkspaceProperties(applicationInsights, serializedAdditionalRawData: null);
+ return new ApiKeyCredentials(CredentialType.ApiKey, serializedAdditionalRawData: null, apiKey);
}
- /// Initializes a new instance of .
- /// A list of connection list secrets.
- /// A new instance for mocking.
- public static ListConnectionsResponse ListConnectionsResponse(IEnumerable value = null)
+ /// Initializes a new instance of .
+ /// The credential type.
+ /// A new instance for mocking.
+ public static CustomCredential CustomCredential(IReadOnlyDictionary keys = null)
{
- value ??= new List();
+ keys ??= new Dictionary();
- return new ListConnectionsResponse(value?.ToList(), serializedAdditionalRawData: null);
+ return new CustomCredential(CredentialType.Custom, serializedAdditionalRawData: null, keys);
}
- /// Initializes a new instance of .
- /// A unique identifier for the connection.
- /// The name of the resource.
- ///
- /// The properties of the resource
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , and .
- ///
- /// A new instance for mocking.
- public static ConnectionResponse ConnectionResponse(string id = null, string name = null, ConnectionProperties properties = null)
+ /// Initializes a new instance of .
+ /// SAS token.
+ /// A new instance for mocking.
+ public static SASCredentials SASCredentials(string sasToken = null)
{
- return new ConnectionResponse(id, name, properties, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Category of the connection.
- /// The connection URL to be used for this service.
- /// A new instance for mocking.
- public static ConnectionProperties ConnectionProperties(ConnectionType category = default, string target = null)
- {
- return new UnknownInternalConnectionProperties(default, category, target, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Category of the connection.
- /// The connection URL to be used for this service.
- /// Credentials will only be present for authType=ApiKey.
- /// A new instance for mocking.
- public static ConnectionPropertiesApiKeyAuth ConnectionPropertiesApiKeyAuth(ConnectionType category = default, string target = null, CredentialsApiKeyAuth credentials = null)
- {
- return new ConnectionPropertiesApiKeyAuth(AuthenticationType.ApiKey, category, target, serializedAdditionalRawData: null, credentials);
- }
-
- /// Initializes a new instance of .
- /// The API key.
- /// A new instance for mocking.
- public static CredentialsApiKeyAuth CredentialsApiKeyAuth(string key = null)
- {
- return new CredentialsApiKeyAuth(key, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Category of the connection.
- /// The connection URL to be used for this service.
- /// A new instance for mocking.
- public static InternalConnectionPropertiesCustomAuth InternalConnectionPropertiesCustomAuth(ConnectionType category = default, string target = null)
- {
- return new InternalConnectionPropertiesCustomAuth(AuthenticationType.Custom, category, target, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Category of the connection.
- /// The connection URL to be used for this service.
- /// A new instance for mocking.
- public static InternalConnectionPropertiesNoAuth InternalConnectionPropertiesNoAuth(ConnectionType category = default, string target = null)
- {
- return new InternalConnectionPropertiesNoAuth(AuthenticationType.None, category, target, serializedAdditionalRawData: null);
+ return new SASCredentials(CredentialType.SAS, serializedAdditionalRawData: null, sasToken);
}
/// Initializes a new instance of .
- /// Identifier of the evaluation.
+ /// Identifier of the evaluation.
///
/// Data for evaluation.
/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
+ /// The available derived classes include .
///
- /// Evaluation target specifying the model config and parameters.
/// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique.
/// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
- /// Metadata containing createdBy and modifiedBy information.
/// Status of the evaluation. It is set by service and is read-only.
/// Evaluation's tags. Unlike properties, tags are fully mutable.
/// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.
/// Evaluators to be used for the evaluation.
/// A new instance for mocking.
- public static Evaluation Evaluation(string id = null, InputData data = null, EvaluationTarget target = null, string displayName = null, string description = null, SystemData systemData = null, string status = null, IDictionary tags = null, IDictionary properties = null, IDictionary evaluators = null)
+ public static Evaluation Evaluation(string name = null, InputData data = null, string displayName = null, string description = null, string status = null, IDictionary tags = null, IDictionary properties = null, IDictionary evaluators = null)
{
tags ??= new Dictionary();
properties ??= new Dictionary();
evaluators ??= new Dictionary();
return new Evaluation(
- id,
+ name,
data,
- target,
displayName,
description,
- systemData,
status,
tags,
properties,
@@ -676,370 +100,393 @@ public static Evaluation Evaluation(string id = null, InputData data = null, Eva
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The timestamp the resource was created at.
- /// The identity that created the resource.
- /// The identity type that created the resource.
- /// The timestamp of resource last modification (UTC).
- /// A new instance for mocking.
- public static SystemData SystemData(DateTimeOffset? createdAt = null, string createdBy = null, string createdByType = null, DateTimeOffset? lastModifiedAt = null)
- {
- return new SystemData(createdAt, createdBy, createdByType, lastModifiedAt, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Name of the schedule, which also serves as the unique identifier for the evaluation.
- /// Data for evaluation.
- /// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable.
- /// Metadata containing createdBy and modifiedBy information.
- /// Provisioning State of the evaluation. It is set by service and is read-only.
- /// Evaluation's tags. Unlike properties, tags are fully mutable.
- /// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.
- /// Enabled status of the evaluation. It is set by service and is read-only.
+ /// Initializes a new instance of .
+ /// Identifier of the agent run.
+ /// Identifier of the agent thread. This field is mandatory currently, but it will be optional in the future.
/// Evaluators to be used for the evaluation.
- ///
- /// Trigger for the evaluation.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// A new instance for mocking.
- public static EvaluationSchedule EvaluationSchedule(string name = null, ApplicationInsightsConfiguration data = null, string description = null, SystemData systemData = null, string provisioningState = null, IDictionary tags = null, IDictionary properties = null, string isEnabled = null, IDictionary evaluators = null, Trigger trigger = null)
+ /// Sampling configuration for the evaluation.
+ /// Redaction configuration for the evaluation.
+ /// Pass the AppInsights connection string to the agent evaluation for the evaluation results and the errors logs.
+ /// A new instance for mocking.
+ public static AgentEvaluationRequest AgentEvaluationRequest(string runId = null, string threadId = null, IDictionary evaluators = null, AgentEvaluationSamplingConfiguration samplingConfiguration = null, AgentEvaluationRedactionConfiguration redactionConfiguration = null, string appInsightsConnectionString = null)
{
- tags ??= new Dictionary();
- properties ??= new Dictionary();
evaluators ??= new Dictionary();
- return new EvaluationSchedule(
- name,
- data,
- description,
- systemData,
- provisioningState,
- tags,
- properties,
- isEnabled,
+ return new AgentEvaluationRequest(
+ runId,
+ threadId,
evaluators,
- trigger,
+ samplingConfiguration,
+ redactionConfiguration,
+ appInsightsConnectionString,
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The identifier of the message, which can be referenced in API endpoints.
- /// The object type, which is always `thread.message.delta`.
- /// The delta containing the fields that have changed on the Message.
- /// A new instance for mocking.
- public static MessageDeltaChunk MessageDeltaChunk(string id = null, MessageDeltaChunkObject @object = default, MessageDelta delta = null)
- {
- return new MessageDeltaChunk(id, @object, delta, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The entity that produced the message.
- ///
- /// The content of the message as an array of text and/or images.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// A new instance for mocking.
- public static MessageDelta MessageDelta(MessageRole role = default, IEnumerable content = null)
+ /// Initializes a new instance of .
+ /// Identifier of the agent evaluation run.
+ /// Status of the agent evaluation. Options: Running, Completed, Failed.
+ /// The reason of the request failure for the long running process, if applicable.
+ /// The agent evaluation result.
+ /// A new instance for mocking.
+ public static AgentEvaluation AgentEvaluation(string id = null, string status = null, string error = null, IEnumerable result = null)
{
- content ??= new List();
+ result ??= new List();
- return new MessageDelta(role, content?.ToList(), serializedAdditionalRawData: null);
+ return new AgentEvaluation(id, status, error, result?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The type of content for this content part.
- /// A new instance for mocking.
- public static MessageDeltaContent MessageDeltaContent(int index = default, string type = null)
+ /// Initializes a new instance of .
+ /// Evaluator's name. This is the name of the evaluator that was used to evaluate the agent's completion.
+ /// Identifier of the evaluator.
+ /// Score of the given evaluator. No restriction on range.
+ /// Status of the evaluator result. Options: Running, Completed, Failed, NotApplicable.
+ /// Reasoning for the evaluation result.
+ /// Version of the evaluator that was used to evaluate the agent's completion.
+ /// The unique identifier of the thread.
+ /// The unique identifier of the run.
+ /// A string explaining why there was an error, if applicable.
+ /// Additional properties relevant to the evaluator. These will differ between evaluators.
+ /// A new instance for mocking.
+ public static AgentEvaluationResult AgentEvaluationResult(string evaluator = null, string evaluatorId = null, float score = default, string status = null, string reason = null, string version = null, string threadId = null, string runId = null, string error = null, IReadOnlyDictionary additionalDetails = null)
{
- return new UnknownMessageDeltaContent(index, type, serializedAdditionalRawData: null);
- }
+ additionalDetails ??= new Dictionary();
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The image_file data.
- /// A new instance for mocking.
- public static MessageDeltaImageFileContent MessageDeltaImageFileContent(int index = default, MessageDeltaImageFileContentObject imageFile = null)
- {
- return new MessageDeltaImageFileContent(index, "image_file", serializedAdditionalRawData: null, imageFile);
+ return new AgentEvaluationResult(
+ evaluator,
+ evaluatorId,
+ score,
+ status,
+ reason,
+ version,
+ threadId,
+ runId,
+ error,
+ additionalDetails,
+ serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The file ID of the image in the message content.
- /// A new instance for mocking.
- public static MessageDeltaImageFileContentObject MessageDeltaImageFileContentObject(string fileId = null)
+ /// Initializes a new instance of .
+ /// URI of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// Dataset type.
+ /// Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted.
+ /// The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset.
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// A new instance for mocking.
+ public static DatasetVersion DatasetVersion(string dataUri = null, string type = null, bool? isReference = null, string connectionName = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
{
- return new MessageDeltaImageFileContentObject(fileId, serializedAdditionalRawData: null);
- }
+ tags ??= new Dictionary();
- /// Initializes a new instance of .
- /// The index of the content part of the message.
- /// The text content details.
- /// A new instance for mocking.
- public static MessageDeltaTextContent MessageDeltaTextContent(int index = default, MessageDeltaTextContentObject text = null)
- {
- return new MessageDeltaTextContent(index, "text", serializedAdditionalRawData: null, text);
+ return new UnknownDatasetVersion(
+ dataUri,
+ type == null ? default : new DatasetType(type),
+ isReference,
+ connectionName,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The data that makes up the text.
- ///
- /// Annotations for the text.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , and .
- ///
- /// A new instance for mocking.
- public static MessageDeltaTextContentObject MessageDeltaTextContentObject(string value = null, IEnumerable annotations = null)
+ /// Initializes a new instance of .
+ /// URI of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted.
+ /// The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset.
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// A new instance for mocking.
+ public static FileDatasetVersion FileDatasetVersion(string dataUri = null, bool? isReference = null, string connectionName = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
{
- annotations ??= new List();
+ tags ??= new Dictionary();
- return new MessageDeltaTextContentObject(value, annotations?.ToList(), serializedAdditionalRawData: null);
+ return new FileDatasetVersion(
+ dataUri,
+ DatasetType.UriFile,
+ isReference,
+ connectionName,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The type of the text content annotation.
- /// A new instance for mocking.
- public static MessageDeltaTextAnnotation MessageDeltaTextAnnotation(int index = default, string type = null)
+ /// Initializes a new instance of .
+ /// URI of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// Indicates if the dataset holds a reference to the storage, or the dataset manages storage itself. If true, the underlying data will not be deleted when the dataset version is deleted.
+ /// The Azure Storage Account connection name. Required if startPendingUploadVersion was not called before creating the Dataset.
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// A new instance for mocking.
+ public static FolderDatasetVersion FolderDatasetVersion(string dataUri = null, bool? isReference = null, string connectionName = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
{
- return new UnknownMessageDeltaTextAnnotation(index, type, serializedAdditionalRawData: null);
- }
+ tags ??= new Dictionary();
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The details of the URL citation.
- /// The first text index associated with this text annotation.
- /// The last text index associated with this text annotation.
- /// A new instance for mocking.
- public static MessageDeltaTextUrlCitationAnnotation MessageDeltaTextUrlCitationAnnotation(int index = default, MessageDeltaTextUrlCitationDetails urlCitation = null, int? startIndex = null, int? endIndex = null)
- {
- return new MessageDeltaTextUrlCitationAnnotation(
- index,
- "url_citation",
- serializedAdditionalRawData: null,
- urlCitation,
- startIndex,
- endIndex);
+ return new FolderDatasetVersion(
+ dataUri,
+ DatasetType.UriFolder,
+ isReference,
+ connectionName,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The URL associated with this citation.
- /// The title of the URL.
- /// A new instance for mocking.
- public static MessageDeltaTextUrlCitationDetails MessageDeltaTextUrlCitationDetails(string url = null, string title = null)
+ /// Initializes a new instance of .
+ /// If PendingUploadId is not provided, a random GUID will be used.
+ /// Azure Storage Account connection name to use for generating temporary SAS token.
+ /// BlobReference is the only supported type.
+ /// A new instance for mocking.
+ public static PendingUploadRequest PendingUploadRequest(string pendingUploadId = null, string connectionName = null, PendingUploadType pendingUploadType = default)
{
- return new MessageDeltaTextUrlCitationDetails(url, title, serializedAdditionalRawData: null);
+ return new PendingUploadRequest(pendingUploadId, connectionName, pendingUploadType, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The file citation information.
- /// The text in the message content that needs to be replaced.
- /// The start index of this annotation in the content text.
- /// The end index of this annotation in the content text.
- /// A new instance for mocking.
- public static MessageDeltaTextFileCitationAnnotation MessageDeltaTextFileCitationAnnotation(int index = default, MessageDeltaTextFileCitationAnnotationObject fileCitation = null, string text = null, int? startIndex = null, int? endIndex = null)
+ /// Initializes a new instance of .
+ /// Container-level read, write, list SAS.
+ /// ID for this upload request.
+ /// Version of asset to be created if user did not specify version when initially creating upload.
+ /// BlobReference is the only supported type.
+ /// A new instance for mocking.
+ public static PendingUploadResponse PendingUploadResponse(BlobReference blobReference = null, string pendingUploadId = null, string version = null, PendingUploadType pendingUploadType = default)
{
- return new MessageDeltaTextFileCitationAnnotation(
- index,
- "file_citation",
- serializedAdditionalRawData: null,
- fileCitation,
- text,
- startIndex,
- endIndex);
+ return new PendingUploadResponse(blobReference, pendingUploadId, version, pendingUploadType, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The ID of the specific file the citation is from.
- /// The specific quote in the cited file.
- /// A new instance for mocking.
- public static MessageDeltaTextFileCitationAnnotationObject MessageDeltaTextFileCitationAnnotationObject(string fileId = null, string quote = null)
+ /// Initializes a new instance of .
+ /// Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path.
+ /// ARM ID of the storage account to use.
+ /// Credential info to access the storage account.
+ /// A new instance for mocking.
+ public static BlobReference BlobReference(string blobUri = null, string storageAccountArmId = null, SasCredential credential = null)
{
- return new MessageDeltaTextFileCitationAnnotationObject(fileId, quote, serializedAdditionalRawData: null);
+ return new BlobReference(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The index of the annotation within a text content part.
- /// The file path information.
- /// The start index of this annotation in the content text.
- /// The end index of this annotation in the content text.
- /// The text in the message content that needs to be replaced.
- /// A new instance for mocking.
- public static MessageDeltaTextFilePathAnnotation MessageDeltaTextFilePathAnnotation(int index = default, MessageDeltaTextFilePathAnnotationObject filePath = null, int? startIndex = null, int? endIndex = null, string text = null)
+ /// Initializes a new instance of .
+ /// SAS uri.
+ /// Type of credential.
+ /// A new instance for mocking.
+ public static SasCredential SasCredential(string sasUri = null, SasCredentialType type = default)
{
- return new MessageDeltaTextFilePathAnnotation(
- index,
- "file_path",
- serializedAdditionalRawData: null,
- filePath,
- startIndex,
- endIndex,
- text);
+ return new SasCredential(sasUri, type, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The file ID for the annotation.
- /// A new instance for mocking.
- public static MessageDeltaTextFilePathAnnotationObject MessageDeltaTextFilePathAnnotationObject(string fileId = null)
+ /// Initializes a new instance of .
+ /// Credential info to access the storage account.
+ /// A new instance for mocking.
+ public static AssetCredentialResponse AssetCredentialResponse(BlobReference blobReference = null)
{
- return new MessageDeltaTextFilePathAnnotationObject(fileId, serializedAdditionalRawData: null);
+ return new AssetCredentialResponse(blobReference, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The identifier of the run step, which can be referenced in API endpoints.
- /// The object type, which is always `thread.run.step.delta`.
- /// The delta containing the fields that have changed on the run step.
- /// A new instance for mocking.
- public static RunStepDeltaChunk RunStepDeltaChunk(string id = null, RunStepDeltaChunkObject @object = default, RunStepDelta delta = null)
+ /// Initializes a new instance of .
+ /// Type of index.
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// A new instance for mocking.
+ public static Index Index(string type = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
{
- return new RunStepDeltaChunk(id, @object, delta, serializedAdditionalRawData: null);
- }
+ tags ??= new Dictionary();
- /// Initializes a new instance of .
- ///
- /// The details of the run step.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
- ///
- /// A new instance for mocking.
- public static RunStepDelta RunStepDelta(RunStepDeltaDetail stepDetails = null)
- {
- return new RunStepDelta(stepDetails, serializedAdditionalRawData: null);
+ return new UnknownIndex(
+ type == null ? default : new IndexType(type),
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The message creation data.
- /// A new instance for mocking.
- public static RunStepDeltaMessageCreation RunStepDeltaMessageCreation(RunStepDeltaMessageCreationObject messageCreation = null)
+ /// Initializes a new instance of .
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// Name of connection to Azure AI Search.
+ /// Name of index in Azure AI Search resource to attach.
+ /// Field mapping configuration.
+ /// A new instance for mocking.
+ public static AzureAISearchIndex AzureAISearchIndex(string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string connectionName = null, string indexName = null, FieldMapping fieldMapping = null)
{
- return new RunStepDeltaMessageCreation("message_creation", serializedAdditionalRawData: null, messageCreation);
- }
+ tags ??= new Dictionary();
- /// Initializes a new instance of .
- /// The ID of the newly-created message.
- /// A new instance for mocking.
- public static RunStepDeltaMessageCreationObject RunStepDeltaMessageCreationObject(string messageId = null)
- {
- return new RunStepDeltaMessageCreationObject(messageId, serializedAdditionalRawData: null);
+ return new AzureAISearchIndex(
+ IndexType.AzureSearch,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ connectionName,
+ indexName,
+ fieldMapping);
}
- /// Initializes a new instance of .
- ///
- /// The collection of tool calls for the tool call detail item.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , and .
- ///
- /// A new instance for mocking.
- public static RunStepDeltaToolCallObject RunStepDeltaToolCallObject(IEnumerable toolCalls = null)
+ /// Initializes a new instance of .
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// Vector store id of managed index.
+ /// A new instance for mocking.
+ public static ManagedAzureAISearchIndex ManagedAzureAISearchIndex(string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string vectorStoreId = null)
{
- toolCalls ??= new List();
+ tags ??= new Dictionary();
- return new RunStepDeltaToolCallObject("tool_calls", serializedAdditionalRawData: null, toolCalls?.ToList());
+ return new ManagedAzureAISearchIndex(
+ IndexType.ManagedAzureSearch,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ vectorStoreId);
}
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// The type of the tool call detail item in a streaming run step's details.
- /// A new instance for mocking.
- public static RunStepDeltaToolCall RunStepDeltaToolCall(int index = default, string id = null, string type = null)
+ /// Initializes a new instance of .
+ /// Asset ID, a unique identifier for the asset.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// Name of connection to CosmosDB.
+ /// Name of the CosmosDB Database.
+ /// Name of CosmosDB Container.
+ /// Embedding model configuration.
+ /// Field mapping configuration.
+ /// A new instance for mocking.
+ public static CosmosDBIndex CosmosDBIndex(string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string connectionName = null, string databaseName = null, string containerName = null, EmbeddingConfiguration embeddingConfiguration = null, FieldMapping fieldMapping = null)
{
- return new UnknownRunStepDeltaToolCall(index, id, type, serializedAdditionalRawData: null);
- }
+ tags ??= new Dictionary();
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// The function data for the tool call.
- /// A new instance for mocking.
- public static RunStepDeltaFunctionToolCall RunStepDeltaFunctionToolCall(int index = default, string id = null, RunStepDeltaFunction function = null)
- {
- return new RunStepDeltaFunctionToolCall(index, id, "function", serializedAdditionalRawData: null, function);
+ return new CosmosDBIndex(
+ IndexType.CosmosDB,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ connectionName,
+ databaseName,
+ containerName,
+ embeddingConfiguration,
+ fieldMapping);
}
- /// Initializes a new instance of .
- /// The name of the function.
- /// The arguments passed to the function as input.
- /// The output of the function, null if outputs have not yet been submitted.
- /// A new instance for mocking.
- public static RunStepDeltaFunction RunStepDeltaFunction(string name = null, string arguments = null, string output = null)
+ /// Initializes a new instance of .
+ /// The type of the deployment.
+ /// Name of the deployment.
+ /// A new instance for mocking.
+ public static Deployment Deployment(string type = null, string name = null)
{
- return new RunStepDeltaFunction(name, arguments, output, serializedAdditionalRawData: null);
+ return new UnknownDeployment(type == null ? default : new DeploymentType(type), name, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// Reserved for future use.
- /// A new instance for mocking.
- public static RunStepDeltaFileSearchToolCall RunStepDeltaFileSearchToolCall(int index = default, string id = null, RunStepFileSearchToolCallResults fileSearch = null)
+ /// Initializes a new instance of .
+ /// Name of the deployment.
+ /// Publisher-specific name of the deployed model.
+ /// Publisher-specific version of the deployed model.
+ /// Name of the deployed model's publisher.
+ /// Capabilities of deployed model.
+ /// Sku of the model deployment.
+ /// Name of the connection the deployment comes from.
+ /// A new instance for mocking.
+ public static ModelDeployment ModelDeployment(string name = null, string modelName = null, string modelVersion = null, string modelPublisher = null, IReadOnlyDictionary capabilities = null, Sku sku = null, string connectionName = null)
{
- return new RunStepDeltaFileSearchToolCall(index, id, "file_search", serializedAdditionalRawData: null, fileSearch);
- }
+ capabilities ??= new Dictionary();
- /// Initializes a new instance of .
- /// The index of the tool call detail in the run step's tool_calls array.
- /// The ID of the tool call, used when submitting outputs to the run.
- /// The Code Interpreter data for the tool call.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterToolCall RunStepDeltaCodeInterpreterToolCall(int index = default, string id = null, RunStepDeltaCodeInterpreterDetailItemObject codeInterpreter = null)
- {
- return new RunStepDeltaCodeInterpreterToolCall(index, id, "code_interpreter", serializedAdditionalRawData: null, codeInterpreter);
+ return new ModelDeployment(
+ DeploymentType.ModelDeployment,
+ name,
+ serializedAdditionalRawData: null,
+ modelName,
+ modelVersion,
+ modelPublisher,
+ capabilities,
+ sku,
+ connectionName);
+ }
+
+ /// Initializes a new instance of .
+ /// Sku capacity.
+ /// Sku family.
+ /// Sku name.
+ /// Sku size.
+ /// Sku tier.
+ /// A new instance for mocking.
+ public static Sku Sku(long capacity = default, string family = null, string name = null, string size = null, string tier = null)
+ {
+ return new Sku(
+ capacity,
+ family,
+ name,
+ size,
+ tier,
+ serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The input into the Code Interpreter tool call.
- ///
- /// The outputs from the Code Interpreter tool call. Code Interpreter can output one or more
- /// items, including text (`logs`) or images (`image`). Each of these are represented by a
- /// different object type.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include and .
+ /// Initializes a new instance of .
+ /// Identifier of the red team run.
+ /// Name of the red-team run.
+ /// Number of simulation rounds.
+ /// List of attack strategies or nested lists of attack strategies.
+ /// Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result.
+ /// List of risk categories to generate attack objectives for.
+ /// Application scenario for the red team operation, to generate scenario specific attacks.
+ /// Red team's tags. Unlike properties, tags are fully mutable.
+ /// Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.
+ /// Status of the red-team. It is set by service and is read-only.
+ ///
+ /// Target configuration for the red-team run.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
///
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterDetailItemObject RunStepDeltaCodeInterpreterDetailItemObject(string input = null, IEnumerable outputs = null)
- {
- outputs ??= new List();
-
- return new RunStepDeltaCodeInterpreterDetailItemObject(input, outputs?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the output in the streaming run step tool call's Code Interpreter outputs array.
- /// The type of the streaming run step tool call's Code Interpreter output.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterOutput RunStepDeltaCodeInterpreterOutput(int index = default, string type = null)
- {
- return new UnknownRunStepDeltaCodeInterpreterOutput(index, type, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The index of the output in the streaming run step tool call's Code Interpreter outputs array.
- /// The text output from the Code Interpreter tool call.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterLogOutput RunStepDeltaCodeInterpreterLogOutput(int index = default, string logs = null)
+ /// A new instance for mocking.
+ public static RedTeam RedTeam(string name = null, string displayName = null, int? numTurns = null, IEnumerable attackStrategies = null, bool? simulationOnly = null, IEnumerable riskCategories = null, string applicationScenario = null, IDictionary tags = null, IDictionary properties = null, string status = null, TargetConfig target = null)
{
- return new RunStepDeltaCodeInterpreterLogOutput(index, "logs", serializedAdditionalRawData: null, logs);
- }
-
- /// Initializes a new instance of .
- /// The index of the output in the streaming run step tool call's Code Interpreter outputs array.
- /// The image data for the Code Interpreter tool call output.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterImageOutput RunStepDeltaCodeInterpreterImageOutput(int index = default, RunStepDeltaCodeInterpreterImageOutputObject image = null)
- {
- return new RunStepDeltaCodeInterpreterImageOutput(index, "image", serializedAdditionalRawData: null, image);
- }
+ attackStrategies ??= new List();
+ riskCategories ??= new List();
+ tags ??= new Dictionary();
+ properties ??= new Dictionary();
- /// Initializes a new instance of .
- /// The file ID for the image.
- /// A new instance for mocking.
- public static RunStepDeltaCodeInterpreterImageOutputObject RunStepDeltaCodeInterpreterImageOutputObject(string fileId = null)
- {
- return new RunStepDeltaCodeInterpreterImageOutputObject(fileId, serializedAdditionalRawData: null);
+ return new RedTeam(
+ name,
+ displayName,
+ numTurns,
+ attackStrategies?.ToList(),
+ simulationOnly,
+ riskCategories?.ToList(),
+ applicationScenario,
+ tags,
+ properties,
+ status,
+ target,
+ serializedAdditionalRawData: null);
}
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AISearchIndexResource.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AISearchIndexResource.Serialization.cs
deleted file mode 100644
index 8d9aa0b28e52..000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AISearchIndexResource.Serialization.cs
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class AISearchIndexResource : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AISearchIndexResource)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("index_connection_id"u8);
- writer.WriteStringValue(IndexConnectionId);
- writer.WritePropertyName("index_name"u8);
- writer.WriteStringValue(IndexName);
- if (Optional.IsDefined(QueryType))
- {
- writer.WritePropertyName("query_type"u8);
- writer.WriteStringValue(QueryType.Value.ToString());
- }
- if (Optional.IsDefined(TopK))
- {
- writer.WritePropertyName("top_k"u8);
- writer.WriteNumberValue(TopK.Value);
- }
- if (Optional.IsDefined(Filter))
- {
- writer.WritePropertyName("filter"u8);
- writer.WriteStringValue(Filter);
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- AISearchIndexResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AISearchIndexResource)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAISearchIndexResource(document.RootElement, options);
- }
-
- internal static AISearchIndexResource DeserializeAISearchIndexResource(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string indexConnectionId = default;
- string indexName = default;
- AzureAISearchQueryType? queryType = default;
- int? topK = default;
- string filter = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("index_connection_id"u8))
- {
- indexConnectionId = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("index_name"u8))
- {
- indexName = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("query_type"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- queryType = new AzureAISearchQueryType(property.Value.GetString());
- continue;
- }
- if (property.NameEquals("top_k"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- topK = property.Value.GetInt32();
- continue;
- }
- if (property.NameEquals("filter"u8))
- {
- filter = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AISearchIndexResource(
- indexConnectionId,
- indexName,
- queryType,
- topK,
- filter,
- serializedAdditionalRawData);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options, AzureAIProjectsContext.Default);
- default:
- throw new FormatException($"The model {nameof(AISearchIndexResource)} does not support writing '{options.Format}' format.");
- }
- }
-
- AISearchIndexResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAISearchIndexResource(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AISearchIndexResource)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static AISearchIndexResource FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAISearchIndexResource(document.RootElement);
- }
-
- /// Convert into a .
- internal virtual RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AISearchIndexResource.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AISearchIndexResource.cs
deleted file mode 100644
index 3958defefe9b..000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AISearchIndexResource.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// A AI Search Index resource.
- public partial class AISearchIndexResource
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// An index connection id in an IndexResource attached to this agent.
- /// The name of an index in an IndexResource attached to this agent.
- /// or is null.
- public AISearchIndexResource(string indexConnectionId, string indexName)
- {
- Argument.AssertNotNull(indexConnectionId, nameof(indexConnectionId));
- Argument.AssertNotNull(indexName, nameof(indexName));
-
- IndexConnectionId = indexConnectionId;
- IndexName = indexName;
- }
-
- /// Initializes a new instance of .
- /// An index connection id in an IndexResource attached to this agent.
- /// The name of an index in an IndexResource attached to this agent.
- /// Type of query in an AIIndexResource attached to this agent.
- /// Number of documents to retrieve from search and present to the model.
- /// Odata filter string for search resource.
- /// Keeps track of any properties unknown to the library.
- internal AISearchIndexResource(string indexConnectionId, string indexName, AzureAISearchQueryType? queryType, int? topK, string filter, IDictionary serializedAdditionalRawData)
- {
- IndexConnectionId = indexConnectionId;
- IndexName = indexName;
- QueryType = queryType;
- TopK = topK;
- Filter = filter;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AISearchIndexResource()
- {
- }
-
- /// An index connection id in an IndexResource attached to this agent.
- public string IndexConnectionId { get; set; }
- /// The name of an index in an IndexResource attached to this agent.
- public string IndexName { get; set; }
- /// Type of query in an AIIndexResource attached to this agent.
- public AzureAISearchQueryType? QueryType { get; set; }
- /// Number of documents to retrieve from search and present to the model.
- public int? TopK { get; set; }
- /// Odata filter string for search resource.
- public string Filter { get; set; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.Serialization.cs
deleted file mode 100644
index 6c8eee6cc2a9..000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.Serialization.cs
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class AOAIModelConfig : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AOAIModelConfig)} does not support writing '{format}' format.");
- }
-
- base.JsonModelWriteCore(writer, options);
- writer.WritePropertyName("azureEndpoint"u8);
- writer.WriteStringValue(AzureEndpoint);
- writer.WritePropertyName("apiKey"u8);
- writer.WriteStringValue(ApiKey);
- writer.WritePropertyName("azureDeployment"u8);
- writer.WriteStringValue(AzureDeployment);
- }
-
- AOAIModelConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(AOAIModelConfig)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAOAIModelConfig(document.RootElement, options);
- }
-
- internal static AOAIModelConfig DeserializeAOAIModelConfig(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string azureEndpoint = default;
- string apiKey = default;
- string azureDeployment = default;
- string type = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("azureEndpoint"u8))
- {
- azureEndpoint = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("apiKey"u8))
- {
- apiKey = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("azureDeployment"u8))
- {
- azureDeployment = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = property.Value.GetString();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new AOAIModelConfig(type, serializedAdditionalRawData, azureEndpoint, apiKey, azureDeployment);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options, AzureAIProjectsContext.Default);
- default:
- throw new FormatException($"The model {nameof(AOAIModelConfig)} does not support writing '{options.Format}' format.");
- }
- }
-
- AOAIModelConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAOAIModelConfig(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(AOAIModelConfig)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static new AOAIModelConfig FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAOAIModelConfig(document.RootElement);
- }
-
- /// Convert into a .
- internal override RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.cs
deleted file mode 100644
index 1983a0c90b7b..000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AOAIModelConfig.cs
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-
-namespace Azure.AI.Projects
-{
- /// Azure OpenAI model configuration. The API version would be selected by the service for querying the model.
- public partial class AOAIModelConfig : TargetModelConfig
- {
- /// Initializes a new instance of .
- /// Endpoint targetURI for AOAI model.
- /// API Key for AOAI model.
- /// Deployment name for AOAI model.
- /// , or is null.
- public AOAIModelConfig(string azureEndpoint, string apiKey, string azureDeployment)
- {
- Argument.AssertNotNull(azureEndpoint, nameof(azureEndpoint));
- Argument.AssertNotNull(apiKey, nameof(apiKey));
- Argument.AssertNotNull(azureDeployment, nameof(azureDeployment));
-
- Type = "AOAI";
- AzureEndpoint = azureEndpoint;
- ApiKey = apiKey;
- AzureDeployment = azureDeployment;
- }
-
- /// Initializes a new instance of .
- /// Type of the model configuration.
- /// Keeps track of any properties unknown to the library.
- /// Endpoint targetURI for AOAI model.
- /// API Key for AOAI model.
- /// Deployment name for AOAI model.
- internal AOAIModelConfig(string type, IDictionary serializedAdditionalRawData, string azureEndpoint, string apiKey, string azureDeployment) : base(type, serializedAdditionalRawData)
- {
- AzureEndpoint = azureEndpoint;
- ApiKey = apiKey;
- AzureDeployment = azureDeployment;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AOAIModelConfig()
- {
- }
-
- /// Endpoint targetURI for AOAI model.
- public string AzureEndpoint { get; set; }
- /// API Key for AOAI model.
- public string ApiKey { get; set; }
- /// Deployment name for AOAI model.
- public string AzureDeployment { get; set; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.Serialization.cs
deleted file mode 100644
index 71f87c864b7a..000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.Serialization.cs
+++ /dev/null
@@ -1,379 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Text.Json;
-using Azure.Core;
-
-namespace Azure.AI.Projects
-{
- public partial class Agent : IUtf8JsonSerializable, IJsonModel
- {
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
-
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- writer.WriteStartObject();
- JsonModelWriteCore(writer, options);
- writer.WriteEndObject();
- }
-
- /// The JSON writer.
- /// The client options for reading and writing models.
- protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(Agent)} does not support writing '{format}' format.");
- }
-
- writer.WritePropertyName("id"u8);
- writer.WriteStringValue(Id);
- writer.WritePropertyName("object"u8);
- writer.WriteStringValue(Object);
- writer.WritePropertyName("created_at"u8);
- writer.WriteNumberValue(CreatedAt, "U");
- if (Name != null)
- {
- writer.WritePropertyName("name"u8);
- writer.WriteStringValue(Name);
- }
- else
- {
- writer.WriteNull("name");
- }
- if (Description != null)
- {
- writer.WritePropertyName("description"u8);
- writer.WriteStringValue(Description);
- }
- else
- {
- writer.WriteNull("description");
- }
- writer.WritePropertyName("model"u8);
- writer.WriteStringValue(Model);
- if (Instructions != null)
- {
- writer.WritePropertyName("instructions"u8);
- writer.WriteStringValue(Instructions);
- }
- else
- {
- writer.WriteNull("instructions");
- }
- writer.WritePropertyName("tools"u8);
- writer.WriteStartArray();
- foreach (var item in Tools)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
- if (ToolResources != null)
- {
- writer.WritePropertyName("tool_resources"u8);
- writer.WriteObjectValue(ToolResources, options);
- }
- else
- {
- writer.WriteNull("tool_resources");
- }
- if (Temperature != null)
- {
- writer.WritePropertyName("temperature"u8);
- writer.WriteNumberValue(Temperature.Value);
- }
- else
- {
- writer.WriteNull("temperature");
- }
- if (TopP != null)
- {
- writer.WritePropertyName("top_p"u8);
- writer.WriteNumberValue(TopP.Value);
- }
- else
- {
- writer.WriteNull("top_p");
- }
- if (Optional.IsDefined(ResponseFormat))
- {
- if (ResponseFormat != null)
- {
- writer.WritePropertyName("response_format"u8);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(ResponseFormat);
-#else
- using (JsonDocument document = JsonDocument.Parse(ResponseFormat, ModelSerializationExtensions.JsonDocumentOptions))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- else
- {
- writer.WriteNull("response_format");
- }
- }
- if (Metadata != null && Optional.IsCollectionDefined(Metadata))
- {
- writer.WritePropertyName("metadata"u8);
- writer.WriteStartObject();
- foreach (var item in Metadata)
- {
- writer.WritePropertyName(item.Key);
- writer.WriteStringValue(item.Value);
- }
- writer.WriteEndObject();
- }
- else
- {
- writer.WriteNull("metadata");
- }
- if (options.Format != "W" && _serializedAdditionalRawData != null)
- {
- foreach (var item in _serializedAdditionalRawData)
- {
- writer.WritePropertyName(item.Key);
-#if NET6_0_OR_GREATER
- writer.WriteRawValue(item.Value);
-#else
- using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- Agent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(Agent)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAgent(document.RootElement, options);
- }
-
- internal static Agent DeserializeAgent(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- string id = default;
- string @object = default;
- DateTimeOffset createdAt = default;
- string name = default;
- string description = default;
- string model = default;
- string instructions = default;
- IReadOnlyList tools = default;
- ToolResources toolResources = default;
- float? temperature = default;
- float? topP = default;
- BinaryData responseFormat = default;
- IReadOnlyDictionary metadata = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("id"u8))
- {
- id = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("object"u8))
- {
- @object = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("created_at"u8))
- {
- createdAt = DateTimeOffset.FromUnixTimeSeconds(property.Value.GetInt64());
- continue;
- }
- if (property.NameEquals("name"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- name = null;
- continue;
- }
- name = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("description"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- description = null;
- continue;
- }
- description = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("model"u8))
- {
- model = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("instructions"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- instructions = null;
- continue;
- }
- instructions = property.Value.GetString();
- continue;
- }
- if (property.NameEquals("tools"u8))
- {
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
- {
- array.Add(ToolDefinition.DeserializeToolDefinition(item, options));
- }
- tools = array;
- continue;
- }
- if (property.NameEquals("tool_resources"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- toolResources = null;
- continue;
- }
- toolResources = ToolResources.DeserializeToolResources(property.Value, options);
- continue;
- }
- if (property.NameEquals("temperature"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- temperature = null;
- continue;
- }
- temperature = property.Value.GetSingle();
- continue;
- }
- if (property.NameEquals("top_p"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- topP = null;
- continue;
- }
- topP = property.Value.GetSingle();
- continue;
- }
- if (property.NameEquals("response_format"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- responseFormat = null;
- continue;
- }
- responseFormat = BinaryData.FromString(property.Value.GetRawText());
- continue;
- }
- if (property.NameEquals("metadata"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- metadata = new ChangeTrackingDictionary();
- continue;
- }
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, property0.Value.GetString());
- }
- metadata = dictionary;
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new Agent(
- id,
- @object,
- createdAt,
- name,
- description,
- model,
- instructions,
- tools,
- toolResources,
- temperature,
- topP,
- responseFormat,
- metadata,
- serializedAdditionalRawData);
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options, AzureAIProjectsContext.Default);
- default:
- throw new FormatException($"The model {nameof(Agent)} does not support writing '{options.Format}' format.");
- }
- }
-
- Agent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAgent(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(Agent)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
-
- /// Deserializes the model from a raw response.
- /// The response to deserialize the model from.
- internal static Agent FromResponse(Response response)
- {
- using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAgent(document.RootElement);
- }
-
- /// Convert into a .
- internal virtual RequestContent ToRequestContent()
- {
- var content = new Utf8JsonRequestContent();
- content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
- return content;
- }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs b/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs
deleted file mode 100644
index e3dca8de0f79..000000000000
--- a/sdk/ai/Azure.AI.Projects/src/Generated/Agent.cs
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Azure.AI.Projects
-{
- /// Represents an agent that can call the model and use tools.
- public partial class Agent
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The identifier, which can be referenced in API endpoints.
- /// The Unix timestamp, in seconds, representing when this object was created.
- /// The name of the agent.
- /// The description of the agent.
- /// The ID of the model to use.
- /// The system instructions for the agent to use.
- ///
- /// The collection of tools enabled for the agent.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , , , and .
- ///
- ///
- /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter`
- /// tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
- ///
- ///
- /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,
- /// while lower values like 0.2 will make it more focused and deterministic.
- ///
- ///
- /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- /// So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- ///
- /// We generally recommend altering this or temperature but not both.
- ///
- /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
- /// , or is null.
- internal Agent(string id, DateTimeOffset createdAt, string name, string description, string model, string instructions, IEnumerable tools, ToolResources toolResources, float? temperature, float? topP, IReadOnlyDictionary metadata)
- {
- Argument.AssertNotNull(id, nameof(id));
- Argument.AssertNotNull(model, nameof(model));
- Argument.AssertNotNull(tools, nameof(tools));
-
- Id = id;
- CreatedAt = createdAt;
- Name = name;
- Description = description;
- Model = model;
- Instructions = instructions;
- Tools = tools.ToList();
- ToolResources = toolResources;
- Temperature = temperature;
- TopP = topP;
- Metadata = metadata;
- }
-
- /// Initializes a new instance of .
- /// The identifier, which can be referenced in API endpoints.
- /// The object type, which is always assistant.
- /// The Unix timestamp, in seconds, representing when this object was created.
- /// The name of the agent.
- /// The description of the agent.
- /// The ID of the model to use.
- /// The system instructions for the agent to use.
- ///
- /// The collection of tools enabled for the agent.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , , , and .
- ///
- ///
- /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter`
- /// tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
- ///
- ///
- /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,
- /// while lower values like 0.2 will make it more focused and deterministic.
- ///
- ///
- /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- /// So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- ///
- /// We generally recommend altering this or temperature but not both.
- ///
- /// The response format of the tool calls used by this agent.
- /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
- /// Keeps track of any properties unknown to the library.
- internal Agent(string id, string @object, DateTimeOffset createdAt, string name, string description, string model, string instructions, IReadOnlyList tools, ToolResources toolResources, float? temperature, float? topP, BinaryData responseFormat, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData)
- {
- Id = id;
- Object = @object;
- CreatedAt = createdAt;
- Name = name;
- Description = description;
- Model = model;
- Instructions = instructions;
- Tools = tools;
- ToolResources = toolResources;
- Temperature = temperature;
- TopP = topP;
- ResponseFormat = responseFormat;
- Metadata = metadata;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal Agent()
- {
- }
-
- /// The identifier, which can be referenced in API endpoints.
- public string Id { get; }
-
- /// The Unix timestamp, in seconds, representing when this object was created.
- public DateTimeOffset CreatedAt { get; }
- /// The name of the agent.
- public string Name { get; }
- /// The description of the agent.
- public string Description { get; }
- /// The ID of the model to use.
- public string Model { get; }
- /// The system instructions for the agent to use.
- public string Instructions { get; }
- ///
- /// The collection of tools enabled for the agent.
- /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
- /// The available derived classes include , , , , , , , , , and .
- ///
- public IReadOnlyList Tools { get; }
- ///
- /// A set of resources that are used by the agent's tools. The resources are specific to the type of tool. For example, the `code_interpreter`
- /// tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs.
- ///
- public ToolResources ToolResources { get; }
- ///
- /// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random,
- /// while lower values like 0.2 will make it more focused and deterministic.
- ///
- public float? Temperature { get; }
- ///
- /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
- /// So 0.1 means only the tokens comprising the top 10% probability mass are considered.
- ///
- /// We generally recommend altering this or temperature but not both.
- ///
- public float? TopP { get; }
- ///
- /// The response format of the tool calls used by this agent.
- ///
- /// To assign an object to this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- ///
- /// Supported types:
- ///
- /// -
- ///
- ///
- /// -
- ///
- ///
- /// -
- ///
- ///
- /// -
- ///
- ///
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- public BinaryData ResponseFormat { get; }
- /// A set of up to 16 key/value pairs that can be attached to an object, used for storing additional information about that object in a structured format. Keys may be up to 64 characters in length and values may be up to 512 characters in length.
- public IReadOnlyDictionary Metadata { get; }
- }
-}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluation.Serialization.cs
similarity index 57%
rename from sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs
rename to sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluation.Serialization.cs
index 8660b0da04b6..c940e64139e4 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/MessageDeltaTextContentObject.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluation.Serialization.cs
@@ -13,11 +13,11 @@
namespace Azure.AI.Projects
{
- public partial class MessageDeltaTextContentObject : IUtf8JsonSerializable, IJsonModel
+ public partial class AgentEvaluation : IUtf8JsonSerializable, IJsonModel
{
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStartObject();
JsonModelWriteCore(writer, options);
@@ -28,22 +28,26 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode
/// The client options for reading and writing models.
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support writing '{format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluation)} does not support writing '{format}' format.");
}
- if (Optional.IsDefined(Value))
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ writer.WritePropertyName("status"u8);
+ writer.WriteStringValue(Status);
+ if (Optional.IsDefined(Error))
{
- writer.WritePropertyName("value"u8);
- writer.WriteStringValue(Value);
+ writer.WritePropertyName("error"u8);
+ writer.WriteStringValue(Error);
}
- if (Optional.IsCollectionDefined(Annotations))
+ if (Optional.IsCollectionDefined(Result))
{
- writer.WritePropertyName("annotations"u8);
+ writer.WritePropertyName("result"u8);
writer.WriteStartArray();
- foreach (var item in Annotations)
+ foreach (var item in Result)
{
writer.WriteObjectValue(item, options);
}
@@ -66,19 +70,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
}
}
- MessageDeltaTextContentObject IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ AgentEvaluation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support reading '{format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluation)} does not support reading '{format}' format.");
}
using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeMessageDeltaTextContentObject(document.RootElement, options);
+ return DeserializeAgentEvaluation(document.RootElement, options);
}
- internal static MessageDeltaTextContentObject DeserializeMessageDeltaTextContentObject(JsonElement element, ModelReaderWriterOptions options = null)
+ internal static AgentEvaluation DeserializeAgentEvaluation(JsonElement element, ModelReaderWriterOptions options = null)
{
options ??= ModelSerializationExtensions.WireOptions;
@@ -86,29 +90,41 @@ internal static MessageDeltaTextContentObject DeserializeMessageDeltaTextContent
{
return null;
}
- string value = default;
- IReadOnlyList annotations = default;
+ string id = default;
+ string status = default;
+ string error = default;
+ IReadOnlyList result = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
{
- if (property.NameEquals("value"u8))
+ if (property.NameEquals("id"u8))
{
- value = property.Value.GetString();
+ id = property.Value.GetString();
continue;
}
- if (property.NameEquals("annotations"u8))
+ if (property.NameEquals("status"u8))
+ {
+ status = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("error"u8))
+ {
+ error = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("result"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- List array = new List();
+ List array = new List();
foreach (var item in property.Value.EnumerateArray())
{
- array.Add(MessageDeltaTextAnnotation.DeserializeMessageDeltaTextAnnotation(item, options));
+ array.Add(AgentEvaluationResult.DeserializeAgentEvaluationResult(item, options));
}
- annotations = array;
+ result = array;
continue;
}
if (options.Format != "W")
@@ -117,46 +133,46 @@ internal static MessageDeltaTextContentObject DeserializeMessageDeltaTextContent
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new MessageDeltaTextContentObject(value, annotations ?? new ChangeTrackingList(), serializedAdditionalRawData);
+ return new AgentEvaluation(id, status, error, result ?? new ChangeTrackingList(), serializedAdditionalRawData);
}
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
return ModelReaderWriter.Write(this, options, AzureAIProjectsContext.Default);
default:
- throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support writing '{options.Format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluation)} does not support writing '{options.Format}' format.");
}
}
- MessageDeltaTextContentObject IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ AgentEvaluation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
{
using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeMessageDeltaTextContentObject(document.RootElement, options);
+ return DeserializeAgentEvaluation(document.RootElement, options);
}
default:
- throw new FormatException($"The model {nameof(MessageDeltaTextContentObject)} does not support reading '{options.Format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluation)} does not support reading '{options.Format}' format.");
}
}
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
/// Deserializes the model from a raw response.
/// The response to deserialize the model from.
- internal static MessageDeltaTextContentObject FromResponse(Response response)
+ internal static AgentEvaluation FromResponse(Response response)
{
using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeMessageDeltaTextContentObject(document.RootElement);
+ return DeserializeAgentEvaluation(document.RootElement);
}
/// Convert into a .
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluation.cs
similarity index 51%
rename from sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs
rename to sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluation.cs
index 1782ede5ac86..445a1ff982f7 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AzureFunctionStorageQueue.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluation.cs
@@ -10,8 +10,8 @@
namespace Azure.AI.Projects
{
- /// The structure for keeping storage queue name and URI.
- public partial class AzureFunctionStorageQueue
+ /// Evaluation response for agent evaluation run.
+ public partial class AgentEvaluation
{
///
/// Keeps track of any properties unknown to the library.
@@ -45,38 +45,47 @@ public partial class AzureFunctionStorageQueue
///
private IDictionary _serializedAdditionalRawData;
- /// Initializes a new instance of .
- /// URI to the Azure Storage Queue service allowing you to manipulate a queue.
- /// The name of an Azure function storage queue.
- /// or is null.
- public AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName)
+ /// Initializes a new instance of .
+ /// Identifier of the agent evaluation run.
+ /// Status of the agent evaluation. Options: Running, Completed, Failed.
+ /// or is null.
+ internal AgentEvaluation(string id, string status)
{
- Argument.AssertNotNull(storageServiceEndpoint, nameof(storageServiceEndpoint));
- Argument.AssertNotNull(queueName, nameof(queueName));
+ Argument.AssertNotNull(id, nameof(id));
+ Argument.AssertNotNull(status, nameof(status));
- StorageServiceEndpoint = storageServiceEndpoint;
- QueueName = queueName;
+ Id = id;
+ Status = status;
+ Result = new ChangeTrackingList();
}
- /// Initializes a new instance of .
- /// URI to the Azure Storage Queue service allowing you to manipulate a queue.
- /// The name of an Azure function storage queue.
+ /// Initializes a new instance of .
+ /// Identifier of the agent evaluation run.
+ /// Status of the agent evaluation. Options: Running, Completed, Failed.
+ /// The reason of the request failure for the long running process, if applicable.
+ /// The agent evaluation result.
/// Keeps track of any properties unknown to the library.
- internal AzureFunctionStorageQueue(string storageServiceEndpoint, string queueName, IDictionary serializedAdditionalRawData)
+ internal AgentEvaluation(string id, string status, string error, IReadOnlyList result, IDictionary serializedAdditionalRawData)
{
- StorageServiceEndpoint = storageServiceEndpoint;
- QueueName = queueName;
+ Id = id;
+ Status = status;
+ Error = error;
+ Result = result;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
- /// Initializes a new instance of for deserialization.
- internal AzureFunctionStorageQueue()
+ /// Initializes a new instance of for deserialization.
+ internal AgentEvaluation()
{
}
- /// URI to the Azure Storage Queue service allowing you to manipulate a queue.
- public string StorageServiceEndpoint { get; set; }
- /// The name of an Azure function storage queue.
- public string QueueName { get; set; }
+ /// Identifier of the agent evaluation run.
+ public string Id { get; }
+ /// Status of the agent evaluation. Options: Running, Completed, Failed.
+ public string Status { get; }
+ /// The reason of the request failure for the long running process, if applicable.
+ public string Error { get; }
+ /// The agent evaluation result.
+ public IReadOnlyList Result { get; }
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoice.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRedactionConfiguration.Serialization.cs
similarity index 60%
rename from sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoice.Serialization.cs
rename to sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRedactionConfiguration.Serialization.cs
index 2d1ecc9338c6..33d799d4dc50 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsNamedToolChoice.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRedactionConfiguration.Serialization.cs
@@ -13,11 +13,11 @@
namespace Azure.AI.Projects
{
- public partial class AgentsNamedToolChoice : IUtf8JsonSerializable, IJsonModel
+ public partial class AgentEvaluationRedactionConfiguration : IUtf8JsonSerializable, IJsonModel
{
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStartObject();
JsonModelWriteCore(writer, options);
@@ -28,18 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW
/// The client options for reading and writing models.
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(AgentsNamedToolChoice)} does not support writing '{format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRedactionConfiguration)} does not support writing '{format}' format.");
}
- writer.WritePropertyName("type"u8);
- writer.WriteStringValue(Type.ToString());
- if (Optional.IsDefined(Function))
+ if (Optional.IsDefined(RedactScoreProperties))
{
- writer.WritePropertyName("function"u8);
- writer.WriteObjectValue(Function, options);
+ writer.WritePropertyName("redactScoreProperties"u8);
+ writer.WriteBooleanValue(RedactScoreProperties.Value);
}
if (options.Format != "W" && _serializedAdditionalRawData != null)
{
@@ -58,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
}
}
- AgentsNamedToolChoice IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ AgentEvaluationRedactionConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(AgentsNamedToolChoice)} does not support reading '{format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRedactionConfiguration)} does not support reading '{format}' format.");
}
using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeAgentsNamedToolChoice(document.RootElement, options);
+ return DeserializeAgentEvaluationRedactionConfiguration(document.RootElement, options);
}
- internal static AgentsNamedToolChoice DeserializeAgentsNamedToolChoice(JsonElement element, ModelReaderWriterOptions options = null)
+ internal static AgentEvaluationRedactionConfiguration DeserializeAgentEvaluationRedactionConfiguration(JsonElement element, ModelReaderWriterOptions options = null)
{
options ??= ModelSerializationExtensions.WireOptions;
@@ -78,24 +76,18 @@ internal static AgentsNamedToolChoice DeserializeAgentsNamedToolChoice(JsonEleme
{
return null;
}
- AgentsNamedToolChoiceType type = default;
- FunctionName function = default;
+ bool? redactScoreProperties = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
{
- if (property.NameEquals("type"u8))
- {
- type = new AgentsNamedToolChoiceType(property.Value.GetString());
- continue;
- }
- if (property.NameEquals("function"u8))
+ if (property.NameEquals("redactScoreProperties"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- function = FunctionName.DeserializeFunctionName(property.Value, options);
+ redactScoreProperties = property.Value.GetBoolean();
continue;
}
if (options.Format != "W")
@@ -104,46 +96,46 @@ internal static AgentsNamedToolChoice DeserializeAgentsNamedToolChoice(JsonEleme
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new AgentsNamedToolChoice(type, function, serializedAdditionalRawData);
+ return new AgentEvaluationRedactionConfiguration(redactScoreProperties, serializedAdditionalRawData);
}
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
return ModelReaderWriter.Write(this, options, AzureAIProjectsContext.Default);
default:
- throw new FormatException($"The model {nameof(AgentsNamedToolChoice)} does not support writing '{options.Format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRedactionConfiguration)} does not support writing '{options.Format}' format.");
}
}
- AgentsNamedToolChoice IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ AgentEvaluationRedactionConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
{
using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAgentsNamedToolChoice(document.RootElement, options);
+ return DeserializeAgentEvaluationRedactionConfiguration(document.RootElement, options);
}
default:
- throw new FormatException($"The model {nameof(AgentsNamedToolChoice)} does not support reading '{options.Format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRedactionConfiguration)} does not support reading '{options.Format}' format.");
}
}
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
/// Deserializes the model from a raw response.
/// The response to deserialize the model from.
- internal static AgentsNamedToolChoice FromResponse(Response response)
+ internal static AgentEvaluationRedactionConfiguration FromResponse(Response response)
{
using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializeAgentsNamedToolChoice(document.RootElement);
+ return DeserializeAgentEvaluationRedactionConfiguration(document.RootElement);
}
/// Convert into a .
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRedactionConfiguration.cs
similarity index 69%
rename from sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs
rename to sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRedactionConfiguration.cs
index b481792951e0..29f07516faca 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/AgentsApiResponseFormat.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRedactionConfiguration.cs
@@ -10,11 +10,8 @@
namespace Azure.AI.Projects
{
- ///
- /// An object describing the expected output of the model. If `json_object` only `function` type `tools` are allowed to be passed to the Run.
- /// If `text` the model can return text or any value needed.
- ///
- public partial class AgentsApiResponseFormat
+ /// The redaction configuration will allow the user to control what is redacted.
+ public partial class AgentEvaluationRedactionConfiguration
{
///
/// Keeps track of any properties unknown to the library.
@@ -48,21 +45,21 @@ public partial class AgentsApiResponseFormat
///
private IDictionary _serializedAdditionalRawData;
- /// Initializes a new instance of .
- public AgentsApiResponseFormat()
+ /// Initializes a new instance of .
+ public AgentEvaluationRedactionConfiguration()
{
}
- /// Initializes a new instance of .
- /// Must be one of `text` or `json_object`.
+ /// Initializes a new instance of .
+ /// Redact score properties. If not specified, the default is to redact in production.
/// Keeps track of any properties unknown to the library.
- internal AgentsApiResponseFormat(ResponseFormat? type, IDictionary serializedAdditionalRawData)
+ internal AgentEvaluationRedactionConfiguration(bool? redactScoreProperties, IDictionary serializedAdditionalRawData)
{
- Type = type;
+ RedactScoreProperties = redactScoreProperties;
_serializedAdditionalRawData = serializedAdditionalRawData;
}
- /// Must be one of `text` or `json_object`.
- public ResponseFormat? Type { get; set; }
+ /// Redact score properties. If not specified, the default is to redact in production.
+ public bool? RedactScoreProperties { get; set; }
}
}
diff --git a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.Serialization.cs b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRequest.Serialization.cs
similarity index 50%
rename from sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.Serialization.cs
rename to sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRequest.Serialization.cs
index e1e8d6e5aa33..ca242f61c9a6 100644
--- a/sdk/ai/Azure.AI.Projects/src/Generated/FileSearchToolResource.Serialization.cs
+++ b/sdk/ai/Azure.AI.Projects/src/Generated/AgentEvaluationRequest.Serialization.cs
@@ -13,11 +13,11 @@
namespace Azure.AI.Projects
{
- public partial class FileSearchToolResource : IUtf8JsonSerializable, IJsonModel
+ public partial class AgentEvaluationRequest : IUtf8JsonSerializable, IJsonModel
{
- void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
- void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
writer.WriteStartObject();
JsonModelWriteCore(writer, options);
@@ -28,32 +28,39 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader
/// The client options for reading and writing models.
protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(FileSearchToolResource)} does not support writing '{format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRequest)} does not support writing '{format}' format.");
}
- if (Optional.IsCollectionDefined(VectorStoreIds))
+ writer.WritePropertyName("runId"u8);
+ writer.WriteStringValue(RunId);
+ if (Optional.IsDefined(ThreadId))
{
- writer.WritePropertyName("vector_store_ids"u8);
- writer.WriteStartArray();
- foreach (var item in VectorStoreIds)
- {
- writer.WriteStringValue(item);
- }
- writer.WriteEndArray();
+ writer.WritePropertyName("threadId"u8);
+ writer.WriteStringValue(ThreadId);
}
- if (Optional.IsCollectionDefined(VectorStores))
+ writer.WritePropertyName("evaluators"u8);
+ writer.WriteStartObject();
+ foreach (var item in Evaluators)
{
- writer.WritePropertyName("vector_stores"u8);
- writer.WriteStartArray();
- foreach (var item in VectorStores)
- {
- writer.WriteObjectValue(item, options);
- }
- writer.WriteEndArray();
+ writer.WritePropertyName(item.Key);
+ writer.WriteObjectValue(item.Value, options);
+ }
+ writer.WriteEndObject();
+ if (Optional.IsDefined(SamplingConfiguration))
+ {
+ writer.WritePropertyName("samplingConfiguration"u8);
+ writer.WriteObjectValue(SamplingConfiguration, options);
+ }
+ if (Optional.IsDefined(RedactionConfiguration))
+ {
+ writer.WritePropertyName("redactionConfiguration"u8);
+ writer.WriteObjectValue(RedactionConfiguration, options);
}
+ writer.WritePropertyName("appInsightsConnectionString"u8);
+ writer.WriteStringValue(AppInsightsConnectionString);
if (options.Format != "W" && _serializedAdditionalRawData != null)
{
foreach (var item in _serializedAdditionalRawData)
@@ -71,19 +78,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
}
}
- FileSearchToolResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ AgentEvaluationRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
if (format != "J")
{
- throw new FormatException($"The model {nameof(FileSearchToolResource)} does not support reading '{format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRequest)} does not support reading '{format}' format.");
}
using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializeFileSearchToolResource(document.RootElement, options);
+ return DeserializeAgentEvaluationRequest(document.RootElement, options);
}
- internal static FileSearchToolResource DeserializeFileSearchToolResource(JsonElement element, ModelReaderWriterOptions options = null)
+ internal static AgentEvaluationRequest DeserializeAgentEvaluationRequest(JsonElement element, ModelReaderWriterOptions options = null)
{
options ??= ModelSerializationExtensions.WireOptions;
@@ -91,38 +98,57 @@ internal static FileSearchToolResource DeserializeFileSearchToolResource(JsonEle
{
return null;
}
- IList vectorStoreIds = default;
- IList vectorStores = default;
+ string runId = default;
+ string threadId = default;
+ IDictionary evaluators = default;
+ AgentEvaluationSamplingConfiguration samplingConfiguration = default;
+ AgentEvaluationRedactionConfiguration redactionConfiguration = default;
+ string appInsightsConnectionString = default;
IDictionary serializedAdditionalRawData = default;
Dictionary rawDataDictionary = new Dictionary();
foreach (var property in element.EnumerateObject())
{
- if (property.NameEquals("vector_store_ids"u8))
+ if (property.NameEquals("runId"u8))
{
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
+ runId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("threadId"u8))
+ {
+ threadId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("evaluators"u8))
+ {
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
{
- array.Add(item.GetString());
+ dictionary.Add(property0.Name, EvaluatorConfiguration.DeserializeEvaluatorConfiguration(property0.Value, options));
}
- vectorStoreIds = array;
+ evaluators = dictionary;
continue;
}
- if (property.NameEquals("vector_stores"u8))
+ if (property.NameEquals("samplingConfiguration"u8))
{
if (property.Value.ValueKind == JsonValueKind.Null)
{
continue;
}
- List array = new List();
- foreach (var item in property.Value.EnumerateArray())
+ samplingConfiguration = AgentEvaluationSamplingConfiguration.DeserializeAgentEvaluationSamplingConfiguration(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("redactionConfiguration"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
{
- array.Add(VectorStoreConfigurations.DeserializeVectorStoreConfigurations(item, options));
+ continue;
}
- vectorStores = array;
+ redactionConfiguration = AgentEvaluationRedactionConfiguration.DeserializeAgentEvaluationRedactionConfiguration(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("appInsightsConnectionString"u8))
+ {
+ appInsightsConnectionString = property.Value.GetString();
continue;
}
if (options.Format != "W")
@@ -131,46 +157,53 @@ internal static FileSearchToolResource DeserializeFileSearchToolResource(JsonEle
}
}
serializedAdditionalRawData = rawDataDictionary;
- return new FileSearchToolResource(vectorStoreIds ?? new ChangeTrackingList(), vectorStores ?? new ChangeTrackingList(), serializedAdditionalRawData);
+ return new AgentEvaluationRequest(
+ runId,
+ threadId,
+ evaluators,
+ samplingConfiguration,
+ redactionConfiguration,
+ appInsightsConnectionString,
+ serializedAdditionalRawData);
}
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
switch (format)
{
case "J":
return ModelReaderWriter.Write(this, options, AzureAIProjectsContext.Default);
default:
- throw new FormatException($"The model {nameof(FileSearchToolResource)} does not support writing '{options.Format}' format.");
+ throw new FormatException($"The model {nameof(AgentEvaluationRequest)} does not support writing '{options.Format}' format.");
}
}
- FileSearchToolResource IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ AgentEvaluationRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
{
- var format = options.Format == "W" ? ((IPersistableModel