DevExpress拥有.NET开发需要的所有平台控件,包含600多个UI控件、报表平台、DevExpress Dashboard eXpressApp 框架、适用于 Visual Studio的CodeRush等一系列辅助工具。屡获大奖的软件开发平台DevExpress 今年第一个重要版本v23.1正式发布,该版本拥有众多新产品和数十个具有高影响力的功能,可为桌面、Web和移动应用提供直观的解决方案,全面解决各种使用场景问题。
DevExpress官方已正式发布v24.2,新版本针对人工智能(AI)方面的功能做了着重加强,欢迎下载最新版产品体验!
DevExpress技术交流群11:749942875 欢迎一起进群讨论
人工智能(AI)
注册聊天客户端
安装DevExpressAIIntegration NuGet包,不管使用哪个提供商,您都必须在DevExpress Extensions Container中注册聊天客户端(管理注册的AI客户端)。
WinForms/WPF
using DevExpress.AIIntegration; using DevExpress.AIIntegration.Extensions; using Microsoft.Extensions.AI; IChatClient myChatClient = GetChatClient(); AIExtensionsContainerDesktop.Default.RegisterChatClient(myChatClient);
Blazor/ASP.NET Core
using DevExpress.AIIntegration; using Microsoft.Extensions.AI; using OpenAI; IChatClient myChatClient = GetChatClient(); builder.Services.AddSingleton(myChatClient); //or reference the Microsoft.Extensions.AI NuGet package and use //builder.Services.AddChatClient(config => config.Use(myChatClient)); builder.Services.AddDevExpressAI();
Azure AI翻译器和AI语言支持
除了对多个服务的AI模型访问外,新版本还实现了与Azure AI语言服务交互的API(包括Azure AI Translator和用于文本摘要的Azure AI语言)。服务的选择取决于项目的预算,请注意在调用以下方法时,文本翻译和摘要请求将专门发送到Azure AI语言服务。
要使用这些服务,安装DevExpress.AIIntegration.Azure.TextAnalytics和/或DevExpress.AIIntegration.Azure.Translation NuGet包并创建TextTranslationClient和/或TextAnalyticsClient:
C#
using Azure; using Azure.AI.Translation.Text; using Azure.AI.TextAnalytics; string azureTranslatorEndpoint = GetEnvironmentVariable("AZURE_TRANSLATOR_ENDPOINT"); string azureTranslatorKey = GetEnvironmentVariable("AZURE_TRANSLATOR_API_KEY"); var translationClient = new TextTranslationClient(new AzureKeyCredential(azureTranslatorKey), new Uri(azureTranslatorEndpoint)); string azureTextAnalyticsEndpoint = GetEnvironmentVariable("AZURE_TEXT_ANALYTICS_ENDPOINT"); string azureTextAnalyticsKey = GetEnvironmentVariable("AZURE_TEXT_ANALYTICS_API_KEY"); var textAnalyticsClient = new TextAnalyticsClient(new Uri(azureTextAnalyticsEndpoint), new AzureKeyCredential(azureTextAnalyticsKey));
使用以下代码在应用程序中注册这些服务:
WinForms/WPF
//Register an Azure.TextTranslation client. AIExtensionsContainerDesktop.Default.RegisterTranslatorAzureAIService(translationClient); //Register an Azure.TextAnalytics client. AIExtensionsContainerDesktop.Default.RegisterTextAnalyticsAzureAIService(textAnalyticsClient);
Blazor/ASP.NET Core
services.AddDevExpressAI(config => config.RegisterTranslatorAzureAIService(translationClient); config.RegisterTextAnalyticsAzureAIService(textAnalyticsClient); );
在UI中启用AI驱动的扩展
要激活DevExpress AI支持的扩展,请查看以下新主题:
- WinForms AI-powered Extensions
- WPF AI-powered Extensions
- Blazor AI-powered Extensions
- Reporting AI-powered Extensions
- XAF AI-powered Extensions
更多产品更新咨询,请戳这里直接咨询>>
更多DevExpress线上公开课、中文教程资讯请上中文网获取
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/5010.html
相关产品: DevExpress WPF Subscription, DevExpress WinForms Subscription, DevExpress Universal Subscription,