Skip to content

Commit

Permalink
Make upsert work
Browse files Browse the repository at this point in the history
  • Loading branch information
HHousen committed Aug 1, 2023
1 parent c5e9587 commit acc6069
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions vocode/streaming/vector_db/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ async def add_texts(
docs.append({"id": ids[i], "values": embedding, "metadata": metadata})
# upsert to Pinecone
async with self.aiohttp_session.post(
f"{self.pinecone_url}/upsert",
f"{self.pinecone_url}/vectors/upsert",
headers={"Api-Key": self.pinecone_api_key},
json={
"vectors": docs,
"namespace": namespace,
},
) as response:
print(await response.text())
response_json = await response.json()
if "message" in response_json:
logger.error(f"Error upserting vectors: {response_json}")

return ids

Expand Down

0 comments on commit acc6069

Please sign in to comment.