mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
add only_code arg for WriteCodeByGenerate.
This commit is contained in:
parent
b69f2be165
commit
4f93c5fad3
1 changed files with 7 additions and 1 deletions
|
|
@ -88,8 +88,14 @@ class WriteCodeByGenerate(BaseWriteAnalysisCode):
|
|||
) -> str:
|
||||
# context.append(Message(content=self.REUSE_CODE_INSTRUCTION, role="user"))
|
||||
prompt = self.process_msg(context, system_msg)
|
||||
is_only_code = kwargs.pop("only_code", True)
|
||||
|
||||
code_content = await self.llm.aask_code(prompt, **kwargs)
|
||||
return code_content["code"]
|
||||
if is_only_code:
|
||||
return code_content["code"]
|
||||
else:
|
||||
return code_content
|
||||
|
||||
|
||||
|
||||
class WriteCodeWithTools(BaseWriteAnalysisCode):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue