feat(prompt) support configurable prompt template directories#1096
Open
feat(prompt) support configurable prompt template directories#1096
Conversation
|
Failed to generate code suggestions for PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Related Issue
Type of Change
Changes Made
第一,给 prompt 模板目录加了可配置能力。PromptManager 现在会按这个优先级选目录:显式传入参数、环境变量
OPENVIKING_PROMPT_TEMPLATES_DIR、ov.conf 里的 prompts.templates_dir、最后才是内置目录。实现入口在 openviking/prompts/
manager.py:63,配置模型加在 openviking_cli/utils/config/open_viking_config.py:154 和 openviking_cli/utils/config/
prompts_config.py:8。
第二,把自定义模板目录做成了“局部覆盖”而不是“整套替换”。也就是用户只放改过的 prompt 文件就行,某个 prompt 在自定义目录里
找不到时,会自动回退到内置 openviking/prompts/templates。这个 fallback 逻辑在openviking/prompts/manager.py:141。
Testing
Checklist
Screenshots (if applicable)
Additional Notes