MeshWeaver.AI
2.3.0
dotnet add package MeshWeaver.AI --version 2.3.0
NuGet\Install-Package MeshWeaver.AI -Version 2.3.0
<PackageReference Include="MeshWeaver.AI" Version="2.3.0" />
<PackageVersion Include="MeshWeaver.AI" Version="2.3.0" />
<PackageReference Include="MeshWeaver.AI" />
paket add MeshWeaver.AI --version 2.3.0
#r "nuget: MeshWeaver.AI, 2.3.0"
#:package MeshWeaver.AI@2.3.0
#addin nuget:?package=MeshWeaver.AI&version=2.3.0
#tool nuget:?package=MeshWeaver.AI&version=2.3.0
MeshWeaver.AI
Overview
MeshWeaver.AI provides AI integration capabilities for the MeshWeaver framework, enabling AI-powered features and services within your applications. This library connects MeshWeaver applications with Azure OpenAI and other AI services for natural language processing, content generation, and intelligent assistance.
Features
- AI Service Integration: Connect to Azure OpenAI and other AI services
- Chat Functionality: Built-in support for chat completions and conversations
- Function Calling: Execute functions directly from AI models
- Progress Tracking: Real-time AI operation progress monitoring
- Credential Management: Secure management of AI service credentials
- Custom Model Support: Configure and use different AI models based on requirements
Usage
Basic Configuration
// In Program.cs or Startup.cs
using MeshWeaver.AI;
var builder = WebApplication.CreateBuilder(args);
// Add AI services to the DI container
builder.Services.AddAI(config => config
.WithSystemPrompt("You are a helpful assistant.")
.WithModels("gpt-4.1-mini", "o3-mini"));
// Configure AI credentials
builder.Services.Configure<AICredentialsConfiguration>(builder.Configuration.GetSection("AI"));
Using the Chat Service
public class MyService
{
private readonly IChatService _chatService;
public MyService(IChatService chatService)
{
_chatService = chatService;
}
public async Task<string> GetAIResponse(string userMessage)
{
var client = _chatService.Get();
var response = await client.CompleteChat(userMessage);
return response;
}
}
Configuration
The AI services require proper configuration in your application's settings:
{
"AI": {
"Url": "https://your-azure-openai-endpoint.com",
"ApiKey": "your-api-key-here",
"Models": ["o3-mini"]
}
}
Integration with MeshWeaver
- Works with MeshWeaver.Messaging.Hub for message-based AI operations
- Integrates with MeshWeaver.Blazor.Chat for UI components
- Compatible with both monolithic and Orleans hosting
- Supports real-time updates through MeshWeaver layout system
Related Projects
- MeshWeaver.Blazor.Chat - Blazor UI components for chat interfaces
- MeshWeaver.Messaging.Hub - Core messaging for AI communications
See Also
Refer to the main MeshWeaver documentation for more information about the overall architecture.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net9.0
- Azure.AI.OpenAI (>= 2.2.0-beta.4)
- Azure.Core (>= 1.46.2)
- MeshWeaver.Application.Styles (>= 2.3.0)
- MeshWeaver.ContentCollections (>= 2.3.0)
- MeshWeaver.Data (>= 2.3.0)
- MeshWeaver.Data.Contract (>= 2.3.0)
- MeshWeaver.Messaging.Hub (>= 2.3.0)
- Microsoft.Extensions.AI (>= 9.6.0)
- Microsoft.Extensions.AI.Abstractions (>= 9.6.0)
- Microsoft.Extensions.AI.OpenAI (>= 9.6.0-preview.1.25310.2)
- Microsoft.SemanticKernel.Agents.Core (>= 1.57.0)
- OpenAI (>= 2.2.0-beta.4)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on MeshWeaver.AI:
Package | Downloads |
---|---|
MeshWeaver.AI.Application
Package Description |
|
MeshWeaver.Blazor.Chat
Package Description |
|
MeshWeaver.AI.AzureOpenAI
Package Description |
|
MeshWeaver.AI.AzureFoundry
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.