json/markdown format

This commit is contained in:
femto 2023-09-20 12:09:10 +08:00
parent 7ec77e0ad7
commit 0d9bbcb863
6 changed files with 17 additions and 14 deletions

View file

@ -8,10 +8,10 @@
from metagpt.config import CONFIG
def get_template(templates):
selected_templates = templates.get(CONFIG.prompt_format)
def get_template(templates, format=CONFIG.prompt_format):
selected_templates = templates.get(format)
if selected_templates is None:
raise ValueError(f"Can't find {CONFIG.prompt_format} in passed in templates")
raise ValueError(f"Can't find {format} in passed in templates")
# Extract the selected templates
prompt_template = selected_templates["PROMPT_TEMPLATE"]