mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
fix output code format
This commit is contained in:
parent
976df80074
commit
aa92662487
1 changed files with 5 additions and 1 deletions
|
|
@ -31,8 +31,12 @@ class WriteAnalysisCode(Action):
|
|||
|
||||
rsp = await self._aask(reflection_prompt, system_msgs=[REFLECTION_SYSTEM_MSG])
|
||||
reflection = json.loads(CodeParser.parse_code(text=rsp))
|
||||
try:
|
||||
improved_impl = CodeParser.parse_code(text=reflection["improved_impl"], lang="python")
|
||||
except Exception as e:
|
||||
improved_impl = reflection["improved_impl"]
|
||||
|
||||
return reflection["improved_impl"]
|
||||
return improved_impl
|
||||
|
||||
async def run(
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue