Skip to content

Instantly share code, notes, and snippets.

@zackproser
Created June 6, 2024 11:11
Show Gist options
  • Save zackproser/a25a3818318167f9db83b49320520242 to your computer and use it in GitHub Desktop.
Save zackproser/a25a3818318167f9db83b49320520242 to your computer and use it in GitHub Desktop.
Pinecone ID-prefixing
index = pc.Index("serverless-index")
index.upsert(
vectors=[
{"id": "order1#chunk1", "values": [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1]},
{"id": "order1#chunk2", "values": [0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2]},
{"id": "order1#chunk3", "values": [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3]},
{"id": "order1#chunk4", "values": [0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4, 0.4]}
],
namespace="orders"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment