-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make corpus name part of the protocol rather than a chat protocol parameter #487
Comments
This seems fine to me. What would be the behaviour if no corpus name is passed? |
Sorry, forgot to mention that. IMO the behavior should be "author defined". Meaning, the author should put in some behavior for the use case of the user not supplying a corpus name. For our builtin source storages, we can simply continue to use the "global" corpus: ragna/ragna/source_storages/_chroma.py Lines 39 to 41 in aea6b67
ragna/ragna/source_storages/_lancedb.py Lines 55 to 57 in aea6b67
If we at some point support #191, the behavior would change to "global corpus for the given embedding model". |
What should happen if a user wants to chat over multiple corpuses in a single chat? Should a user be allowed to pass a list of corpus names when instantiating a Lines 148 to 156 in 2066dcd
|
Fixed in #490. |
Initial discussion started in #460 (comment). There we decided to just go with a
corpus_name: Optional[str]
as chat parameter. Same for LanceDB in #461.However, we likely and up needing a handle for this outside of a chat as well. Think listing the available corpora, or listing the available metadata of a corpus. And if the the
corpus_name
is a fixed parameter for these endpoints, we should do the same for the protocol methods as well.Thus, I propose we change the signatures from
ragna/ragna/core/_components.py
Line 133 in dd52e70
ragna/ragna/core/_components.py
Line 142 in dd52e70
to
def store(self, corpus_name: Optional[str], documents: list[Document])
def retrieve(self, corpus_name: Optional[str], metadata_filter: MetadataFilter, prompt: str)
Downside to this is that calling
SourceStorage.store
andSourceStorage.retrieve
manually will be more annoying, since thecorpus_name
no longer has a default. But we are not optimizing for this workflow so I'm ok with this compromise.The text was updated successfully, but these errors were encountered: