Skip to content
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

Deleting assistants & attaching orphaned threads to new assistants #328

Merged
merged 13 commits into from
May 8, 2024

Conversation

bakar-io
Copy link
Contributor

@bakar-io bakar-io commented May 3, 2024

As agreed @nfcampos:

  • Enables deleting assistants without automatically deleting associated threads.
  • Adds metadata column to thread. Column stores the thread's original assistant type: {"assistant_type": assistant["config"]["configurable"]["type"]}
  • Uses this metadata on the frontend to enable attaching threads to suitable assistants (@andrewnguonly this prevents the issue of deserialization by for example not allowing RAG's thread to be attached to Chatbot).

Ideally, we'd be able to show old messages in the UI for threads without assistants. But unfortunately the current state of things prevents this due to get_thread_state depending on the existence of an assistant. So, here's how the UI looks like:

Screencast.from.05-03-2024.11.34.11.AM.webm

@bakar-io bakar-io mentioned this pull request May 3, 2024
@bakar-io
Copy link
Contributor Author

bakar-io commented May 3, 2024

After this PR is in, all of these would be done https://github.com/orgs/langchain-ai/projects/7

@andrewnguonly andrewnguonly self-requested a review May 7, 2024 17:35
Copy link
Contributor

@andrewnguonly andrewnguonly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't look at the frontend changes too thoroughly, but if everything is working as expected, then looks good to me!

backend/migrations/000004_add_metadata_to_thread.up.sql Outdated Show resolved Hide resolved
backend/app/storage.py Outdated Show resolved Hide resolved
frontend/src/types.ts Show resolved Hide resolved
@mkorpela mkorpela merged commit 28c0ec9 into langchain-ai:main May 8, 2024
6 checks passed
@bakar-io bakar-io deleted the deleting-assistants branch May 8, 2024 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants