Update Microsoft.Extensions.AI version & expose JSON configuration on McpServerResourceCreateOptions (#511)
* Update Microsoft.Extensions.AI version * Update Microsoft.Extensions.AI.OpenAI * Fix failing tests; add JSON configuration options to McpServerResourceCreateOptions. * Replace temporary code with `AIFunction.ReturnJsonSchema` --------- Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
This commit is contained in:
parent
1e8fb04037
commit
28d65470f4
1 changed files with 45 additions and 35 deletions
|
|
@ -451,7 +451,7 @@ public partial class McpServerResourceTests
|
|||
{
|
||||
Assert.Same(mockServer.Object, server);
|
||||
return new TextResourceContents() { Text = "hello" };
|
||||
}, new() { Name = "Test" });
|
||||
}, new() { Name = "Test", SerializerOptions = JsonContext6.Default.Options });
|
||||
var result = await resource.ReadAsync(
|
||||
new RequestContext<ReadResourceRequestParams>(mockServer.Object) { Params = new() { Uri = "resource://Test" } },
|
||||
TestContext.Current.CancellationToken);
|
||||
|
|
@ -507,7 +507,7 @@ public partial class McpServerResourceTests
|
|||
{
|
||||
Assert.Same(mockServer.Object, server);
|
||||
return new List<string>() { "42", "43" };
|
||||
}, new() { Name = "Test" });
|
||||
}, new() { Name = "Test", SerializerOptions = JsonContext6.Default.Options });
|
||||
var result = await resource.ReadAsync(
|
||||
new RequestContext<ReadResourceRequestParams>(mockServer.Object) { Params = new() { Uri = "resource://Test" } },
|
||||
TestContext.Current.CancellationToken);
|
||||
|
|
@ -547,7 +547,7 @@ public partial class McpServerResourceTests
|
|||
new TextContent("hello!"),
|
||||
new DataContent(new byte[] { 4, 5, 6 }, "application/json"),
|
||||
};
|
||||
}, new() { Name = "Test" });
|
||||
}, new() { Name = "Test", SerializerOptions = JsonContext6.Default.Options });
|
||||
var result = await resource.ReadAsync(
|
||||
new RequestContext<ReadResourceRequestParams>(mockServer.Object) { Params = new() { Uri = "resource://Test" } },
|
||||
TestContext.Current.CancellationToken);
|
||||
|
|
@ -575,5 +575,8 @@ public partial class McpServerResourceTests
|
|||
|
||||
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
|
||||
[JsonSerializable(typeof(DisposableResourceType))]
|
||||
[JsonSerializable(typeof(List<AIContent>))]
|
||||
[JsonSerializable(typeof(List<string>))]
|
||||
[JsonSerializable(typeof(TextResourceContents))]
|
||||
partial class JsonContext6 : JsonSerializerContext;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue