mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
remove useless fields
This commit is contained in:
parent
029eed1792
commit
25ea21321f
3 changed files with 5 additions and 9 deletions
|
|
@ -14,6 +14,7 @@ from pydantic import BaseModel, Field
|
|||
from tenacity import retry, stop_after_attempt, wait_random_exponential
|
||||
|
||||
from metagpt.actions.action_output import ActionOutput
|
||||
from metagpt.actions.action_node import ActionNode
|
||||
from metagpt.llm import LLM
|
||||
from metagpt.logs import logger
|
||||
from metagpt.provider.base_gpt_api import BaseGPTAPI
|
||||
|
|
@ -29,11 +30,8 @@ class Action(BaseModel):
|
|||
llm: BaseGPTAPI = Field(default_factory=LLM, exclude=True)
|
||||
context = ""
|
||||
prefix = "" # aask*时会加上prefix,作为system_message
|
||||
profile = "" # FIXME: USELESS
|
||||
desc = "" # for skill manager
|
||||
nodes = []
|
||||
# content: Optional[str] = None
|
||||
# instruct_content: Optional[str] = None
|
||||
node: ActionNode = Field(default_factory=ActionNode)
|
||||
|
||||
# builtin variables
|
||||
builtin_class_name: str = ""
|
||||
|
|
@ -58,10 +56,9 @@ class Action(BaseModel):
|
|||
obj_dict.pop("llm")
|
||||
return obj_dict
|
||||
|
||||
def set_prefix(self, prefix, profile):
|
||||
def set_prefix(self, prefix):
|
||||
"""Set prefix for later usage"""
|
||||
self.prefix = prefix
|
||||
self.profile = profile
|
||||
return self
|
||||
|
||||
def __str__(self):
|
||||
|
|
|
|||
|
|
@ -148,8 +148,7 @@ class SearchAndSummarize(Action):
|
|||
system_prompt = [system_text]
|
||||
|
||||
prompt = SEARCH_AND_SUMMARIZE_PROMPT.format(
|
||||
# PREFIX = self.prefix,
|
||||
ROLE=self.profile,
|
||||
ROLE=self.prefix,
|
||||
CONTEXT=rsp,
|
||||
QUERY_HISTORY="\n".join([str(i) for i in context[:-1]]),
|
||||
QUERY=str(context[-1]),
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ class Role(BaseModel):
|
|||
return role
|
||||
|
||||
def _init_action_system_message(self, action: Action):
|
||||
action.set_prefix(self._get_prefix(), self.profile)
|
||||
action.set_prefix(self._get_prefix())
|
||||
|
||||
def set_recovered(self, recovered: bool = False):
|
||||
self.recovered = recovered
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue