MCPcopy Create free account
hub / github.com/OpenBMB/BMTools / _construct_scratchpad

Method _construct_scratchpad

bmtools/agent/BabyagiTools.py:28–37  ·  view source on GitHub ↗

Construct the scratchpad that lets the agent continue its thought process.

(self, intermediate_steps)

Source from the content-addressed store, hash-verified

26 return full_inputs
27
28 def _construct_scratchpad(self, intermediate_steps):
29 """Construct the scratchpad that lets the agent continue its thought process."""
30 thoughts = ""
31 # only modify the following line, [-2: ]
32 for action, observation in intermediate_steps[-2: ]:
33 thoughts += action.log
34 thoughts += f"\n{self.observation_prefix}{observation}\n{self.llm_prefix}"
35 if "is not a valid tool, try another one" in observation:
36 thoughts += "You should select another tool rather than the invalid one.\n"
37 return thoughts
38
39class TaskCreationChain(LLMChain):
40 """Chain to generates tasks."""

Callers 1

get_full_inputsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected