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
|
|
@ -1,4 +1,6 @@
|
|||
using Microsoft.Extensions.AI;
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace ModelContextProtocol.Server;
|
||||
|
||||
|
|
@ -60,6 +62,22 @@ public sealed class McpServerResourceCreateOptions
|
|||
/// </summary>
|
||||
public string? MimeType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JSON serializer options to use when marshalling data to/from JSON.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Defaults to <see cref="McpJsonUtilities.DefaultOptions"/> if left unspecified.
|
||||
/// </remarks>
|
||||
public JsonSerializerOptions? SerializerOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the JSON schema options when creating <see cref="AIFunction"/> from a method.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Defaults to <see cref="AIJsonSchemaCreateOptions.Default"/> if left unspecified.
|
||||
/// </remarks>
|
||||
public AIJsonSchemaCreateOptions? SchemaCreateOptions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a shallow clone of the current <see cref="McpServerResourceCreateOptions"/> instance.
|
||||
/// </summary>
|
||||
|
|
@ -71,5 +89,7 @@ public sealed class McpServerResourceCreateOptions
|
|||
Name = Name,
|
||||
Description = Description,
|
||||
MimeType = MimeType,
|
||||
SerializerOptions = SerializerOptions,
|
||||
SchemaCreateOptions = SchemaCreateOptions,
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue