Pineconeを使ったAIアプリケーション開発
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}}
Pineconeを使ったAIアプリケーション開発