langchain-ai / opengpts

MIT License
6.3k stars 827 forks source link

Update functionality of thumb up/down buttons in UI to update thread checkpoint metadata score #338

Closed andrewnguonly closed 1 month ago

andrewnguonly commented 1 month ago

Summary

DO NOT MERGE. This is a test branch to demonstrate self-learning/optimization use cases. After the demonstration is complete, this PR can be closed.

The functionality of the 👍 and 👎 buttons are updated to update the thread checkpoint metadata score. The OpenGPTs backend calls the LangGraph API PATCH threads/<tid>/state endpoint to do the update.

Implementation

  1. OpenGPTs backend: Add PATCH api/threads/<tid>/state endpoint to allow client to update thread checkpoint metadata score.
  2. Update OpenGPTs UI feedback buttons to call the new API.
  3. Convert the Assistant bot to a self-learning bot (i.e. uses FewShotExamples managed state).
  4. Lint and format all backend and frontend files.

To Do

Next Steps

  1. Implement custom graph that can "self learn/optimize". Branch off of this branch to make this change.