Filtering Query
This section provides a detailed guide to the filter expression syntax, a lightweight query language for filtering data.
Simple Query
Querying the data works as follows
import os, requests
url = "https://api.activeloop.ai/chat/completions"
token = os.environ["ACTIVELOOP_TOKEN"]
headers = {'Authorization': f'Bearer {token}'}
payload = {
"model": "activeloop-l0",
"messages": [
{
"role": "user",
"content": "What is logic?",
}
]
}
response = requests.post(url, headers=headers, json=payload)
# Print the response
print(response.json())Retrieving top K elements without Reasoning
When activeloop-l0-retrieval is used there is no reasoning or summary returned. Only top_k results.
Getting answer from Hegel
Now, we can filter files based on metadata, before running the query.
Getting answer from other authors
You can learn more about on various ways you can filter the data via Query Syntax.
Last updated

