mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-27 14:25:20 +02:00
set the plan.current_task.task_type to udf when use udfs.
This commit is contained in:
parent
6ed432205b
commit
8afac012b4
1 changed files with 3 additions and 0 deletions
|
|
@ -175,6 +175,8 @@ class MLEngineer(Role):
|
|||
logger.warning("Writing code with user-defined function tools...")
|
||||
logger.info(f"Local user defined function as following:\
|
||||
\n{json.dumps(list(UDFS_YAML.keys()), indent=2, ensure_ascii=False)}")
|
||||
# set task_type to `udf`
|
||||
self.plan.current_task.task_type = 'udf'
|
||||
tool_context, code = await WriteCodeWithTools(schema_path=UDFS_YAML).run(
|
||||
context=context,
|
||||
plan=self.plan,
|
||||
|
|
@ -184,6 +186,7 @@ class MLEngineer(Role):
|
|||
cause_by = WriteCodeWithTools
|
||||
else:
|
||||
logger.info("Write code with pure generation")
|
||||
# TODO: 添加基于current_task.instruction-code_path的k-v缓存
|
||||
code = await WriteCodeByGenerate().run(
|
||||
context=context, plan=self.plan, temperature=0.0
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue