diff --git a/CS/console-ai-extension/Program.cs b/CS/console-ai-extension/Program.cs index b69ee9c..0e7347d 100644 --- a/CS/console-ai-extension/Program.cs +++ b/CS/console-ai-extension/Program.cs @@ -49,9 +49,9 @@ public SampleAITextModifier() //defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(ollamaChatClient); ///To register Azure OpenAI - AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); - defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(azureOpenAIClient.AsChatClient(DeploymentName)); + IChatClient client = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)).GetChatClient(DeploymentName).AsIChatClient(); + defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(client); } public void ChangeDefaults() diff --git a/CS/console-ai-extension/Runtime-AI-Extensions.csproj b/CS/console-ai-extension/Runtime-AI-Extensions.csproj index f908133..f48d6e1 100644 --- a/CS/console-ai-extension/Runtime-AI-Extensions.csproj +++ b/CS/console-ai-extension/Runtime-AI-Extensions.csproj @@ -9,10 +9,10 @@ - - - - + + + + diff --git a/CS/winforms-ai-extensions/Program.cs b/CS/winforms-ai-extensions/Program.cs index 37d66a5..35e8149 100644 --- a/CS/winforms-ai-extensions/Program.cs +++ b/CS/winforms-ai-extensions/Program.cs @@ -32,9 +32,9 @@ private static void RegisterDevExpressAI() ///To register Ollama //OllamaChatClient ollamaChatClient = new OllamaChatClient("http://localhost:11434/", "llama3.1"); - AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); - AIExtensionsContainerDesktop.Default.RegisterChatClient(azureOpenAIClient.AsChatClient(DeploymentName)); + IChatClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)).GetChatClient(DeploymentName).AsIChatClient(); ; + AIExtensionsContainerDesktop.Default.RegisterChatClient(azureOpenAIClient); } } } diff --git a/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj b/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj index 0b6448f..5b0efe6 100644 --- a/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj +++ b/CS/winforms-ai-extensions/WinForms-AI-Extensions.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/CS/wpf-ai-extensions/App.xaml.cs b/CS/wpf-ai-extensions/App.xaml.cs index 387471a..901559c 100644 --- a/CS/wpf-ai-extensions/App.xaml.cs +++ b/CS/wpf-ai-extensions/App.xaml.cs @@ -5,6 +5,7 @@ using System.Configuration; using System.Data; using System.Windows; +using System.Windows.Media.Media3D; namespace WPF_AI_Extensions { @@ -31,8 +32,8 @@ protected override void OnStartup(StartupEventArgs e) //OllamaChatClient ollamaChatClient = new OllamaChatClient("http://localhost:11434/", "llama3.1"); IChatClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)) - .AsChatClient(DeploymentName); + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)).GetChatClient(DeploymentName).AsIChatClient(); + AIExtensionsContainerDesktop.Default.RegisterChatClient(azureOpenAIClient); } } } diff --git a/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj b/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj index d367fe5..ffbb0ef 100644 --- a/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj +++ b/CS/wpf-ai-extensions/WPF-AI-Extensions.csproj @@ -10,10 +10,10 @@ - - - - + + + + diff --git a/README.md b/README.md index 754cfb0..d5ee5bd 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,13 @@ Install the following NuGet packages: 4. Microsoft.Extensions.AI.OpenAI > [!Note] -> We use the following versions of the `Microsoft.Extensions.AI.*` libraries in our source code: +> We use the following versions of the `Microsoft.Extensions.AI.*` libraries in our `v25.1.3+` source code: > -> v24.2.6+ | **9.3.0-preview.1.25161.3** +> `Microsoft.Extensions.AI` | *9.5.0* +> `Microsoft.Extensions.AI.Abstractions` | *9.5.0* +> `Microsoft.Extensions.AI.OpenAI` | *9.5.0-preview.1.25265.7* > -> We do not guarantee compatibility or correct operation with higher versions. Refer to the following announcement for additional information: [Microsoft.Extensions.AI.Abstractions NuGet Package Version Upgrade in v24.2.6](https://community.devexpress.com/blogs/news/archive/2025/03/12/important-announcement-microsoft-extensions-ai-abstractions-nuget-package-version-upgrade.aspx). +> We do not guarantee compatibility or correct operation with higher versions. Refer to the following announcement for additional information: [DevExpress.AIIntegration moves to a stables version](https://supportcenter.devexpress.com/ticket/details/t1292705/devexpress-aiintegration-references-stable-versions-of-microsoft-ai-packages). ### Register AI Services @@ -55,9 +57,9 @@ public SampleAITextModifier() //defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(ollamaChatClient); ///To register Azure OpenAI - AzureOpenAIClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), - new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)); - defaultAIContainer = AIExtensionsContainerConsole.CreateDefaultAIExtensionContainer(azureOpenAIClient.AsChatClient(DeploymentName)); + IChatClient azureOpenAIClient = new AzureOpenAIClient(new Uri(AzureOpenAIEndpoint), + new System.ClientModel.ApiKeyCredential(AzureOpenAIKey)).GetChatClient(DeploymentName).AsIChatClient(); + AIExtensionsContainerDesktop.Default.RegisterChatClient(azureOpenAIClient); } ```