mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-21 14:05:17 +02:00
feat: +knowledge
This commit is contained in:
parent
2c83921aee
commit
6e10cbb73b
3 changed files with 13 additions and 4 deletions
|
|
@ -4,18 +4,21 @@ from metagpt.logs import logger
|
|||
|
||||
|
||||
class TalkAction(Action):
|
||||
def __init__(self, options, name: str = '', talk='', history_summary='', context=None, llm=None, **kwargs):
|
||||
def __init__(self, options, name: str = '', talk='', history_summary='', knowledge='', context=None, llm=None, **kwargs):
|
||||
context = context or {}
|
||||
context["talk"] = talk
|
||||
context["history_summery"] = history_summary
|
||||
context["knowledge"] = knowledge
|
||||
super(TalkAction, self).__init__(options=options, name=name, context=context, llm=llm)
|
||||
self._talk = talk
|
||||
self._history_summary = history_summary
|
||||
self._knowledge = knowledge
|
||||
self._rsp = None
|
||||
|
||||
@property
|
||||
def prompt(self):
|
||||
prompt = f"{self._history_summary}\n\n"
|
||||
prompt = f"{self._knowledge}\n\n"
|
||||
prompt += f"{self._history_summary}\n\n"
|
||||
if self._history_summary != "":
|
||||
prompt += "According to the historical conversation above, "
|
||||
language = self.options.get("language", "Chinese")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue