-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update functionality of thumb up/down buttons in UI to update thread checkpoint metadata score #338
Update functionality of thumb up/down buttons in UI to update thread checkpoint metadata score #338
Conversation
… checkpoint metadata score.
…tate. Update frontend so that agent API call send dict.
frontend/src/App.tsx
Outdated
@@ -67,8 +67,11 @@ function App(props: { edit?: boolean }) { | |||
}, | |||
]; | |||
|
|||
if (assistantType === "chat_retrieval" || assistantType === "chatbot") { | |||
// The RAG assistant type requires an object with a `messages` field. | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if-statement isn't needed anymore since all chatbots use StateGraph
with messages
key.
backend/app/api/threads.py
Outdated
if not thread: | ||
raise HTTPException(status_code=404, detail="Thread not found") | ||
assistant = await storage.get_assistant(user["user_id"], thread["assistant_id"]) | ||
if not assistant: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is not needed. We want to support patching thread state metadata even if the assistant has been deleted.
…checkpoint metadata score (#338) * Update functionality of thumbs up/down buttons in UI to update thread checkpoint metadata score. * Fix bugs with calling PATCH threads/<tid>/state API. * Update frontend to expose Self-Learning Assistant. * cr * Fix bug in backend to make sure that agent graph returns dict graph state. Update frontend so that agent API call send dict. * Call tool node should return dict. * Update API call for updating tool messages. * Restore functionality for sending feedback to LangSmith. * Remove Self-Learning assistant. * Small updates. --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
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
PATCH api/threads/<tid>/state
endpoint to allow client to update thread checkpoint metadata score.Assistant
bot to a self-learning bot (i.e. usesFewShotExamples
managed state).backend
andfrontend
files.To Do
langgraph-sdk
after a new release is cutfrontend
andbackend
. We'll use the regular assistant instead.Next Steps
Implement custom graph that can "self learn/optimize". Branch off of this branch to make this change.