diff --git a/src/AnthropicClient/Models/Tool.cs b/src/AnthropicClient/Models/Tool.cs index 85273f2..b060120 100644 --- a/src/AnthropicClient/Models/Tool.cs +++ b/src/AnthropicClient/Models/Tool.cs @@ -25,7 +25,7 @@ public class Tool /// Gets the input schema of the tool. /// [JsonPropertyName("input_schema")] - public JsonNode InputSchema { get; } + public JsonObject InputSchema { get; } /// /// Gets the function of the tool. @@ -116,4 +116,13 @@ public class Tool return new Tool(name, description, new AnthropicFunction(func.Method, func.Target)); } + + public static Tool CreateFromFunction(string name, string description, Func func) + { + ArgumentValidator.ThrowIfNull(name, nameof(name)); + ArgumentValidator.ThrowIfNull(description, nameof(description)); + ArgumentValidator.ThrowIfNull(func, nameof(func)); + + return new Tool(name, description, new AnthropicFunction(func.Method, func.Target)); + } } \ No newline at end of file