fix: regExp issue

This commit is contained in:
mingholy.lmh
2025-09-18 20:24:35 +08:00
parent 7fd6a8b73d
commit bb9820d27f

View File

@@ -811,13 +811,13 @@ function getToolCallExamples(model?: string): string {
} }
// Enhanced regex-based model detection // Enhanced regex-based model detection
if (model) { if (model && model.length < 100) {
// Match qwen*-coder patterns (e.g., qwen3-coder, qwen2.5-coder, qwen-coder) // Match qwen*-coder patterns (e.g., qwen3-coder, qwen2.5-coder, qwen-coder)
if (/qwen.*-coder/i.test(model)) { if (/qwen[^-]*-coder/i.test(model)) {
return qwenCoderToolCallExamples; return qwenCoderToolCallExamples;
} }
// Match qwen*-vl patterns (e.g., qwen-vl, qwen2-vl, qwen3-vl) // Match qwen*-vl patterns (e.g., qwen-vl, qwen2-vl, qwen3-vl)
if (/qwen.*-vl/i.test(model)) { if (/qwen[^-]*-vl/i.test(model)) {
return qwenVlToolCallExamples; return qwenVlToolCallExamples;
} }
} }