Pinecone doesn't work for chat/completions endpoint on Azure Open AI

Jun An 0 Reputation points
2024-09-15T17:48:00.84+00:00

I am trying to call below endpoint, it always doesn't fetch from index on pinecone.

if I put wrong API key or index name, it throws proper error, BUT as long as I put correct one, it answers without fetching index.

I was checking usage from pinecone, it never consumes usage.

I also tried with different API version, also different parameters as well, all don't work.

Please help

****REQUEST****

POST https://{instanceName}.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-06-01

BODY
{
    "data_sources": [
      {
        "type": "pinecone",
        "parameters": {
          "environment": "us-east-1", // I am using serverless here so I don't have
          "authentication": {
            "type": "api_key",
            "key": "{apiKey}"
          },
          "index_name": "{indexName}",
          "fields_mapping": {
            "content_fields": [
              "content"
            ]
          },
          "embedding_dependency": {
            "type": "deployment_name",
            "deployment_name": "text-embedding-3-large"
          }
        }
      }
    ],
    "messages": [
      {
        "role": "user",
        "content": "how to access IRM?"
      }
    ]
}
****RESPONSE****

{
    "id": "29985ebc-1bb1-4d9f-ae6c-15e2e090f3be",
    "model": "gpt-4o",
    "created": 1726421987,
    "object": "extensions.chat.completion",
    "choices": [
        {
            "index": 0,
            "finish_reason": "stop",
            "message": {
                "role": "assistant",
                "content": "The requested information is not found in the retrieved data. Please try another query or topic.",
                "end_turn": true,
                "context": {
                    "citations": [],
                    "intent": "[\"How to access Information Rights Management (IRM)?\"]"
                }
            }
        }
    ],
    "usage": {
        "prompt_tokens": 1716,
        "completion_tokens": 12,
        "total_tokens": 1728
    },
    "system_fingerprint": "fp_b2ffeb16ee"
}
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,052 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 33,846 Reputation points
    2024-09-19T11:29:41.6566667+00:00

    Jun An I'm glad that your issue is resolved and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that the question author cannot accept their own answer, they can only accept answers by others, I'll repost your solution in case you'd like to Accept the answer.

    Error Message:

    I am trying to call below endpoint, it always doesn't fetch from index on pinecone.

    if I put wrong API key or index name, it throws proper error, BUT as long as I put correct one, it answers without fetching index.

    I was checking usage from pinecone, it never consumes usage.

    I also tried with different API version, also different parameters as well, all don't work.

    Solution:

    I found that, the reason because I have namespace in index.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.