按照要求修改

This commit is contained in:
zhouzinimg 2023-10-16 22:53:28 +08:00
parent e2af76fb08
commit f3c7da32a0
41 changed files with 342 additions and 944 deletions

View file

@ -22,7 +22,7 @@ class Action(ABC):
def __init__(self, name: str = "", context=None, llm: LLM = None):
self.name: str = name
if llm is None:
llm=LLM.DEFAULT_LLM
llm = LLM()
self.llm = llm
self.context = context
self.prefix = ""

View file

@ -207,5 +207,11 @@ class WriteDesign(Action):
prompt = prompt_template.format(context=context, format_example=format_example)
# system_design = await self._aask(prompt)
system_design = await self._aask_v1(prompt, "system_design", OUTPUT_MAPPING, format=format)
# fix Python package name, we can't system_design.instruct_content.python_package_name = "xxx" since "Python package name" contain space, have to use setattr
setattr(
system_design.instruct_content,
"Python package name",
system_design.instruct_content.dict()["Python package name"].strip().strip("'").strip('"'),
)
await self._save(context, system_design)
return system_design