diff --git a/src/AnthropicClient/Models/Tool.cs b/src/AnthropicClient/Models/Tool.cs index d5d0d1b..ed61992 100644 --- a/src/AnthropicClient/Models/Tool.cs +++ b/src/AnthropicClient/Models/Tool.cs @@ -12,11 +12,6 @@ namespace AnthropicClient.Models; /// public class Tool { - // Anthropic imposes a limit on tool names. Tool names must be... - // - between 1 and 64 characters long - // - contain only letters, numbers, underscores, and hyphens - private readonly Regex _nameRegex = new(@"^[a-zA-Z0-9_-]{1,64}$"); - /// /// Gets the name of the tool. This name will conform to the Anthropic tool naming rules. /// @@ -51,6 +46,9 @@ public class Tool ArgumentValidator.ThrowIfNullOrWhitespace(description, nameof(description)); ArgumentValidator.ThrowIfNull(function, nameof(function)); + // Anthropic imposes a limit on tool names. Tool names must be... + // - between 1 and 64 characters long + // - contain only letters, numbers, underscores, and hyphens var sanitizedName = SanitizeName(name); Name = sanitizedName;