tghamm / Anthropic.SDK

An unofficial C#/.NET SDK for accessing the Anthropic Claude API
https://www.nuget.org/packages/Anthropic.SDK
MIT License
55 stars 10 forks source link

Tools with no parameters #35

Closed drusellers closed 2 months ago

drusellers commented 2 months ago

I have a tool that has no parameters. Think like GetNow() when I supply this tool using

    [Function("This function returns the current user's name.")]
    public static Task<string> GetCurrentUser()
    {
        return Task.FromResult("Dru Sellers");
    }

Iget the error

 {"type":"error","error":{"type":"invalid_request_error","message":"tools.0.input_schema: Field required"}}

There is a PR to fix this in Claudia that looks like - https://github.com/Cysharp/Claudia/pull/17