Створення AI‑застосунків із Pinecone
James Chapman
Curriculum Manager, DataCamp
{
"genre": "action",
"year": 2020,
"color": "blue",
"fit": "straight",
"price": 29.99,
"is_jeans": true,
"areas": ["London", "Kent", "Bath"]
}
index.query( vector=[-0.250919762305275, ...],filter={"genre": {"$eq": "documentary"}, "year": 2019},top_k=1 )
$eq — дорівнює (число, рядок, булеве)$ne — не дорівнює (число, рядок, булеве)$gt — більше ніж (число)$gte — більше або дорівнює (число)$lt — менше ніж (число)$lte — менше або дорівнює (число)$in — у масиві (рядок або число)$nin — не в масиві (рядок або число)index.query( vector=[-0.250919762305275, ...],filter={"year": {"$gt": 2019},},top_k=1,include_metadatas=True)
{'matches': [{'id': '1', 'score': 0.0478537641,
'values': [],
'metadata': {'genre': 'action', 'year': 2020}}],
'namespace': '',
'usage': {'read_units': 5}}
Створення AI‑застосунків із Pinecone