ChromaDB/Docs: similarity_search_*
filter type hints are incorrect and API docs are incorrect
#30507
Open
5 tasks done
Labels
🤖:docs
Changes to documentation and examples, like .md, .rst, .ipynb files. Changes to the docs/ folder
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
Pylance error/warning:
Description
The type hints for the chroma search methods (
filter
, which equates to chroma'swhere
(metadata search), andwhere_document
(document search)) do not match the corresponding chroma query function signatures.Dict[str, str]
is actually a special "short-hand" case for the general syntax, which is:e.g.,
search_*
methods in theChroma
module.Another issue
where_document
was actually updated with an example of an operator-style condition (e.g., here, it's not well-formed because the operator is missing quotation marks (should be"$contains"
):Furthermore, I think this is actually an incorrect usage of the
$contains
operator, but which is drawn directly from chroma's own docs:Our docs copied from this page, which is pointed to in our API reference, but this usage is not consistent with the chroma API type definitions and with other usages in other places. Actually, it's not even just the lack of quotation marks, I think the formula is just structurally wrong. You can see this from the types themselves, or other examples, like:
$contains
does not map to aDict
(see here)System Info
The text was updated successfully, but these errors were encountered: