Advanced filtering
You can use ColiVara to filter documents based on their metadata
How to utilize query filter
from colivara_py import ColiVara
rag_client = ColiVara(
# this is the default and can be omitted
api_key=os.environ.get("COLIVARA_API_KEY"),
# this is the default and can be omitted
base_url="https://api.colivara.com"
)
# Upload a document to the default_collection
document = rag_client.upsert_document(
name="sample_document",
url="https://example.com/sample.pdf",
metadata={"author": "John Doe"},
# optional - specify a collection
collection_name="user_1_collection",
# optional - wait for the document to index
wait=True
)
Available Filters
1. key_lookup
key_lookup2. contains
contains3. contained_by
contained_by4. has_key
has_key5. has_keys
has_keys6. has_any_keys
has_any_keysLast updated