phidatahq / phidata

Build AI Agents with memory, knowledge, tools and reasoning. Chat with them using a beautiful Agent UI.
https://docs.phidata.com
Mozilla Public License 2.0
14.48k stars 2.02k forks source link

'save_output_to_file = True' does not save the FULL chat history?? #1100

Open SamuelDevdas opened 2 months ago

SamuelDevdas commented 2 months ago

Title: 'save_output_to_file = True' does not save the FULL chat history?

SCREENSHOTS

encodin-error2 save-history-file-issue Description:

I'm encountering an issue where the save_output_to_file = True option does not seem to save the full chat history as expected.

Steps to Reproduce:

  1. Set the save_output_to_file parameter in the assistant configuration as follows:

    save_output_to_file="chat_history.md"

    Note: disregard the timestamp fstring in the image attached, that is just to keep track of files

  2. Run the assistant and engage in multiple interactions.

Expected Behavior:

The full chat history should be saved to the specified file, capturing all interactions from start to finish.

Actual Behavior:

Only the assistants latest reply is saved, and previous interactions (including user message) seem to be missing from the file.

Configuration Details:

Attached are screenshots of the issue:

  1. The setup of the assistant configuration.
  2. The title of the issue that illustrates the problem.

Please let me know if additional details are needed or if there's a workaround for this issue.

ysolanky commented 2 months ago

Hello @SamuelDevdas!

Thanks for your contribution! The save_output_to_file flag is indeed intended to save the last message from the Assistant. However, I see the value in introducing a new parameter, save_chat_to_file, that would save the entire conversation. This would be a great addition to the functionality.

Would you be interested in working on this and creating a new PR? Let me know if you'd like to take this on!

SamuelDevdas commented 2 months ago

Sure, makes sense. I can add the new input param as suggested and update my pull request.

Could you please review the pull request #1101 and let me know if that works for you? , then I can add the new input parameter as well.