generative-ai-python

google.generativeai.protos.MetadataFilter

User provided filter to limit retrieval based on Chunk or Document level metadata values.

Example (genre = drama OR genre = action): key = “document.custom_metadata.genre” conditions = [{string_value = “drama”, operation = EQUAL}, {string_value = “action”, operation = EQUAL}]

`key` `str` Required. The key of the metadata to filter on.
`conditions` `MutableSequence[google.ai.generativelanguage.Condition]` Required. The ``Condition``\ s for the given key that will trigger this filter. Multiple ``Condition``\ s are joined by logical ORs.