mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-10-11 11:53:48 +00:00
Fixed answers breaking off after an invalid tool call (#1036)
This commit is contained in:
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
|
||||
|
||||
Reference in new issue
Block a user