petterle-endeavors / pinecone-db-construct

Construct for managing and deploying pinecone indexes
MIT License
4 stars 0 forks source link

Feature: Construct that is returned should allow you to get name/endpoint of created document store. #17

Open EarningsCall opened 6 months ago

EarningsCall commented 6 months ago

When the creation is successful, you have a new endpoint for your pinecone DB, such as:

https://tokentoken2-index0-blah-blah123-htko.svc.gcp-starter.pinecone.io

However, there is no way to retrieve this information in the CDK construct (which there should be).

You can also return the name of the newly created instance, such as:

tokentoken2-index0-abced-example
EarningsCall commented 6 months ago

For example, let's say I create this Pinecone index like this:

    const pineconeIndex = new PineconeIndex(this, 'PineconeIndex', {
        indexSettings: [{
          apiKeySecretName: pineconeCreationSecret.secretName,  // store as a string in secrets manager, NOT a key/value secret
          dimension: 1536,
          removalPolicy: RemovalPolicy.RETAIN_ON_UPDATE_OR_DELETE,
          // Pod Index (see python example for serverless)
          podSpec: {
            environment: PineConeEnvironment.GCP_STARTER,
          },
        }],
        deploymentSettings: {
          maxNumAttempts: 2,
        },
      },
    );

I would then want to get the endpoint, maybe like this:

   const pineconeEndpoint = pineconeIndex.endpoint;

Maybe also the name of the index, if it was auto-generated:

   const pineconeIndexName = pineconeIndex.name;
jacob-petterle commented 3 weeks ago

Hey @EarningsCall! I haven't looked at this in a while (clearly). I'd love to add this feature and really appreciate the suggestion. I'm going to add this feature in the next two weeks in addition to some much needed documentation improvements. Thanks for your patience!