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

Add corpus label for identifying groups of documents #269

Closed
wants to merge 1 commit into from

Conversation

nenb
Copy link
Contributor

@nenb nenb commented Jan 16, 2024

This PR addresses some aspects of #256. There are 3 changes:

  1. A corpus_id kwarg has been added to core components like the source_storages and the Chat class
  2. source_storage tables are now identified by the corpus_id label rather than a chat_id label
  3. All use of the prepared flag has been removed.

More details
A corpus_id label allows easy reference to embeddings that have already been computed. Removing the convention of using chat_id to name the tables means that embeddings are no longer coupled to chats and can be re-used. Removal of the prepared flag is necessary to prevent inconsistencies when re-using embeddings across chats (eg it would be inconsistent for the same corpus to have prepared values of True and False for different chats, which may occur for a variety of reasons)

Not in scope for this PR
The UI will also require some UX work before it can make proper use of this PR. For now, I have simply hardcoded the corpus_id label to be equal to the chat_id value in the UI section of the code. This should give functionally equivalent behaviour as to what currently exists.

@nenb nenb mentioned this pull request Jan 16, 2024
@nenb nenb marked this pull request as ready for review January 16, 2024 01:15
@nenb nenb requested a review from pmeier January 16, 2024 01:15
@nenb
Copy link
Contributor Author

nenb commented Jan 16, 2024

Closing as it turns out that it is possible to implement similar functionality by designing a custom Document extension and a custom source_storage extension.

@nenb nenb closed this Jan 16, 2024
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.

1 participant