mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-04 13:22:39 +02:00
update prompt indention
This commit is contained in:
parent
8d78632dd0
commit
780c68e43f
1 changed files with 5 additions and 5 deletions
|
|
@ -16,9 +16,7 @@ from metagpt.schema import Message, Plan, Task
|
|||
from metagpt.strategy.task_type import TaskType
|
||||
from metagpt.utils.common import CodeParser
|
||||
|
||||
|
||||
class WritePlan(Action):
|
||||
PROMPT_TEMPLATE: str = """
|
||||
PROMPT_TEMPLATE: str = """
|
||||
# Context:
|
||||
{context}
|
||||
# Available Task Types:
|
||||
|
|
@ -39,11 +37,13 @@ Output a list of jsons following the format:
|
|||
...
|
||||
]
|
||||
```
|
||||
"""
|
||||
"""
|
||||
|
||||
|
||||
class WritePlan(Action):
|
||||
async def run(self, context: list[Message], max_tasks: int = 5) -> str:
|
||||
task_type_desc = "\n".join([f"- **{tt.type_name}**: {tt.value.desc}" for tt in TaskType])
|
||||
prompt = self.PROMPT_TEMPLATE.format(
|
||||
prompt = PROMPT_TEMPLATE.format(
|
||||
context="\n".join([str(ct) for ct in context]), max_tasks=max_tasks, task_type_desc=task_type_desc
|
||||
)
|
||||
rsp = await self._aask(prompt)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue