mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-06 05:09:09 +08:00
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
0ac3a2dd72
commit
2cac432512
@ -65,8 +65,8 @@ export function buildFunctionCallToolName(serverName: string, toolName: string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Replace invalid characters with underscores
|
// Replace invalid characters with underscores
|
||||||
// Keep only a-z, A-Z, 0-9, underscores, dashes, dots, colons (AI model compatible)
|
// Keep only a-z, 0-9, underscores, dashes, dots, colons (AI model compatible)
|
||||||
name = name.replace(/[^a-zA-Z0-9_.\-:]/g, '_')
|
name = name.replace(/[^a-z0-9_.\-:]/g, '_')
|
||||||
|
|
||||||
// Ensure name starts with a letter or underscore (AI model requirement)
|
// Ensure name starts with a letter or underscore (AI model requirement)
|
||||||
if (!/^[a-zA-Z_]/.test(name)) {
|
if (!/^[a-zA-Z_]/.test(name)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user