From 4ceff0ec29051033e00a55a2c984d1616c0314f5 Mon Sep 17 00:00:00 2001 From: better629 Date: Mon, 15 Jan 2024 14:48:31 +0800 Subject: [PATCH] add prompt_schema --- metagpt/actions/action_node.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/metagpt/actions/action_node.py b/metagpt/actions/action_node.py index b511f2662..4f61af4ed 100644 --- a/metagpt/actions/action_node.py +++ b/metagpt/actions/action_node.py @@ -86,7 +86,7 @@ Compare the key's value of nodes_output and the corresponding requirements one b {constraint} ## action -Follow format example's json format, generate output and make sure it follows the format example. +Follow format example's {prompt_schema} format, generate output and make sure it follows the format example. """ REVISE_TEMPLATE = """ @@ -108,7 +108,7 @@ change the nodes_output key's value to meet its comment and no need to add extra {constraint} ## action -Follow format example's json format, generate output and make sure it follows the format example. +Follow format example's {prompt_schema} format, generate output and make sure it follows the format example. """ @@ -469,7 +469,8 @@ class ActionNode: return dict() prompt = template.format( - nodes_output=json.dumps(nodes_output, ensure_ascii=False), tag=TAG, constraint=FORMAT_CONSTRAINT + nodes_output=json.dumps(nodes_output, ensure_ascii=False), tag=TAG, constraint=FORMAT_CONSTRAINT, + prompt_schema="json" ) content = await self.llm.aask(prompt) @@ -567,6 +568,7 @@ class ActionNode: example=example, instruction=instruction, constraint=FORMAT_CONSTRAINT, + prompt_schema="json" ) # step2, use `_aask_v1` to get revise structure result