mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-26 15:49:42 +02:00
update CodeParser.parse_code.
This commit is contained in:
parent
a06d8023d6
commit
cff4eff78d
2 changed files with 3 additions and 2 deletions
|
|
@ -251,7 +251,7 @@ class OpenAILLM(BaseLLM):
|
|||
# reponse is code, fix openai tools_call respond bug.
|
||||
code_formats = ("```", '"""', "'''")
|
||||
if message.content.startswith(code_formats) and message.content.endswith(code_formats):
|
||||
code = CodeParser.parse_code(None, message.content, start_ends=r'["\'`]{3}')
|
||||
code = CodeParser.parse_code(None, message.content)
|
||||
return {"language": "python", "code": code}
|
||||
# reponse is message
|
||||
return {"language": "markdown", "code": self.get_choice_text(rsp)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue