Change type of Tool.InputSchema to be JsonElement (#4)

* Change type of Tool.InputSchema to be JsonElement

* Add schema validation in the InputSchema property setter.

* Simplify AIFunction tool adapter.

---------

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
This commit is contained in:
Stephen Toub 2025-03-20 13:16:41 -04:00 • committed by GitHub
commit 3de19d38e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,6 +1,7 @@
using System.Threading.Channels;
using ModelContextProtocol.Protocol.Messages;
using ModelContextProtocol.Protocol.Transport;
using ModelContextProtocol.Protocol.Types;
namespace ModelContextProtocol.Tests.Utils;
@ -71,7 +72,7 @@ public class TestServerTransport : IServerTransport
await WriteMessageAsync(new JsonRpcResponse
{
Id = request.Id,
Result = new Protocol.Types.CreateMessageResult { Content = new(), Model = "model", Role = "role" }
Result = new CreateMessageResult { Content = new(), Model = "model", Role = "role" }
}, cancellationToken);
}