🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
researcher allow override system prompt
paulaanc92793c27cea
diff --git a/metagpt/roles/researcher.py b/metagpt/roles/researcher.pyindex c5512121a..f954c60bb 100644--- a/metagpt/roles/researcher.py+++ b/metagpt/roles/researcher.py@@ -46,7 +46,7 @@ class Researcher(Role):else:topic = msg.content- research_system_text = get_research_system_text(topic, self.language)+ research_system_text = self.research_system_text(topic)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,6 +64,17 @@ class Researcher(Role):self._rc.memory.add(ret)return ret+ def research_system_text(self, topic) -> 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+ Args:+ topic:+ language:++ Returns: str+ """+ return get_research_system_text(topic, self.language)async def react(self) -> Message:msg = await super().react()report = msg.instruct_content