Profile Metadata allows you to define filters that control the information retrieved by the RAG Assistants.
Filters act as logical conditions that refine the results based on specific criteria. These filters are combined using the AND operator to create more complex filtering logic.
To define a filter, you need to specify the following:
- Key: This is a mandatory field that identifies the specific attribute or property you want to filter.
- Operator: This field is optional and defaults to $eq (equal) if not specified. It defines the comparison operator used for filtering. The available operators are:
- $eq: Equal (default)
- $ne: Not Equal
- $gt: Greater than
- $gte: Greater than or equal
- $lt: Less than
- $lte: Less than or equal
- Value: This field specifies the value to be used in the comparison.
Then, each filter has the following format:
{
"key": string, // mandatory
"operator": string, /* optional defaults to $eq if not set*/
"value": string,
}
Suppose you want to retrieve information about products with a price greater than $100. You can define a filter with the following structure:
"filters": [
{
"key": "price",
"operator": "$gt",
"value": "100"
}
]
This filter will only return information about products where the price attribute is greater than 100.
To retrieve information about files named "SampleFile" with a "txt" extension, you can define two filters and combine them using the AND operator:
"filters": [
{"key": "name", "value":"SampleFile", "operator":"$eq"},
{"key": "extension", "value": "txt", "operator": "$eq"}
]