Skip to content

Commit cffccf9

Browse files
committed
Add ApiApprovalTests for public facing methods
1 parent 45735c5 commit cffccf9

File tree

6 files changed

+92
-2
lines changed

6 files changed

+92
-2
lines changed

src/Sentry.Extensions.AI/Sentry.Extensions.AI.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net9.0;net8.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>$(CurrentTfms);netstandard2.0</TargetFrameworks>
55
<PackageTags>$(PackageTags);Microsoft.Extensions.AI;AI;LLM</PackageTags>
66
<Description>Microsoft.Extensions.AI integration for Sentry - captures AI Agent telemetry spans per Sentry AI Agents module.</Description>
77
</PropertyGroup>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace Microsoft.Extensions.AI
2+
{
3+
public static class SentryAIExtensions
4+
{
5+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
6+
public static Microsoft.Extensions.AI.IChatClient AddSentry(this Microsoft.Extensions.AI.IChatClient client, System.Action<Sentry.Extensions.AI.SentryAIOptions>? configure = null) { }
7+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
8+
public static Microsoft.Extensions.AI.ChatOptions AddSentryToolInstrumentation(this Microsoft.Extensions.AI.ChatOptions options) { }
9+
}
10+
}
11+
namespace Sentry.Extensions.AI
12+
{
13+
public class SentryAIOptions
14+
{
15+
public SentryAIOptions() { }
16+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
17+
public Sentry.Extensions.AI.SentryAIOptions.SentryAIExperimentalOptions Experimental { get; set; }
18+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
19+
public sealed class SentryAIExperimentalOptions
20+
{
21+
public string AgentName { get; set; }
22+
public bool RecordInputs { get; set; }
23+
public bool RecordOutputs { get; set; }
24+
}
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace Microsoft.Extensions.AI
2+
{
3+
public static class SentryAIExtensions
4+
{
5+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
6+
public static Microsoft.Extensions.AI.IChatClient AddSentry(this Microsoft.Extensions.AI.IChatClient client, System.Action<Sentry.Extensions.AI.SentryAIOptions>? configure = null) { }
7+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
8+
public static Microsoft.Extensions.AI.ChatOptions AddSentryToolInstrumentation(this Microsoft.Extensions.AI.ChatOptions options) { }
9+
}
10+
}
11+
namespace Sentry.Extensions.AI
12+
{
13+
public class SentryAIOptions
14+
{
15+
public SentryAIOptions() { }
16+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
17+
public Sentry.Extensions.AI.SentryAIOptions.SentryAIExperimentalOptions Experimental { get; set; }
18+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
19+
public sealed class SentryAIExperimentalOptions
20+
{
21+
public string AgentName { get; set; }
22+
public bool RecordInputs { get; set; }
23+
public bool RecordOutputs { get; set; }
24+
}
25+
}
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace Microsoft.Extensions.AI
2+
{
3+
public static class SentryAIExtensions
4+
{
5+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
6+
public static Microsoft.Extensions.AI.IChatClient AddSentry(this Microsoft.Extensions.AI.IChatClient client, System.Action<Sentry.Extensions.AI.SentryAIOptions>? configure = null) { }
7+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
8+
public static Microsoft.Extensions.AI.ChatOptions AddSentryToolInstrumentation(this Microsoft.Extensions.AI.ChatOptions options) { }
9+
}
10+
}
11+
namespace Sentry.Extensions.AI
12+
{
13+
public class SentryAIOptions
14+
{
15+
public SentryAIOptions() { }
16+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
17+
public Sentry.Extensions.AI.SentryAIOptions.SentryAIExperimentalOptions Experimental { get; set; }
18+
[System.Diagnostics.CodeAnalysis.Experimental("SENTRY0001")]
19+
public sealed class SentryAIExperimentalOptions
20+
{
21+
public string AgentName { get; set; }
22+
public bool RecordInputs { get; set; }
23+
public bool RecordOutputs { get; set; }
24+
}
25+
}
26+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using Microsoft.Extensions.AI;
2+
3+
namespace Sentry.Extensions.AI.Tests;
4+
5+
public class ApiApprovalTests
6+
{
7+
[Fact]
8+
public Task Run()
9+
{
10+
return typeof(SentryAIExtensions).Assembly.CheckApproval();
11+
}
12+
}

test/Sentry.Extensions.AI.Tests/Sentry.Extensions.AI.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
4+
<TargetFrameworks>$(CurrentTfms)</TargetFrameworks>
55
</PropertyGroup>
66

77
<ItemGroup>

0 commit comments

Comments
 (0)