microsoft / TaskWeaver

A code-first agent framework for seamlessly planning and executing data analytics tasks.
https://microsoft.github.io/TaskWeaver/
MIT License
5.19k stars 661 forks source link

Unable to "/save" experience using the library #193

Closed sy276 closed 7 months ago

sy276 commented 7 months ago

Describe the bug I am sending "/save" command/message to Taskweaver to make it remember an experience. Taskweaver is failing at doing that.

To Reproduce

  1. Run Taskweaver by importing as a library
  2. After a couple of messages, send the "/save" command/message i.e., session.send_message("/save")
  3. Wait for the response
  4. {'id': 'round-20240205-472936-424d5z34', 'user_query': '/save', 'state': 'failed', 'post_list': [{'id': 'post-20240205-472936-e97ght638', 'message': '/save', 'send_from': 'User', 'send_to': 'Planner', 'attachment_list': []}]}

Expected behavior I expect it to save the experience the way it does when run from Terminal

Environment Information:

zhangxu0307 commented 7 months ago

Hi, @ysid27 ! Did you use session.send_message("/save") to save the experience? Actually, all commands starting with/only support console chat and not through library usage or Chainlit UI.

sy276 commented 7 months ago

Hi @zhangxu0307 ! I am using session.send_message("/save") through library. If session.send_message("/save") is not the way to save an experience through library, what is the way? I tried using session.send_message("save"), but that didn't work either. Thanks!

zhangxu0307 commented 7 months ago

So far, we only support user to use /save in the console chat (chat in command line).

sy276 commented 7 months ago

Oh no! Are there plans to extend this feature to library? Also, is there a place we can see the roadmap of TaskWeaver?

zhangxu0307 commented 7 months ago

A workaround method is trying to use the following code to save chat histroy directly: session.memory.save_experience(exp_dir=session.config.experience_dir) If it works, you will see a raw exp file saved in yourexpereince dir.

sy276 commented 7 months ago

Worked flawlessly, thanks @zhangxu0307 !