[Bug] $and Operator in Metadata Filter for assistant.chat_completions Causes 400 Error #428
Labels
bug
Something isn't working
status:needs-triage
An issue that needs to be triaged by the Pinecone team
Here’s the rewritten bug report in the requested template format:
Is this a new bug?
• I believe this is a new bug
• I have searched the existing Github issues and Community Forum, and I could not find an existing post for this bug
Describe the bug
The $and operator in the metadata filter for assistant.chat_completions appears to cause a 400 Client Error. This issue contradicts the documentation, which suggests that $and should be supported (as per https://www.pinecone.io/learn/assistant-api-deep-dive/#Using-Metadata).
Error information
The API returns the following error:
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://prod-1-data.ke.pinecone.io/assistant/chat/test/chat/completions
...
ValueError: Error in chat completions streaming: 400 Client Error: Bad Request for url: https://prod-1-data.ke.pinecone.io/assistant/chat/test/chat/completions
Relevant code snippet:
Steps to reproduce the issue locally
1. Set up a metadata filter using the $and operator:
Environment
• OS Version: macOS 14.4.1
• Python version: 3.11
• Python SDK version: Pinecone: 5.4.2, Pinecone-plugin-assistant: 0.4.3
Additional context
The documentation explicitly mentions $and as a valid operator, but it does not seem to function as expected in practice. Please confirm if this is a documentation error, an implementation bug, or an unsupported feature.
The text was updated successfully, but these errors were encountered: