Background: I’m a PM, not a developer, and trying to learn more about embeddings and RAG through a side project.
Problem: Trying to query from via CURL/PHP, but getting a blank response.
Here’s what I’m getting back:
HTTP Code: 200
{“results”:,“matches”:,“namespace”:“default”,“usage”:{“readUnits”:1}}
I’m sending:
Payload to Pinecone: {“vector”:[-0.026489232,-0.012701751… 64359],“top_k”:5,“namespace”:“default”}
I don’t understand why there are no results.
I’ve verified that the index is no empty. I’ve checked the length of the vector. I’m asking questions that should get results. Here’s the code:
// Set up cURL to send the request to Pinecone
$headers = [
'Api-Key: ’ . $pineconeApiKey,
‘Content-Type: application/json’,
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $pineconeEndpoint);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
// Execute the request
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
Any assistance is most appreciated!