Custom AI Service Integration
29 Aug 20251 minute to read
Overview
Syncfusion Smart PDF Viewer provide built-in support for OpenAI and Azure OpenAI services. However, you can also integrate other AI services using the IChatInferenceService
interface, which acts as a bridge between Smart PDF Viewer and your custom AI service.
IChatInferenceService Interface
The IChatInferenceService
interface defines a simple contract for AI service integration:
public interface IChatInferenceService
{
Task<string> GenerateResponseAsync(ChatParameters options);
}
This interface enables:
- Consistent communication between components and AI services
- Easy switching between different AI providers
Implemented AI Services
Here are examples of AI services integrated using the IChatInferenceService
interface:
Service | Documentation |
---|---|
Claude | Claude Integration |
DeepSeek | DeepSeek Integration |
Groq | Groq Integration |
Gemini | Gemini Integration |
Service Registration
Register your custom implementation in Program.cs
:
using Syncfusion.Blazor.AI;
builder.Services.AddSingleton<IChatInferenceService, YourCustomService>();