diff --git a/sdk/ai/Azure.AI.Projects.OneDP/Azure.AI.Projects.OneDP.sln b/sdk/ai/Azure.AI.Projects.OneDP/Azure.AI.Projects.OneDP.sln
new file mode 100644
index 000000000000..2e995a88065d
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/Azure.AI.Projects.OneDP.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Projects.OneDP", "src\Azure.AI.Projects.OneDP.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Projects.OneDP.Tests", "tests\Azure.AI.Projects.OneDP.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/CHANGELOG.md b/sdk/ai/Azure.AI.Projects.OneDP/CHANGELOG.md
new file mode 100644
index 000000000000..8b33f0fedccc
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
\ No newline at end of file
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/Directory.Build.props b/sdk/ai/Azure.AI.Projects.OneDP/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/README.md b/sdk/ai/Azure.AI.Projects.OneDP/README.md
new file mode 100644
index 000000000000..20b92c86af3c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/README.md
@@ -0,0 +1,107 @@
+# Azure.AI.Projects.OneDP client library for .NET
+
+Azure.AI.Projects.OneDP is a managed service that helps developers get secret simply and securely.
+
+Use the client library for to:
+
+* [Get secret](https://docs.microsoft.com/azure)
+
+[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples]
+
+ [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/ai/Azure.AI.Projects.OneDP/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure)
+
+## Getting started
+
+This section should include everything a developer needs to do to install and create their first client connection *very quickly*.
+
+### Install the package
+
+First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository.
+
+Install the client library for .NET with [NuGet](https://www.nuget.org/ ):
+
+```dotnetcli
+dotnet add package Azure.AI.Projects.OneDP --prerelease
+```
+
+### Prerequisites
+
+Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB:
+
+> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`.
+
+### Authenticate the client
+
+If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating.
+
+For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object.
+
+### Service API versions
+
+The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate.
+
+#### Select a service API version
+
+You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version.
+
+For example,
+
+```C# Snippet:CreateClientForSpecificApiVersion
+Uri endpoint = new Uri("");
+DefaultAzureCredential credential = new DefaultAzureCredential();
+ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.)
+var client = new Client(endpoint, credential, options);
+```
+
+When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility.
+
+Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.
+
+## Key concepts
+
+The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity.
+
+Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of:
+
+### Thread safety
+
+We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads.
+
+### Additional concepts
+
+[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) |
+[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) |
+[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) |
+[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) |
+[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) |
+[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) |
+[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/)
+
+
+## Examples
+
+You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/ai/Azure.AI.Projects.OneDP/samples).
+
+## Troubleshooting
+
+Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery.
+
+Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API.
+
+If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code.
+
+## Next steps
+
+* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory.
+* If appropriate, point users to other packages that might be useful.
+* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for.
+
+## Contributing
+
+This is a template, but your SDK readme should include details on how to contribute code to the repo/package.
+
+
+[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization
+[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide
+
+
\ No newline at end of file
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Azure.AI.Projects.OneDP.csproj b/sdk/ai/Azure.AI.Projects.OneDP/src/Azure.AI.Projects.OneDP.csproj
new file mode 100644
index 000000000000..fe2c1d298c6c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Azure.AI.Projects.OneDP.csproj
@@ -0,0 +1,20 @@
+
+
+ This is the Azure.AI.Projects.OneDP client library for developing .NET applications with rich experience.
+ Azure SDK Code Generation Azure.AI.Projects.OneDP for Azure Data Plane
+ 1.0.0-beta.1
+ Azure.AI.Projects.OneDP
+ $(RequiredTargetFrameworks)
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIContent.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIContent.Serialization.cs
new file mode 100644
index 000000000000..6b6125dbfb7c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIContent.Serialization.cs
@@ -0,0 +1,141 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownAIContent))]
+ public partial class AIContent : 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(AIContent)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type);
+ 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
+ }
+ }
+ }
+
+ AIContent 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(AIContent)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAIContent(document.RootElement, options);
+ }
+
+ internal static AIContent DeserializeAIContent(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "audio": return AudioContent.DeserializeAudioContent(element, options);
+ case "contentFilter": return ContentFilterContent.DeserializeContentFilterContent(element, options);
+ case "file": return FileContent.DeserializeFileContent(element, options);
+ case "image": return ImageContent.DeserializeImageContent(element, options);
+ case "refusal": return RefusalContent.DeserializeRefusalContent(element, options);
+ case "text": return TextContent.DeserializeTextContent(element, options);
+ case "toolCall": return ToolCallContent.DeserializeToolCallContent(element, options);
+ case "toolResult": return ToolResultContent.DeserializeToolResultContent(element, options);
+ case "video": return VideoContent.DeserializeVideoContent(element, options);
+ }
+ }
+ return UnknownAIContent.DeserializeUnknownAIContent(element, options);
+ }
+
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AIContent)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AIContent 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 DeserializeAIContent(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AIContent)} 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 AIContent FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAIContent(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.OneDP/src/Generated/AIContent.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIContent.cs
new file mode 100644
index 000000000000..9e8d4c9e3617
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIContent.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ ///
+ /// An abstract representation of a structured content item within a chat message.
+ /// 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 abstract partial class AIContent
+ {
+ ///
+ /// 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 protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected AIContent()
+ {
+ }
+
+ /// Initializes a new instance of .
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal AIContent(string type, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Gets or sets the type.
+ internal string Type { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClient.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClient.cs
new file mode 100644
index 000000000000..545e5383d672
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClient.cs
@@ -0,0 +1,176 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.AI.Projects.OneDP
+{
+ // Data plane generated client.
+ /// The AIProject service client.
+ public partial class AIProjectClient
+ {
+ private const string AuthorizationHeader = "Authorization";
+ private readonly AzureKeyCredential _keyCredential;
+ private const string AuthorizationApiKeyPrefix = "Bearer";
+ private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" };
+ private readonly TokenCredential _tokenCredential;
+ private readonly HttpPipeline _pipeline;
+ private readonly Uri _endpoint;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of AIProjectClient for mocking.
+ protected AIProjectClient()
+ {
+ }
+
+ /// Initializes a new instance of AIProjectClient.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>.
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AIProjectClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AIProjectClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AIProjectClient.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>.
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AIProjectClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AIProjectClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AIProjectClient.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>.
+ /// A credential used to authenticate to an Azure Service.
+ /// The options for configuring the client.
+ /// or is null.
+ public AIProjectClient(Uri endpoint, AzureKeyCredential credential, AIProjectClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new AIProjectClientOptions();
+
+ ClientDiagnostics = new ClientDiagnostics(options, true);
+ _keyCredential = credential;
+ _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier());
+ _endpoint = endpoint;
+ }
+
+ /// Initializes a new instance of AIProjectClient.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<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, _keyCredential, _tokenCredential, _endpoint), null) ?? _cachedServicePatterns;
+ }
+
+ /// Initializes a new instance of Messages.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Messages GetMessagesClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Messages(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Conversations.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Conversations GetConversationsClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Conversations(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Agents.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Agents GetAgentsClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Agents(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Connections.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Connections GetConnectionsClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Connections(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Evaluations.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Evaluations GetEvaluationsClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Evaluations(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Datasets.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Datasets GetDatasetsClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Datasets(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+
+ /// Initializes a new instance of Indexes.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual Indexes GetIndexesClient(string apiVersion = "2025-05-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Indexes(ClientDiagnostics, _pipeline, _keyCredential, _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-01-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new Deployments(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClientOptions.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClientOptions.cs
new file mode 100644
index 000000000000..bcb9b80081a8
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClientOptions.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Client options for AIProjectClient.
+ public partial class AIProjectClientOptions : ClientOptions
+ {
+ private const ServiceVersion LatestVersion = ServiceVersion.V2025_05_01_Preview;
+
+ /// The version of the service to use.
+ public enum ServiceVersion
+ {
+ /// Service version "2025-05-01-preview".
+ V2025_05_01_Preview = 1,
+ }
+
+ internal string Version { get; }
+
+ /// Initializes new instance of AIProjectClientOptions.
+ public AIProjectClientOptions(ServiceVersion version = LatestVersion)
+ {
+ Version = version switch
+ {
+ ServiceVersion.V2025_05_01_Preview => "2025-05-01-preview",
+ _ => throw new NotSupportedException()
+ };
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPClientBuilderExtensions.cs
new file mode 100644
index 000000000000..63f6f1a472cf
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPClientBuilderExtensions.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure;
+using Azure.AI.Projects.OneDP;
+using Azure.Core.Extensions;
+
+namespace Microsoft.Extensions.Azure
+{
+ /// Extension methods to add to client builder.
+ public static partial class AIProjectsOneDPClientBuilderExtensions
+ {
+ /// Registers a instance.
+ /// The builder to register with.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>.
+ /// A credential used to authenticate to an Azure Service.
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential)
+ where TBuilder : IAzureClientFactoryBuilder
+ {
+ return builder.RegisterClientFactory((options) => new AIProjectClient(endpoint, credential, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>.
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint)
+ where TBuilder : IAzureClientFactoryBuilderWithCredential
+ {
+ return builder.RegisterClientFactory((options, cred) => new AIProjectClient(endpoint, cred, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ /// The configuration values.
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, TConfiguration configuration)
+ where TBuilder : IAzureClientFactoryBuilderWithConfiguration
+ {
+ return builder.RegisterClientFactory(configuration);
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPModelFactory.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPModelFactory.cs
new file mode 100644
index 000000000000..af5da0217328
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPModelFactory.cs
@@ -0,0 +1,686 @@
+// 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.OneDP
+{
+ /// Model factory for models.
+ public static partial class AIProjectsOneDPModelFactory
+ {
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ /// The role of this message's author.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// A new instance for mocking.
+ public static ChatMessage ChatMessage(string userId = null, string agentId = null, string messageId = null, string agentRunId = null, string conversationId = null, string role = null, IEnumerable content = null, string authorName = null, long? createdAt = null, long? completedAt = null)
+ {
+ content ??= new List();
+
+ return new UnknownChatMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ role == null ? default : new AuthorRole(role),
+ content?.ToList(),
+ authorName,
+ createdAt,
+ completedAt,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// A new instance for mocking.
+ public static UserMessage UserMessage(string userId = null, string agentId = null, string messageId = null, string agentRunId = null, string conversationId = null, IEnumerable content = null, string authorName = null, long? createdAt = null, long? completedAt = null)
+ {
+ content ??= new List();
+
+ return new UserMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ AuthorRole.User,
+ content?.ToList(),
+ authorName,
+ createdAt,
+ completedAt,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// A new instance for mocking.
+ public static DeveloperMessage DeveloperMessage(string userId = null, string agentId = null, string messageId = null, string agentRunId = null, string conversationId = null, IEnumerable content = null, string authorName = null, long? createdAt = null, long? completedAt = null)
+ {
+ content ??= new List();
+
+ return new DeveloperMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ AuthorRole.Developer,
+ content?.ToList(),
+ authorName,
+ createdAt,
+ completedAt,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// A new instance for mocking.
+ public static AgentMessage AgentMessage(string userId = null, string agentId = null, string messageId = null, string agentRunId = null, string conversationId = null, IEnumerable content = null, string authorName = null, long? createdAt = null, long? completedAt = null)
+ {
+ content ??= new List();
+
+ return new AgentMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ AuthorRole.Agent,
+ content?.ToList(),
+ authorName,
+ createdAt,
+ completedAt,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// A new instance for mocking.
+ public static SystemMessage SystemMessage(string userId = null, string agentId = null, string messageId = null, string agentRunId = null, string conversationId = null, IEnumerable content = null, string authorName = null, long? createdAt = null, long? completedAt = null)
+ {
+ content ??= new List();
+
+ return new SystemMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ AuthorRole.System,
+ content?.ToList(),
+ authorName,
+ createdAt,
+ completedAt,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// The ID of the tool call to which this result pertains.
+ /// A new instance for mocking.
+ public static ToolMessage ToolMessage(string userId = null, string agentId = null, string messageId = null, string agentRunId = null, string conversationId = null, IEnumerable content = null, string authorName = null, long? createdAt = null, long? completedAt = null, string toolCallId = null)
+ {
+ content ??= new List();
+
+ return new ToolMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ AuthorRole.Tool,
+ content?.ToList(),
+ authorName,
+ createdAt,
+ completedAt,
+ serializedAdditionalRawData: null,
+ toolCallId);
+ }
+
+ /// Initializes a new instance of .
+ /// A unique identifier for this conversation.
+ ///
+ /// A list of messages in this conversation.
+ /// 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 Conversation Conversation(string conversationId = null, IEnumerable messages = null)
+ {
+ messages ??= new List();
+
+ return new Conversation(conversationId, messages?.ToList(), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// A unique identifier for the agent.
+ /// A description of the agent; used for display purposes and to describe the agent.
+ /// Arbitrary metadata associated with this agent.
+ /// Configuration options for this agent.
+ /// A new instance for mocking.
+ public static Agent Agent(string agentId = null, string description = null, IDictionary metadata = null, AgentConfigurationOptions configurationOptions = null)
+ {
+ metadata ??= new Dictionary();
+
+ return new Agent(agentId, description, metadata, configurationOptions, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique identifier for this run.
+ /// Timestamp when the run was initiated (Unix time).
+ /// Timestamp when the run finished processing (Unix time).
+ /// The inputs that were used to start this run.
+ /// Identifier for the user making the request.
+ /// Flag indicating whether to store the run and associated messages.
+ /// Final status of the run request. Known values: 'inProgress', 'incomplete', 'cancelled', 'failed', 'completed' - or custom string.
+ ///
+ /// List of output messages generated by 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 .
+ ///
+ /// Token usage details for this run.
+ /// Details about why the response is incomplete, if applicable.
+ /// A new instance for mocking.
+ public static Run Run(string runId = null, long createdAt = default, long completedAt = default, RunInputs runInputs = null, string userId = null, bool? store = null, RunOutputsStatus status = default, IEnumerable output = null, CompletionUsage usage = null, RunIncompleteDetails incompleteDetails = null)
+ {
+ output ??= new List();
+
+ return new Run(
+ runId,
+ createdAt,
+ completedAt,
+ runInputs,
+ userId,
+ store,
+ status,
+ output?.ToList(),
+ usage,
+ incompleteDetails,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique identifier for the agent responsible for the run. This is optional (not needeed) when doing a run using ephemeral agent.
+ ///
+ /// The list of input messages for the 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 , , , and .
+ ///
+ /// Optional identifier for an existing conversation.
+ /// Optional metadata associated with the run request.
+ /// Optional configuration for run generation.
+ /// Identifier for the user making the request.
+ /// The agent configuration when not using a previously created agent.
+ /// A new instance for mocking.
+ public static RunInputs RunInputs(string agentId = null, IEnumerable input = null, string conversationId = null, IReadOnlyDictionary metadata = null, RunOptions options = null, string userId = null, AgentConfigurationOptions agentConfiguration = null)
+ {
+ input ??= new List();
+ metadata ??= new Dictionary();
+
+ return new RunInputs(
+ agentId,
+ input?.ToList(),
+ conversationId,
+ metadata,
+ options,
+ userId,
+ agentConfiguration,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Number of run (completion) tokens used over the course of the run.
+ /// Number of prompt tokens used over the course of the run step.
+ /// Total number of tokens used (prompt + run).
+ /// Details of the prompt tokens.
+ /// Breakdown of tokens used in a run.
+ /// A new instance for mocking.
+ public static CompletionUsage CompletionUsage(long outputTokens = default, long inputTokens = default, long totalTokens = default, CompletionUsageInputTokenDetails inputTokenDetails = null, CompletionUsageOutputTokenDetails outputTokenDetails = null)
+ {
+ return new CompletionUsage(
+ outputTokens,
+ inputTokens,
+ totalTokens,
+ inputTokenDetails,
+ outputTokenDetails,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The number of cached prompt tokens.
+ /// A new instance for mocking.
+ public static CompletionUsageInputTokenDetails CompletionUsageInputTokenDetails(int? cachedTokens = null)
+ {
+ return new CompletionUsageInputTokenDetails(cachedTokens, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Tokens generated by the model for reasoning.
+ /// A new instance for mocking.
+ public static CompletionUsageOutputTokenDetails CompletionUsageOutputTokenDetails(int? reasoningTokens = null)
+ {
+ return new CompletionUsageOutputTokenDetails(reasoningTokens, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ ///
+ /// A new instance for mocking.
+ public static RunIncompleteDetails RunIncompleteDetails(string reason = null)
+ {
+ return new RunIncompleteDetails(reason, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The name of the resource.
+ /// Category of the connection.
+ /// The connection URL to be used for this service.
+ /// Metadata of the connection.
+ /// A new instance for mocking.
+ public static Connection Connection(string name = null, ConnectionType type = default, string target = null, IReadOnlyDictionary metadata = null)
+ {
+ metadata ??= new Dictionary();
+
+ return new Connection(name, type, target, metadata, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// 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 .
+ ///
+ /// 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.
+ /// 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, 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,
+ data,
+ displayName,
+ description,
+ status,
+ tags,
+ properties,
+ evaluators,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// Dataset type.
+ /// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted.
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// 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 datasetUri = null, string type = null, bool? isReference = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
+ {
+ tags ??= new Dictionary();
+
+ return new UnknownDatasetVersion(
+ datasetUri,
+ type == null ? default : new DatasetType(type),
+ isReference,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted.
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// The name of the resource.
+ /// The version of the resource.
+ /// The asset description text.
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ /// Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features.
+ /// A new instance for mocking.
+ public static FileDatasetVersion FileDatasetVersion(string datasetUri = null, bool? isReference = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string openAIPurpose = null)
+ {
+ tags ??= new Dictionary();
+
+ return new FileDatasetVersion(
+ datasetUri,
+ DatasetType.UriFile,
+ isReference,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ openAIPurpose);
+ }
+
+ /// Initializes a new instance of .
+ /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted.
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// 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 datasetUri = null, bool? isReference = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
+ {
+ tags ??= new Dictionary();
+
+ return new FolderDatasetVersion(
+ datasetUri,
+ DatasetType.UriFolder,
+ isReference,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// If PendingUploadId is not provided, a random GUID will be used.
+ /// Name of Azure blob storage connection to use for generating temporary SAS token.
+ /// TemporaryBlobReference 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 PendingUploadRequest(pendingUploadId, connectionName, pendingUploadType, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Container-level read, write, list SAS.
+ /// ID for this upload request.
+ /// Version of dataset to be created if user did not specify version when initially creating upload.
+ /// TemporaryBlobReference is the only supported type.
+ /// A new instance for mocking.
+ public static PendingUploadResponse PendingUploadResponse(BlobReferenceForConsumption blobReferenceForConsumption = null, string pendingUploadId = null, string datasetVersion = null, PendingUploadType pendingUploadType = default)
+ {
+ return new PendingUploadResponse(blobReferenceForConsumption, pendingUploadId, datasetVersion, pendingUploadType, serializedAdditionalRawData: 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 BlobReferenceForConsumption BlobReferenceForConsumption(string blobUri = null, string storageAccountArmId = null, SasCredential credential = null)
+ {
+ return new BlobReferenceForConsumption(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// SAS Token.
+ /// A new instance for mocking.
+ public static SasCredential SasCredential(string sasToken = null)
+ {
+ return new SasCredential(CredentialType.SAS, serializedAdditionalRawData: null, sasToken);
+ }
+
+ /// Initializes a new instance of .
+ /// API Key.
+ /// A new instance for mocking.
+ public static ApiKeyCredential ApiKeyCredential(string apiKey = null)
+ {
+ return new ApiKeyCredential(CredentialType.ApiKey, serializedAdditionalRawData: null, apiKey);
+ }
+
+ /// Initializes a new instance of .
+ /// Type of index.
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// 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 stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
+ {
+ tags ??= new Dictionary();
+
+ return new UnknownIndex(
+ type == null ? default : new IndexType(type),
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// 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.
+ /// A new instance for mocking.
+ public static AzureAISearchIndex AzureAISearchIndex(string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string connectionName = null, string indexName = null)
+ {
+ tags ??= new Dictionary();
+
+ return new AzureAISearchIndex(
+ IndexType.AzureSearch,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ connectionName,
+ indexName);
+ }
+
+ /// Initializes a new instance of .
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// 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 stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string vectorStoreId = null)
+ {
+ tags ??= new Dictionary();
+
+ return new ManagedAzureAISearchIndex(
+ IndexType.ManagedAzureSearch,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ vectorStoreId);
+ }
+
+ /// Initializes a new instance of .
+ /// Asset stage.
+ /// A unique identifier for the asset, assetId probably?.
+ /// 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.
+ /// A new instance for mocking.
+ public static CosmosDBIndex CosmosDBIndex(string stage = null, 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)
+ {
+ tags ??= new Dictionary();
+
+ return new CosmosDBIndex(
+ IndexType.CosmosDB,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags,
+ serializedAdditionalRawData: null,
+ connectionName,
+ databaseName,
+ containerName,
+ embeddingConfiguration);
+ }
+
+ /// 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 UnknownDeployment(type == null ? default : new DeploymentType(type), name, serializedAdditionalRawData: 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)
+ {
+ capabilities ??= new Dictionary();
+
+ 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);
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AadCredential.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AadCredential.Serialization.cs
new file mode 100644
index 000000000000..49a7ea9190df
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AadCredential.Serialization.cs
@@ -0,0 +1,126 @@
+// 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.OneDP
+{
+ public partial class AadCredential : 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(AadCredential)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ }
+
+ AadCredential 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(AadCredential)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAadCredential(document.RootElement, options);
+ }
+
+ internal static AadCredential DeserializeAadCredential(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ CredentialType type = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("type"u8))
+ {
+ type = new CredentialType(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AadCredential(type, 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);
+ default:
+ throw new FormatException($"The model {nameof(AadCredential)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AadCredential 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 DeserializeAadCredential(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AadCredential)} 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 AadCredential FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAadCredential(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.OneDP/src/Generated/AadCredential.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AadCredential.cs
new file mode 100644
index 000000000000..aa13de098aeb
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AadCredential.cs
@@ -0,0 +1,29 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// AAD Credential definition.
+ public partial class AadCredential : BaseCredential
+ {
+ /// Initializes a new instance of .
+ internal AadCredential()
+ {
+ Type = CredentialType.AAD;
+ }
+
+ /// Initializes a new instance of .
+ /// Type of credential. Possible values are: AAD, SAS, ApiKey.
+ /// Keeps track of any properties unknown to the library.
+ internal AadCredential(CredentialType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData)
+ {
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agent.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agent.Serialization.cs
new file mode 100644
index 000000000000..cb7f000c2376
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agent.Serialization.cs
@@ -0,0 +1,190 @@
+// 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.OneDP
+{
+ 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.");
+ }
+
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("agentId"u8);
+ writer.WriteStringValue(AgentId);
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ if (Optional.IsCollectionDefined(Metadata))
+ {
+ writer.WritePropertyName("metadata"u8);
+ writer.WriteStartObject();
+ foreach (var item in Metadata)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ writer.WritePropertyName("configurationOptions"u8);
+ writer.WriteObjectValue(ConfigurationOptions, options);
+ 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 agentId = default;
+ string description = default;
+ IDictionary metadata = default;
+ AgentConfigurationOptions configurationOptions = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("agentId"u8))
+ {
+ agentId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("metadata"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ Dictionary dictionary = new Dictionary();
+ foreach (var property0 in property.Value.EnumerateObject())
+ {
+ dictionary.Add(property0.Name, property0.Value.GetString());
+ }
+ metadata = dictionary;
+ continue;
+ }
+ if (property.NameEquals("configurationOptions"u8))
+ {
+ configurationOptions = AgentConfigurationOptions.DeserializeAgentConfigurationOptions(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new Agent(agentId, description, metadata ?? new ChangeTrackingDictionary(), configurationOptions, 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);
+ 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.OneDP/src/Generated/Agent.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agent.cs
new file mode 100644
index 000000000000..d6945e4c3b1c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agent.cs
@@ -0,0 +1,88 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Represents an AI agent with configuration, instructions, and tool access.
+ 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 .
+ /// Configuration options for this agent.
+ /// is null.
+ public Agent(AgentConfigurationOptions configurationOptions)
+ {
+ Argument.AssertNotNull(configurationOptions, nameof(configurationOptions));
+
+ Metadata = new ChangeTrackingDictionary();
+ ConfigurationOptions = configurationOptions;
+ }
+
+ /// Initializes a new instance of .
+ /// A unique identifier for the agent.
+ /// A description of the agent; used for display purposes and to describe the agent.
+ /// Arbitrary metadata associated with this agent.
+ /// Configuration options for this agent.
+ /// Keeps track of any properties unknown to the library.
+ internal Agent(string agentId, string description, IDictionary metadata, AgentConfigurationOptions configurationOptions, IDictionary serializedAdditionalRawData)
+ {
+ AgentId = agentId;
+ Description = description;
+ Metadata = metadata;
+ ConfigurationOptions = configurationOptions;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal Agent()
+ {
+ }
+
+ /// A unique identifier for the agent.
+ public string AgentId { get; }
+ /// A description of the agent; used for display purposes and to describe the agent.
+ public string Description { get; set; }
+ /// Arbitrary metadata associated with this agent.
+ public IDictionary Metadata { get; }
+ /// Configuration options for this agent.
+ public AgentConfigurationOptions ConfigurationOptions { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentConfigurationOptions.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentConfigurationOptions.Serialization.cs
new file mode 100644
index 000000000000..71659b4feaee
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentConfigurationOptions.Serialization.cs
@@ -0,0 +1,214 @@
+// 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.OneDP
+{
+ public partial class AgentConfigurationOptions : 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(AgentConfigurationOptions)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("displayName"u8);
+ writer.WriteStringValue(DisplayName);
+ if (Optional.IsDefined(AgentModel))
+ {
+ writer.WritePropertyName("agentModel"u8);
+ writer.WriteObjectValue(AgentModel, options);
+ }
+ if (Optional.IsDefined(Instructions))
+ {
+ writer.WritePropertyName("instructions"u8);
+ writer.WriteStringValue(Instructions);
+ }
+ if (Optional.IsCollectionDefined(Tools))
+ {
+ writer.WritePropertyName("tools"u8);
+ writer.WriteStartArray();
+ foreach (var item in Tools)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsDefined(ToolChoice))
+ {
+ writer.WritePropertyName("toolChoice"u8);
+ writer.WriteObjectValue(ToolChoice, options);
+ }
+ 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
+ }
+ }
+ }
+
+ AgentConfigurationOptions 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(AgentConfigurationOptions)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentConfigurationOptions(document.RootElement, options);
+ }
+
+ internal static AgentConfigurationOptions DeserializeAgentConfigurationOptions(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string displayName = default;
+ AgentModel agentModel = default;
+ string instructions = default;
+ IList tools = default;
+ ToolChoiceBehavior toolChoice = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("displayName"u8))
+ {
+ displayName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("agentModel"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ agentModel = AgentModel.DeserializeAgentModel(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("instructions"u8))
+ {
+ instructions = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("tools"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(AgentToolDefinition.DeserializeAgentToolDefinition(item, options));
+ }
+ tools = array;
+ continue;
+ }
+ if (property.NameEquals("toolChoice"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ toolChoice = ToolChoiceBehavior.DeserializeToolChoiceBehavior(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AgentConfigurationOptions(
+ displayName,
+ agentModel,
+ instructions,
+ tools ?? new ChangeTrackingList(),
+ toolChoice,
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AgentConfigurationOptions)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AgentConfigurationOptions 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 DeserializeAgentConfigurationOptions(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentConfigurationOptions)} 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 AgentConfigurationOptions FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentConfigurationOptions(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.OneDP/src/Generated/AgentConfigurationOptions.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentConfigurationOptions.cs
new file mode 100644
index 000000000000..b402e1f667ce
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentConfigurationOptions.cs
@@ -0,0 +1,116 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Options used when creating and an agent or completing a run without an existing agent.
+ public partial class AgentConfigurationOptions
+ {
+ ///
+ /// 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 display name of the agent; used for display purposes and sent to the LLM to identify the agent.
+ /// is null.
+ public AgentConfigurationOptions(string displayName)
+ {
+ Argument.AssertNotNull(displayName, nameof(displayName));
+
+ DisplayName = displayName;
+ Tools = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// The display name of the agent; used for display purposes and sent to the LLM to identify the agent.
+ ///
+ /// The model definition for this agent. This is optional (not needed) when doing a run using persistent 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 .
+ ///
+ /// Instructions provided to guide how this agent operates.
+ ///
+ /// A list of tool definitions available to 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 .
+ ///
+ ///
+ /// How the agent should choose among provided tools.
+ /// 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 .
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal AgentConfigurationOptions(string displayName, AgentModel agentModel, string instructions, IList tools, ToolChoiceBehavior toolChoice, IDictionary serializedAdditionalRawData)
+ {
+ DisplayName = displayName;
+ AgentModel = agentModel;
+ Instructions = instructions;
+ Tools = tools;
+ ToolChoice = toolChoice;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AgentConfigurationOptions()
+ {
+ }
+
+ /// The display name of the agent; used for display purposes and sent to the LLM to identify the agent.
+ public string DisplayName { get; set; }
+ ///
+ /// The model definition for this agent. This is optional (not needed) when doing a run using persistent 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 AgentModel AgentModel { get; set; }
+ /// Instructions provided to guide how this agent operates.
+ public string Instructions { get; set; }
+ ///
+ /// A list of tool definitions available to 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 IList Tools { get; }
+ ///
+ /// How the agent should choose among provided tools.
+ /// 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 ToolChoiceBehavior ToolChoice { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentMessage.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentMessage.Serialization.cs
new file mode 100644
index 000000000000..7a680c927949
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentMessage.Serialization.cs
@@ -0,0 +1,204 @@
+// 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.OneDP
+{
+ public partial class AgentMessage : 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(AgentMessage)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ }
+
+ AgentMessage 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(AgentMessage)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentMessage(document.RootElement, options);
+ }
+
+ internal static AgentMessage DeserializeAgentMessage(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string userId = default;
+ string agentId = default;
+ string messageId = default;
+ string agentRunId = default;
+ string conversationId = default;
+ AuthorRole role = default;
+ IList content = default;
+ string authorName = default;
+ long? createdAt = default;
+ long? completedAt = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("userId"u8))
+ {
+ userId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("agentId"u8))
+ {
+ agentId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("messageId"u8))
+ {
+ messageId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("agentRunId"u8))
+ {
+ agentRunId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("conversationId"u8))
+ {
+ conversationId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("role"u8))
+ {
+ role = new AuthorRole(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("content"u8))
+ {
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(AIContent.DeserializeAIContent(item, options));
+ }
+ content = array;
+ continue;
+ }
+ if (property.NameEquals("authorName"u8))
+ {
+ authorName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("createdAt"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ createdAt = property.Value.GetInt64();
+ continue;
+ }
+ if (property.NameEquals("completedAt"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ completedAt = property.Value.GetInt64();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AgentMessage(
+ userId,
+ agentId,
+ messageId,
+ agentRunId,
+ conversationId,
+ role,
+ content,
+ authorName,
+ createdAt,
+ completedAt,
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AgentMessage)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AgentMessage 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 DeserializeAgentMessage(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentMessage)} 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 AgentMessage FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentMessage(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.OneDP/src/Generated/AgentMessage.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentMessage.cs
new file mode 100644
index 000000000000..d150d6cf5706
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentMessage.cs
@@ -0,0 +1,55 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// An agent message within a chat, always with the 'agent' role.
+ public partial class AgentMessage : ChatMessage
+ {
+ /// Initializes a new instance of .
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// is null.
+ public AgentMessage(IEnumerable content) : base(content)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ Role = AuthorRole.Agent;
+ }
+
+ /// Initializes a new instance of .
+ /// The ID of the user who created the message (if applicable).
+ /// The ID of the agent who created the message (if applicable).
+ /// A unique identifier for this message.
+ /// A unique run ID, if this message was generated by a run process.
+ /// The conversation to which this message belongs.
+ /// The role of this message's author.
+ ///
+ /// The contents of the message.
+ /// 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 .
+ ///
+ /// An optional display name for the author.
+ /// The timestamp (in Unix time) when this message was created.
+ /// The timestamp (in Unix time) when this message was completed, if applicable.
+ /// Keeps track of any properties unknown to the library.
+ internal AgentMessage(string userId, string agentId, string messageId, string agentRunId, string conversationId, AuthorRole role, IList content, string authorName, long? createdAt, long? completedAt, IDictionary serializedAdditionalRawData) : base(userId, agentId, messageId, agentRunId, conversationId, role, content, authorName, createdAt, completedAt, serializedAdditionalRawData)
+ {
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AgentMessage()
+ {
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentModel.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentModel.Serialization.cs
new file mode 100644
index 000000000000..80fa407dbc7d
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentModel.Serialization.cs
@@ -0,0 +1,149 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownAgentModel))]
+ public partial class AgentModel : 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(AgentModel)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ if (Optional.IsDefined(Provider))
+ {
+ writer.WritePropertyName("provider"u8);
+ writer.WriteStringValue(Provider);
+ }
+ if (Optional.IsDefined(Endpoint))
+ {
+ writer.WritePropertyName("endpoint"u8);
+ writer.WriteStringValue(Endpoint);
+ }
+ if (Optional.IsDefined(Options))
+ {
+ writer.WritePropertyName("options"u8);
+ writer.WriteObjectValue(Options, options);
+ }
+ 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
+ }
+ }
+ }
+
+ AgentModel 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(AgentModel)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentModel(document.RootElement, options);
+ }
+
+ internal static AgentModel DeserializeAgentModel(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("provider", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "azure": return AzureAgentModel.DeserializeAzureAgentModel(element, options);
+ case "openai": return OpenAIAgentModel.DeserializeOpenAIAgentModel(element, options);
+ }
+ }
+ return UnknownAgentModel.DeserializeUnknownAgentModel(element, options);
+ }
+
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AgentModel)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AgentModel 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 DeserializeAgentModel(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentModel)} 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 AgentModel FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentModel(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.OneDP/src/Generated/AgentModel.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentModel.cs
new file mode 100644
index 000000000000..7676a51ef06e
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentModel.cs
@@ -0,0 +1,91 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ ///
+ /// Represents the model or provider-specific data used by 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 abstract partial class AgentModel
+ {
+ ///
+ /// 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 protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// A unique model or deployment ID for this agent model.
+ /// is null.
+ protected AgentModel(string id)
+ {
+ Argument.AssertNotNull(id, nameof(id));
+
+ Id = id;
+ }
+
+ /// Initializes a new instance of .
+ /// A unique model or deployment ID for this agent model.
+ /// The name of the provider for this model (e.g., 'openai').
+ /// An endpoint where the provider can be reached, if applicable.
+ /// Provider-specific configuration and options (JSON-like structure).
+ /// Keeps track of any properties unknown to the library.
+ internal AgentModel(string id, string provider, string endpoint, JSONAny options, IDictionary serializedAdditionalRawData)
+ {
+ Id = id;
+ Provider = provider;
+ Endpoint = endpoint;
+ Options = options;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AgentModel()
+ {
+ }
+
+ /// A unique model or deployment ID for this agent model.
+ public string Id { get; set; }
+ /// The name of the provider for this model (e.g., 'openai').
+ internal string Provider { get; set; }
+ /// An endpoint where the provider can be reached, if applicable.
+ public string Endpoint { get; set; }
+ /// Provider-specific configuration and options (JSON-like structure).
+ public JSONAny Options { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinition.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinition.Serialization.cs
new file mode 100644
index 000000000000..669334f0b924
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinition.Serialization.cs
@@ -0,0 +1,147 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownAgentToolDefinition))]
+ public partial class AgentToolDefinition : 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(AgentToolDefinition)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type);
+ if (Optional.IsDefined(Options))
+ {
+ writer.WritePropertyName("options"u8);
+ writer.WriteObjectValue(Options, options);
+ }
+ if (Optional.IsDefined(Override))
+ {
+ writer.WritePropertyName("override"u8);
+ writer.WriteObjectValue(Override, options);
+ }
+ 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
+ }
+ }
+ }
+
+ AgentToolDefinition 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(AgentToolDefinition)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentToolDefinition(document.RootElement, options);
+ }
+
+ internal static AgentToolDefinition DeserializeAgentToolDefinition(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "Function": return FunctionToolDefinition.DeserializeFunctionToolDefinition(element, options);
+ case "Microsoft.BingGrounding": return BingGroundingToolDefinition.DeserializeBingGroundingToolDefinition(element, options);
+ case "OpenAI.CodeInterpreter": return CodeInterpreterToolDefinition.DeserializeCodeInterpreterToolDefinition(element, options);
+ case "OpenAI.FileSearch": return FileSearchToolDefinition.DeserializeFileSearchToolDefinition(element, options);
+ case "OpenAI.OpenApi": return OpenApiToolDefinition.DeserializeOpenApiToolDefinition(element, options);
+ }
+ }
+ return UnknownAgentToolDefinition.DeserializeUnknownAgentToolDefinition(element, options);
+ }
+
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AgentToolDefinition)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AgentToolDefinition 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 DeserializeAgentToolDefinition(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentToolDefinition)} 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 AgentToolDefinition FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentToolDefinition(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.OneDP/src/Generated/AgentToolDefinition.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinition.cs
new file mode 100644
index 000000000000..e456c6b8b5d5
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinition.cs
@@ -0,0 +1,77 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ ///
+ /// Represents a definition of a tool that an agent may use, used in a polymorphic manner.
+ /// 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 abstract partial class AgentToolDefinition
+ {
+ ///
+ /// 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 protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected AgentToolDefinition()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Discriminates the various child 'tool definition' types.
+ /// Additional options that specify the behavior of this tool (also polymorphic).
+ /// A set of overrides for the tool's name, description, or parameters.
+ /// Keeps track of any properties unknown to the library.
+ internal AgentToolDefinition(string type, AgentToolOptions options, AgentToolDefinitionOverride @override, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ Options = options;
+ Override = @override;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Discriminates the various child 'tool definition' types.
+ internal string Type { get; set; }
+ /// Additional options that specify the behavior of this tool (also polymorphic).
+ public AgentToolOptions Options { get; set; }
+ /// A set of overrides for the tool's name, description, or parameters.
+ public AgentToolDefinitionOverride Override { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinitionOverride.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinitionOverride.Serialization.cs
new file mode 100644
index 000000000000..03f9caec5a7d
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinitionOverride.Serialization.cs
@@ -0,0 +1,171 @@
+// 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.OneDP
+{
+ public partial class AgentToolDefinitionOverride : 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(AgentToolDefinitionOverride)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsDefined(Name))
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ if (Optional.IsDefined(Parameters))
+ {
+ writer.WritePropertyName("parameters"u8);
+ writer.WriteObjectValue(Parameters, options);
+ }
+ 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
+ }
+ }
+ }
+
+ AgentToolDefinitionOverride 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(AgentToolDefinitionOverride)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentToolDefinitionOverride(document.RootElement, options);
+ }
+
+ internal static AgentToolDefinitionOverride DeserializeAgentToolDefinitionOverride(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string name = default;
+ string description = default;
+ JSONSchema parameters = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("name"u8))
+ {
+ name = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("parameters"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ parameters = JSONSchema.DeserializeJSONSchema(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AgentToolDefinitionOverride(name, description, parameters, 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);
+ default:
+ throw new FormatException($"The model {nameof(AgentToolDefinitionOverride)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AgentToolDefinitionOverride 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 DeserializeAgentToolDefinitionOverride(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentToolDefinitionOverride)} 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 AgentToolDefinitionOverride FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentToolDefinitionOverride(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.OneDP/src/Generated/AgentToolDefinitionOverride.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinitionOverride.cs
new file mode 100644
index 000000000000..3c82fcdea0d8
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolDefinitionOverride.cs
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// The AgentToolDefinitionOverride.
+ public partial class AgentToolDefinitionOverride
+ {
+ ///
+ /// 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 .
+ public AgentToolDefinitionOverride()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// An alternate name for the tool.
+ /// An alternate description for the tool.
+ /// An alternate JSON schema for the tool's parameters.
+ /// Keeps track of any properties unknown to the library.
+ internal AgentToolDefinitionOverride(string name, string description, JSONSchema parameters, IDictionary serializedAdditionalRawData)
+ {
+ Name = name;
+ Description = description;
+ Parameters = parameters;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// An alternate name for the tool.
+ public string Name { get; set; }
+ /// An alternate description for the tool.
+ public string Description { get; set; }
+ /// An alternate JSON schema for the tool's parameters.
+ public JSONSchema Parameters { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolOptions.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolOptions.Serialization.cs
new file mode 100644
index 000000000000..c71d61815178
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolOptions.Serialization.cs
@@ -0,0 +1,126 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownAgentToolOptions))]
+ public partial class AgentToolOptions : 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(AgentToolOptions)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type);
+ 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
+ }
+ }
+ }
+
+ AgentToolOptions 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(AgentToolOptions)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAgentToolOptions(document.RootElement, options);
+ }
+
+ internal static AgentToolOptions DeserializeAgentToolOptions(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ return UnknownAgentToolOptions.DeserializeUnknownAgentToolOptions(element, options);
+ }
+
+ 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);
+ default:
+ throw new FormatException($"The model {nameof(AgentToolOptions)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AgentToolOptions 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 DeserializeAgentToolOptions(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AgentToolOptions)} 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 AgentToolOptions FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAgentToolOptions(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.OneDP/src/Generated/AgentToolOptions.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolOptions.cs
new file mode 100644
index 000000000000..f3d0b526289d
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AgentToolOptions.cs
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Base type for any agent tool-specific options, used in a polymorphic manner.
+ public abstract partial class AgentToolOptions
+ {
+ ///
+ /// 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 protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected AgentToolOptions()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Discriminates the various child 'tool options' types.
+ /// Keeps track of any properties unknown to the library.
+ internal AgentToolOptions(string type, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Discriminates the various child 'tool options' types.
+ internal string Type { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agents.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agents.cs
new file mode 100644
index 000000000000..8ed8aefca50a
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Agents.cs
@@ -0,0 +1,1368 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.AI.Projects.OneDP
+{
+ // Data plane generated sub-client.
+ ///
+ /// AGENTS
+ ///
+ /// Interface is rooted at /agents.
+ /// Includes standard resource operations + custom collection-level
+ /// and instance-level actions (complete, stream).
+ ///
+ public partial class Agents
+ {
+ private const string AuthorizationHeader = "Authorization";
+ private readonly AzureKeyCredential _keyCredential;
+ private const string AuthorizationApiKeyPrefix = "Bearer";
+ private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.com/.default" };
+ private readonly TokenCredential _tokenCredential;
+ private readonly HttpPipeline _pipeline;
+ private readonly Uri _endpoint;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of Agents for mocking.
+ protected Agents()
+ {
+ }
+
+ /// Initializes a new instance of Agents.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The key credential to copy.
+ /// The token credential to copy.
+ /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>.
+ /// The API version to use for this operation.
+ internal Agents(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion)
+ {
+ ClientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ _keyCredential = keyCredential;
+ _tokenCredential = tokenCredential;
+ _endpoint = endpoint;
+ _apiVersion = apiVersion;
+ }
+
+ /// Creates a new Agent resource and returns it.
+ /// The display name of the agent; used for display purposes and sent to the LLM to identify the agent.
+ /// The model definition for this agent. This is optional (not needed) when doing a run using persistent agent.
+ /// Instructions provided to guide how this agent operates.
+ /// A list of tool definitions available to the agent.
+ /// How the agent should choose among provided tools.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual async Task> CreateAgentAsync(string displayName, AgentModel agentModel = null, string instructions = null, IEnumerable tools = null, ToolChoiceBehavior toolChoice = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(displayName, nameof(displayName));
+
+ CreateAgentRequest createAgentRequest = new CreateAgentRequest(
+ displayName,
+ agentModel,
+ instructions,
+ tools?.ToList() as IReadOnlyList ?? new ChangeTrackingList(),
+ toolChoice,
+ null);
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await CreateAgentAsync(createAgentRequest.ToRequestContent(), context).ConfigureAwait(false);
+ return Response.FromValue(Agent.FromResponse(response), response);
+ }
+
+ /// Creates a new Agent resource and returns it.
+ /// The display name of the agent; used for display purposes and sent to the LLM to identify the agent.
+ /// The model definition for this agent. This is optional (not needed) when doing a run using persistent agent.
+ /// Instructions provided to guide how this agent operates.
+ /// A list of tool definitions available to the agent.
+ /// How the agent should choose among provided tools.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual Response CreateAgent(string displayName, AgentModel agentModel = null, string instructions = null, IEnumerable tools = null, ToolChoiceBehavior toolChoice = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(displayName, nameof(displayName));
+
+ CreateAgentRequest createAgentRequest = new CreateAgentRequest(
+ displayName,
+ agentModel,
+ instructions,
+ tools?.ToList() as IReadOnlyList ?? new ChangeTrackingList(),
+ toolChoice,
+ null);
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = CreateAgent(createAgentRequest.ToRequestContent(), context);
+ return Response.FromValue(Agent.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Creates a new Agent resource and returns it.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task CreateAgentAsync(RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.CreateAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateAgentRequest(content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Creates a new Agent resource and returns it.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response CreateAgent(RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.CreateAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateAgentRequest(content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Retrieves an existing Agent by its ID.
+ /// The ID of the Agent to retrieve.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> GetAgentAsync(string agentId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetAgentAsync(agentId, context).ConfigureAwait(false);
+ return Response.FromValue(Agent.FromResponse(response), response);
+ }
+
+ /// Retrieves an existing Agent by its ID.
+ /// The ID of the Agent to retrieve.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response GetAgent(string agentId, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetAgent(agentId, context);
+ return Response.FromValue(Agent.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Retrieves an existing Agent by its ID.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Agent to retrieve.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task GetAgentAsync(string agentId, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.GetAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetAgentRequest(agentId, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Retrieves an existing Agent by its ID.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Agent to retrieve.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response GetAgent(string agentId, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.GetAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetAgentRequest(agentId, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Updates or replaces an agent and returns the updated resource.
+ /// The ID of the Agent to update.
+ /// The updated Agent data.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual async Task> UpdateAgentAsync(string agentId, Agent body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await UpdateAgentAsync(agentId, content, context).ConfigureAwait(false);
+ return Response.FromValue(Agent.FromResponse(response), response);
+ }
+
+ /// Updates or replaces an agent and returns the updated resource.
+ /// The ID of the Agent to update.
+ /// The updated Agent data.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ ///
+ public virtual Response UpdateAgent(string agentId, Agent body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = UpdateAgent(agentId, content, context);
+ return Response.FromValue(Agent.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Updates or replaces an agent and returns the updated resource.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Agent to update.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task UpdateAgentAsync(string agentId, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.UpdateAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateUpdateAgentRequest(agentId, content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Updates or replaces an agent and returns the updated resource.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Agent to update.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response UpdateAgent(string agentId, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.UpdateAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateUpdateAgentRequest(agentId, content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes an Agent by its ID, returning 204 on success.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Agent to delete.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task DeleteAgentAsync(string agentId, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.DeleteAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteAgentRequest(agentId, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Deletes an Agent by its ID, returning 204 on success.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The ID of the Agent to delete.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response DeleteAgent(string agentId, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(agentId, nameof(agentId));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.DeleteAgent");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteAgentRequest(agentId, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Lists all Agents, returning an array of Agent objects.
+ /// The cancellation token to use.
+ ///
+ public virtual async Task>> GetAgentsAsync(CancellationToken cancellationToken = default)
+ {
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetAgentsAsync(context).ConfigureAwait(false);
+ IReadOnlyList value = default;
+ using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false);
+ List array = new List();
+ foreach (var item in document.RootElement.EnumerateArray())
+ {
+ array.Add(Agent.DeserializeAgent(item));
+ }
+ value = array;
+ return Response.FromValue(value, response);
+ }
+
+ /// Lists all Agents, returning an array of Agent objects.
+ /// The cancellation token to use.
+ ///
+ public virtual Response> GetAgents(CancellationToken cancellationToken = default)
+ {
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetAgents(context);
+ IReadOnlyList value = default;
+ using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions);
+ List array = new List();
+ foreach (var item in document.RootElement.EnumerateArray())
+ {
+ array.Add(Agent.DeserializeAgent(item));
+ }
+ value = array;
+ return Response.FromValue(value, response);
+ }
+
+ ///
+ /// [Protocol Method] Lists all Agents, returning an array of Agent objects.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task GetAgentsAsync(RequestContext context)
+ {
+ using var scope = ClientDiagnostics.CreateScope("Agents.GetAgents");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetAgentsRequest(context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Lists all Agents, returning an array of Agent objects.
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response GetAgents(RequestContext context)
+ {
+ using var scope = ClientDiagnostics.CreateScope("Agents.GetAgents");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetAgentsRequest(context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Creates and waits for a run to finish, returning the completed Run (including its outputs).
+ /// The list of input messages for the run.
+ /// Unique identifier for the agent responsible for the run. This is optional (not needeed) when doing a run using ephemeral agent.
+ /// Optional identifier for an existing conversation.
+ /// Optional metadata associated with the run request.
+ /// Optional configuration for run generation.
+ /// Identifier for the user making the request.
+ /// The agent configuration when not using a previously created agent.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual async Task> RunAsync(IEnumerable input, string agentId = null, string conversationId = null, IReadOnlyDictionary metadata = null, RunOptions options = null, string userId = null, AgentConfigurationOptions agentConfiguration = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(input, nameof(input));
+
+ RunRequest runRequest = new RunRequest(
+ agentId,
+ input.ToList(),
+ conversationId,
+ metadata ?? new ChangeTrackingDictionary(),
+ options,
+ userId,
+ agentConfiguration,
+ null);
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await RunAsync(runRequest.ToRequestContent(), context).ConfigureAwait(false);
+ return Response.FromValue(OneDP.Run.FromResponse(response), response);
+ }
+
+ /// Creates and waits for a run to finish, returning the completed Run (including its outputs).
+ /// The list of input messages for the run.
+ /// Unique identifier for the agent responsible for the run. This is optional (not needeed) when doing a run using ephemeral agent.
+ /// Optional identifier for an existing conversation.
+ /// Optional metadata associated with the run request.
+ /// Optional configuration for run generation.
+ /// Identifier for the user making the request.
+ /// The agent configuration when not using a previously created agent.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual Response Run(IEnumerable input, string agentId = null, string conversationId = null, IReadOnlyDictionary metadata = null, RunOptions options = null, string userId = null, AgentConfigurationOptions agentConfiguration = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(input, nameof(input));
+
+ RunRequest runRequest = new RunRequest(
+ agentId,
+ input.ToList(),
+ conversationId,
+ metadata ?? new ChangeTrackingDictionary(),
+ options,
+ userId,
+ agentConfiguration,
+ null);
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = Run(runRequest.ToRequestContent(), context);
+ return Response.FromValue(OneDP.Run.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Creates and waits for a run to finish, returning the completed Run (including its outputs).
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual async Task RunAsync(RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.Run");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateRunRequest(content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Creates and waits for a run to finish, returning the completed Run (including its outputs).
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ /// -
+ ///
+ /// Please try the simpler convenience overload with strongly typed models first.
+ ///
+ ///
+ ///
+ ///
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ ///
+ public virtual Response Run(RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Agents.Run");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateRunRequest(content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// The most basic operation.
+ /// The list of input messages for the run.
+ /// Unique identifier for the agent responsible for the run. This is optional (not needeed) when doing a run using ephemeral agent.
+ /// Optional identifier for an existing conversation.
+ /// Optional metadata associated with the run request.
+ /// Optional configuration for run generation.
+ /// Identifier for the user making the request.
+ /// The agent configuration when not using a previously created agent.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual async Task StreamAsync(IEnumerable input, string agentId = null, string conversationId = null, IReadOnlyDictionary metadata = null, RunOptions options = null, string userId = null, AgentConfigurationOptions agentConfiguration = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(input, nameof(input));
+
+ StreamRequest streamRequest = new StreamRequest(
+ agentId,
+ input.ToList(),
+ conversationId,
+ metadata ?? new ChangeTrackingDictionary(),
+ options,
+ userId,
+ agentConfiguration,
+ null);
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await StreamAsync(streamRequest.ToRequestContent(), context).ConfigureAwait(false);
+ return response;
+ }
+
+ /// The most basic operation.
+ /// The list of input messages for the run.
+ /// Unique identifier for the agent responsible for the run. This is optional (not needeed) when doing a run using ephemeral agent.
+ /// Optional identifier for an existing conversation.
+ /// Optional metadata associated with the run request.
+ /// Optional configuration for run generation.
+ /// Identifier for the user making the request.
+ /// The agent configuration when not using a previously created agent.
+ /// The cancellation token to use.
+ /// is null.
+ ///
+ public virtual Response Stream(IEnumerable input, string agentId = null, string conversationId = null, IReadOnlyDictionary metadata = null, RunOptions options = null, string userId = null, AgentConfigurationOptions agentConfiguration = null, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(input, nameof(input));
+
+ StreamRequest streamRequest = new StreamRequest(
+ agentId,
+ input.ToList(),
+ conversationId,
+ metadata ?? new ChangeTrackingDictionary