Syncfusion.Blazor.AI
30.2.7
Prefix Reserved
dotnet add package Syncfusion.Blazor.AI --version 30.2.7
NuGet\Install-Package Syncfusion.Blazor.AI -Version 30.2.7
<PackageReference Include="Syncfusion.Blazor.AI" Version="30.2.7" />
<PackageVersion Include="Syncfusion.Blazor.AI" Version="30.2.7" />
<PackageReference Include="Syncfusion.Blazor.AI" />
paket add Syncfusion.Blazor.AI --version 30.2.7
#r "nuget: Syncfusion.Blazor.AI, 30.2.7"
#:package Syncfusion.Blazor.AI@30.2.7
#addin nuget:?package=Syncfusion.Blazor.AI&version=30.2.7
#tool nuget:?package=Syncfusion.Blazor.AI&version=30.2.7
Syncfusion® Blazor AI
This package provides seamless AI integration capabilities for Blazor applications, supporting various AI services including OpenAI, Azure OpenAI, Ollama, and custom AI providers. It serves as the foundation for Syncfusion's AI-powered components like Smart TextArea and Smart Paste Button.
System Requirements
Key Features
- Multi-provider support (OpenAI, Azure OpenAI, Ollama)
- Easy-to-use extensibility for custom AI services
- Built-in security with antiforgery support
- Foundation for Smart UI components
- Async/await support for all operations
Quick Start Guide
Configuration Guide
To integrate AI capabilities in your Blazor application, configure the services in your Program.cs
:
// Example for OpenAI configuration
builder.Services.AddSingleton(new AIServiceCredentials
{
ApiKey = "your-openai-key",
DeploymentName = "gpt-4", // Model name (e.g., "gpt-4", "gpt-3.5-turbo")
Endpoint = null // Must be null for OpenAI
});
// Example for Azure OpenAI configuration
builder.Services.AddSingleton(new AIServiceCredentials
{
ApiKey = "your-azure-openai-key",
DeploymentName = "your-deployment-name",
Endpoint = new Uri("https://your-openai.azure.com/")
});
// Example for Ollama (local models) configuration
builder.Services.AddSingleton(new AIServiceCredentials
{
DeploymentName = "llama2", // Model name (e.g., "llama2", "mistral", "codellama")
Endpoint = new Uri("http://localhost:11434"),
SelfHosted = true // Required for Ollama
});
// Register inference backend
builder.Services.AddSingleton<IChatInferenceService, SyncfusionAIService>();
Usage Examples
Here's how to use the AI service in your Blazor components:
@inject IChatInferenceService AIService
@code {
private async Task GetAIResponse()
{
var response = await AIService.GenerateResponseAsync(new ChatParameters
{
Messages = new List<ChatMessage>
{
new ChatMessage(ChatRole.System, "You are a helpful assistant."),
new ChatMessage(ChatRole.User, "Hello!")
},
Temperature = 0.7f,
MaxTokens = 100
});
// Handle the response
}
}
Support and Feedback
- For queries, reach our Syncfusion® support team or post the queries through the community forums.
- Request new feature through Syncfusion® feedback portal.
License
This is a commercial product and requires a paid license for possession or use. Syncfusion’s licensed software, including this component, is subject to the terms and conditions of Syncfusion's EULA. You can purchase a license here or start a free 30-day trial here.
About Syncfusion®
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion® has more than 29,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
Today, we provide 1800+ components and frameworks for web (Blazor, ASP.NET Core, ASP.NET MVC, ASP.NET WebForms, JavaScript, Angular, React, Vue, and Flutter), mobile (Xamarin, Flutter, UWP, and JavaScript), and desktop development (WinForms, WPF, WinUI, Flutter and UWP). We provide ready-to-deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
sales@syncfusion.com | www.syncfusion.com | Toll Free: 1-888-9 DOTNET
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- Microsoft.Extensions.AI.OpenAI (>= 9.5.0-preview.1.25265.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.5)
- OllamaSharp (>= 5.1.18)
-
net9.0
- Microsoft.Extensions.AI.OpenAI (>= 9.5.0-preview.1.25265.7)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.5)
- OllamaSharp (>= 5.1.18)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Syncfusion.Blazor.AI:
Package | Downloads |
---|---|
Syncfusion.Blazor.SmartComponents
This package provides the functionality to utilize the features of Syncfusion® Blazor Smart component and more. |
GitHub repositories
This package is not used by any popular GitHub repositories.