mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
update for no_udf_found.
This commit is contained in:
parent
9651cdd735
commit
86e320be11
1 changed files with 4 additions and 1 deletions
|
|
@ -211,13 +211,16 @@ class WriteCodeWithUDFs(WriteCodeByGenerate):
|
|||
from metagpt.tools.functions.libs.udf import UDFS
|
||||
|
||||
DEFAULT_SYSTEM_MSG = f"""Please remember these functions, you will use these functions to write code:\n
|
||||
{UDFS}
|
||||
{UDFS}, **Notice: 1. if no right udf for user requirement, please send `No udf found`**
|
||||
"""
|
||||
|
||||
async def aask_code_and_text(self, context: List[Dict], **kwargs) -> Tuple[str]:
|
||||
rsp = await self.llm.acompletion(context, **kwargs)
|
||||
rsp_content = self.llm.get_choice_text(rsp)
|
||||
code = CodeParser.parse_code(None, rsp_content)
|
||||
if code.startswith('No udf found') or rsp_content.startswith('No udf found'):
|
||||
rsp_content = 'No udf found'
|
||||
code = 'No udf found'
|
||||
return code, rsp_content
|
||||
|
||||
async def run(self, context: List[Message], plan: Plan = None, task_guide: str = "", **kwargs) -> str:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue