Skip to content

Commit

Permalink
update README to reflect code changes in load.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
austin-denoble committed Dec 19, 2023
1 parent 7561c19 commit 072d6d8
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,20 @@ export const load = async (csvPath: string, column: string) => {
// Get index name
const indexName = getEnv("PINECONE_INDEX");

// Check whether the index already exists. If it doesn't, create
// a Pinecone index with a dimension of 384 to hold the outputs
// of our embeddings model.
const indexList = await pinecone.listIndexes();
if (indexList.indexOf({ name: indexName }) === -1) {
await pinecone.createIndex({ name: indexName, dimension: 384, waitUntilReady: true })
}
// Create a Pinecone index with a dimension of 384 to hold the outputs
// of our embeddings model. Use suppressConflicts in case the index already exists.
await pinecone.createIndex({
name: indexName,
dimension: 384,
spec: {
serverless: {
region: "us-west-2",
cloud: "aws",
},
},
waitUntilReady: true,
suppressConflicts: true,
});

// Select the target Pinecone index. Passing the TextMetadata generic type parameter
// allows typescript to know what shape to expect when interacting with a record's
Expand Down

0 comments on commit 072d6d8

Please sign in to comment.