Add custom categories feature
- Add support for user-defined custom categories in config.toml - Update Config struct with categories field and default_categories() function - Thread categories through GeminiClient and prompt builder - Update AI prompts to use dynamic categories instead of hardcoded ones - Add comprehensive documentation with examples for different use cases - Update tests to support new categories field - Maintain backward compatibility with default categories - Update version from 1.0.3 to 1.0.4 Closes feature request for custom categories.
This commit is contained in:
@@ -29,12 +29,13 @@ impl PromptBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_categorization_prompt(&self) -> String {
|
||||
pub fn build_categorization_prompt(&self, categories: &[String]) -> String {
|
||||
let categories_str = categories.join("', '");
|
||||
format!(
|
||||
"I have these files in my Downloads folder: [{}]. \
|
||||
Categorize them into these folders: 'Images', 'Documents', 'Installers', 'Music', 'Archives', 'Code', 'Misc'. \
|
||||
Categorize them into these folders: '{}'. \
|
||||
Return ONLY a JSON object with this structure: {{ 'files': [ {{ 'filename': 'name', 'category': 'folder' }} ] }}",
|
||||
self.file_list
|
||||
self.file_list, categories_str
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user