OpenAI vector stores - namespaces

I am looking to move from Pinecone vector database to openai vector store because the file_search is so great at ingesting PDFs without all the chunking. The one thing that is stopping me is that Pinecone supports namespaces. I use namespaces to achieve multi-tenancy.
I do see a way to use the attributes map to provide a namespace=value. But no examples on adding a filter to the query when I want to retrieve only values from a certain namespace.

I cannot seem to find any examples of namespace support. So I thought I’d ask here.
Anyone have any ideas?
Jim

1 Like

Found it:

query = "Is ozempic covered by my plan?"
response = client.responses.create(
    input= query,
    model="gpt-4o-mini",
    tools=[{
        "type": "file_search",
        "vector_store_ids": [vector_store_id],
        "filters": {
            "type": "eq",
            "key": "namespace",
            "value": "customer-namespace-5"
        }        
    }]
)
3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.