feat: Add systemPromptMappings Configuration Feature (#108)

* feat: update system prompt for qwen3-coder

* feat: add default systemPromptMappings for Qwen models

- Add default systemPromptMappings configuration for qwen3-coder-plus model
- Support DashScope compatible mode API endpoints
- Include Qwen coder system prompt template with git repository and sandbox placeholders
- Add comprehensive test coverage for default and custom systemPromptMappings
- Update documentation to reflect the new default configuration behavior
- Ensure backward compatibility with existing user configurations

* feat: remove default system prompt template

* fix: test ci

* feat: handle code indentation issues

* feat: update prompt.test.snapshots

* feat: add URL trailing slash compatibility for system prompt mappings

- Add normalizeUrl() function to standardize URLs by removing trailing slashes
- Add urlMatches() function to compare URLs ignoring trailing slash differences
- Replace direct includes() comparison with urlMatches() for baseUrl matching
- Add comprehensive tests to verify URL matching with/without trailing slashes
- Fixes issue where URLs like 'https://api.example.com' and 'https://api.example.com/' were treated as different

* feat: update code
This commit is contained in:
pomelo
2025-07-29 13:11:41 +08:00
committed by GitHub
parent dc087deace
commit bd0d3479c1
10 changed files with 342 additions and 11 deletions

View File

@@ -96,6 +96,13 @@ export interface Settings {
max_tokens?: number;
};
// System prompt mappings for different base URLs and model names
systemPromptMappings?: Array<{
baseUrls?: string[];
modelNames?: string[];
template?: string;
}>;
// Add other settings here.
ideMode?: boolean;
}