create/update all Phi-3 templates

This commit is contained in:
Adam Wilson
2025-07-25 16:35:19 -06:00
parent 23d58675f4
commit a770a5211c
8 changed files with 109 additions and 46 deletions
+5 -5
View File
@@ -8,8 +8,8 @@ class Constants:
ALT_COMPLETION_TEXT = "I can't answer that."
class PromptTemplateIds:
PHI_3_MINI_4K_INSTRUCT__01_BASIC = "phi-3-mini-4k-instruct-basic"
PHI_3_MINI_4K_INSTRUCT__02_ZERO_SHOT_CHAIN_OF_THOUGHT = "phi-3-mini-4k-instruct-zero-shot-cot"
PHI_3_MINI_4K_INSTRUCT__03_FEW_SHOT_EXAMPLES = "phi-3-mini-4k-instruct-few-shot"
PHI_3_MINI_4K_INSTRUCT__04_FEW_SHOT_RAG_PLUS_COT = "phi-3-mini-4k-instruct-few-shot-rag-plus-cot"
PHI_3_MINI_4K_INSTRUCT__05_REFLEXION = "phi-3-mini-4k-instruct-reflexion"
PHI_3_MINI_4K_INSTRUCT__01_BASIC = "phi-3-mini-4k-instruct.01-basic"
PHI_3_MINI_4K_INSTRUCT__02_ZERO_SHOT_CHAIN_OF_THOUGHT = "phi-3-mini-4k-instruct.02-zero-shot-cot"
PHI_3_MINI_4K_INSTRUCT__03_FEW_SHOT_EXAMPLES = "phi-3-mini-4k-instruct.03-few-shot"
PHI_3_MINI_4K_INSTRUCT__04_FEW_SHOT_RAG_PLUS_COT = "phi-3-mini-4k-instruct.04-few-shot-rag-plus-cot"
PHI_3_MINI_4K_INSTRUCT__05_REFLEXION = "phi-3-mini-4k-instruct.05-reflexion"
@@ -54,7 +54,7 @@ class BaseSecurityGuidelinesService(AbstractSecurityGuidelinesService):
raise ValueError(f"Parameter 'user_prompt' cannot be empty or None")
try:
prompt_template = self._get_template(user_prompt=user_prompt)
prompt_template = self._get_template(user_prompt=user_prompt)
chain = self._create_chain(prompt_template)
result = GuidelinesResult(
completion_text=chain.invoke(user_prompt),