mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
current task might swith different sys prompt
This commit is contained in:
parent
6b2fb95e66
commit
9d0f19aeee
1 changed files with 3 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ import asyncio
|
|||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from metagpt.actions import CollectLinks, ConductResearch, WebBrowseAndSummarize
|
||||
from metagpt.actions import Action, CollectLinks, ConductResearch, WebBrowseAndSummarize
|
||||
from metagpt.actions.research import get_research_system_text
|
||||
from metagpt.const import RESEARCH_PATH
|
||||
from metagpt.logs import logger
|
||||
|
|
@ -46,7 +46,7 @@ class Researcher(Role):
|
|||
else:
|
||||
topic = msg.content
|
||||
|
||||
research_system_text = self.research_system_text(topic)
|
||||
research_system_text = self.research_system_text(topic, todo)
|
||||
if isinstance(todo, CollectLinks):
|
||||
links = await todo.run(topic, 4, 4)
|
||||
ret = Message("", Report(topic=topic, links=links), role=self.profile, cause_by=type(todo))
|
||||
|
|
@ -64,7 +64,7 @@ class Researcher(Role):
|
|||
self._rc.memory.add(ret)
|
||||
return ret
|
||||
|
||||
def research_system_text(self, topic) -> str:
|
||||
def research_system_text(self, topic, current_task: Action) -> str:
|
||||
""" BACKWARD compatible
|
||||
This allows sub-class able to define its own system prompt based on topic.
|
||||
return the previous implementation to have backward compatible
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue