fix: use json object type
This commit is contained in:
@@ -25,7 +25,7 @@ public class Tool
|
||||
/// Gets the input schema of the tool.
|
||||
/// </summary>
|
||||
[JsonPropertyName("input_schema")]
|
||||
public JsonNode InputSchema { get; }
|
||||
public JsonObject InputSchema { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 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<T1, TResult>(string name, string description, Func<T1, TResult> 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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user