- Changed the exception type from asyncio.TimeoutError to TimeoutError for better clarity in timeout handling.
- Updated the error message to suggest generating fewer tokens in case of a timeout.
Added a type check to ensure the llm argument is an instance of BaseChatModel in Agent's constructor, raising a ValueError otherwise. Also marked BaseChatModel as @runtime_checkable to support isinstance checks.
- Added `ignore_output=True` to the `@observe_debug` decorator in the Agent and BrowserSession classes to suppress output for specific methods.
- Updated the `@observe_debug` decorator in the MessageManager class to include `ignore_input=True` for better control over debug logging.
- Moved the handling of InterruptedError to a separate conditional block for improved clarity.
- Updated logging to use error level for InterruptedError, enhancing visibility of interruptions.
- Simplified the last result state update by removing unnecessary parameters.
- Updated error logging to use the instance logger for better context.
- Incremented consecutive failures count and updated last result state upon timeout errors for improved state management.
- Adjusted the initialization of the step counter to start from 1 in AgentState.
- Updated logging messages throughout the Agent class to reflect the correct step number after the refactor.
- Removed the previous increment of n_steps from the middle of the step method, ensuring it is now incremented only at the start of the method for better clarity and tracking.
- Moved step timing initialization and step counter increment to the start of the step method for better tracking.
- Updated logging messages to reflect the correct step number after the refactor.
- Increased timeout for step execution to 5 minutes and added graceful handling for timeout errors.
- Adjusted initial value of n_steps in AgentState to start from 0 instead of 1.
- Added observability decorators to resource monitoring functions for improved debugging.