add template

This commit is contained in:
bridge
2025-08-30 21:04:22 +08:00
parent 34223c8903
commit 12bbfe9df5
2 changed files with 10 additions and 26 deletions

View File

@@ -1,6 +1,15 @@
from litellm import completion
from langchain.prompts import PromptTemplate
from src.utils.config import CONFIG
print(CONFIG)
def get_prompt(template: str, infos: dict) -> str:
"""
根据模板,获取提示词
"""
prompt_template = PromptTemplate(template=template)
return prompt_template.format(**infos)
def call_llm(prompt: str) -> str:
"""
@@ -8,7 +17,6 @@ def call_llm(prompt: str) -> str:
Args:
prompt: 输入的提示词
custom_llm_provider: 自定义的LLM提供者
Returns:
str: LLM返回的结果
"""