You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
David-Andrew Samson edited this page May 15, 2023
·
9 revisions
While interacting with the LLM react agent, it is possible to inject context messages into the chat history. Context messages are very flexible and can be used in a number of different ways:
providing the agent with information about the current state of a tool
(etc/todo)
Managing Context
Context can be created by calling one of the add_context methods on the agent
agent=ReActAgent(...)
# add permanent contextid=agent.add_context("some context message")
# add timed contextid=agent.add_timed_context("some message that will be deleted after 1 step")
id=agent.add_timed_context("some message that will be deleted after n steps", n)
Context can be removed via the remove_context function given the message's id