Skip to content

Support filtering with metadata#6

Open
prantlf wants to merge 1 commit into
m1guelpf:mainfrom
prantlf:metadata-filter
Open

Support filtering with metadata#6
prantlf wants to merge 1 commit into
m1guelpf:mainfrom
prantlf:metadata-filter

Conversation

@prantlf
Copy link
Copy Markdown

@prantlf prantlf commented Dec 27, 2023

Add a simple metadata filter based on equality of key-value pairs.

  • An undefined filter or an empty array matches all embeddings.
  • An empty object in the array matches any embedding.
  • If an object in the array is not empty, it will match an embedding, if all its key-value pairs are found in the embedding's metadata.
  • If there are more than one objects in the array, the whole filter will match an embedding, if at least one object matches the embedding's metadata.

Example:

[ { "asset": "book", "kind": "paperback" }, { "asset": "newspaper" } ]

Add a simple metadata filter based on equality of key-value pairs.

* An undefined filter or an empty array matches all embeddings.
* An empty object in the array matches any embedding.
* If an object in the array is not empty, it will match an embedding,
  if all its key-value pairs are found in the embedding's metadata.
* If there are more than one objects in the array, the whole filter
  will match an ambedding, if at least one object matches the
  embedding's metadata.
@sweep-ai-deprecated
Copy link
Copy Markdown

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.

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