Refactor answer_message function to clean up final response handling by removing redundant print statement and trimming the response content for better formatting.
Refactor answer_message function to prepend a SystemMessage for context, handle tool calls more robustly, and ensure final responses are generated without tool invocation. This enhances the overall response accuracy and flow.
Enhance answer_message function to include tool execution and result integration. The function now processes tool calls from the AI response, executes them, and appends the results before generating the final response.