AutoGPT: Fix plugin commands accumulating
parent
a30cbcc2ce
commit
563df6ca3a
|
@ -244,8 +244,8 @@ class BaseAgent(Configurable[BaseAgentSettings], ABC):
|
||||||
def build_prompt(
|
def build_prompt(
|
||||||
self,
|
self,
|
||||||
scratchpad: PromptScratchpad,
|
scratchpad: PromptScratchpad,
|
||||||
extra_commands: list[CompletionModelFunction] = [],
|
extra_commands: Optional[list[CompletionModelFunction]] = None,
|
||||||
extra_messages: list[ChatMessage] = [],
|
extra_messages: Optional[list[ChatMessage]] = None,
|
||||||
**extras,
|
**extras,
|
||||||
) -> ChatPrompt:
|
) -> ChatPrompt:
|
||||||
"""Constructs and returns a prompt with the following structure:
|
"""Constructs and returns a prompt with the following structure:
|
||||||
|
@ -256,6 +256,10 @@ class BaseAgent(Configurable[BaseAgentSettings], ABC):
|
||||||
Params:
|
Params:
|
||||||
cycle_instruction: The final instruction for a thinking cycle
|
cycle_instruction: The final instruction for a thinking cycle
|
||||||
"""
|
"""
|
||||||
|
if extra_commands is None:
|
||||||
|
extra_commands = []
|
||||||
|
if extra_messages is None:
|
||||||
|
extra_messages = []
|
||||||
|
|
||||||
# Apply additions from plugins
|
# Apply additions from plugins
|
||||||
for plugin in self.config.plugins:
|
for plugin in self.config.plugins:
|
||||||
|
|
Loading…
Reference in New Issue