Fixed answers breaking off after an invalid tool call (#1036)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-10-09 21:25:23 +02:00
1 parent b895cf674b
commit 88f71d2405
6 files changed
+202 -32

No files matched your search

@@ -193,7 +193,7 @@ public sealed class ToolRegistry
return false;
}
if (!IsValidFunctionName(definition.Function.Name))
if (!ToolExecutor.IsValidFunctionName(definition.Function.Name))
{
issue = "the function name must contain 1-64 ASCII letters, digits, underscores, or hyphens";
return false;
@@ -279,11 +279,6 @@ public sealed class ToolRegistry
return true;
}
private static bool IsValidFunctionName(string? functionName) =>
!string.IsNullOrWhiteSpace(functionName) &&
functionName.Length <= 64 &&
functionName.All(character => char.IsAsciiLetterOrDigit(character) || character is '_' or '-');
public IReadOnlyList<ToolDefinition> GetDefinitionsForComponent(Components component)
{
return this.definitionsById.Values