Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make compatible with new API and serverless #41

Merged
merged 2 commits into from
Mar 7, 2024

Conversation

zeke-emerson
Copy link
Contributor

Problem

This example was incompatible with the new API and did not work out of the box for users. There were version conflicts and control plane issues.

Solution

  • I updated the packages to use the newest TypeScript version.
  • I modified the listIndexes approaches to check for existing indexes so that they do not cause errors.
  • I changed the new index creation to create a serverless index.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Test on Vercel with both an existing index and creating a new index.

@zeke-emerson zeke-emerson requested review from rschwabco and removed request for rschwabco March 7, 2024 20:21
Copy link
Collaborator

@rschwabco rschwabco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, then lgtm

if (!indexExists) {
await pinecone.createIndex({
name: indexName,
dimension: 1536,
waitUntilReady: true,
spec: {
serverless: {
cloud: 'aws',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values on this line and the one after it shouldn't be hard coded, but rather defined as environment variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rschwabco Thanks! Made the change and tested it.

@zeke-emerson zeke-emerson merged commit e14b337 into main Mar 7, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants