update_agent_state
hook to run a function that updates your agent’s system message with some context before it goes to the LLM.
Within the function use the ConversableAgent.update_system_message method to update the system message.
Let’s walk through a simple example where we take a list of files from the current directory, include it in an agent’s system message, and ask an LLM to analyze or explain the files.
We start with our imports, LLM configuration, and the system message template, which we’ll inject the file listing in to.
files_agent
about the files.