getsentry / sentry-dotnet

Sentry SDK for .NET
https://docs.sentry.io/platforms/dotnet
MIT License
599 stars 206 forks source link

Support for Microsoft.Extensions.AI #3762

Open bruno-garcia opened 6 days ago

bruno-garcia commented 6 days ago

Announced last month:

https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/

Sentry's LLM monitoring docs: https://docs.sentry.io/product/insights/ai/llm-monitoring/

SDK docs: https://develop.sentry.dev/sdk/telemetry/traces/modules/llm-monitoring/

Example API:

app.Services.AddChatClient(builder => builder 
    // Add Sentry LLM monitoring
    .UseSentry()    
    .Use(new OpenAIClient(...)).AsChatClient(...)); 

In a new package named: Sentry.Extensions.AI

https://www.nuget.org/packages/Microsoft.Extensions.AI.Abstractions/#versions-body-tab Seems this one didn't leave preview though.