a16z-infra / ai-getting-started

A Javascript AI getting started stack for weekend projects, including image/text models, vector stores, auth, and deployment configs
https://ai-getting-started.com/
MIT License
4k stars 643 forks source link

choose vector database using env config #39

Closed zeke closed 1 year ago

zeke commented 1 year ago

This PR attempts to simplify the process of using Pinecone or Supabase. Rather than requiring the user of the app to change code references, it adds a bit of logic to select the appropriate API adapter based on the presence or absence of the Pinecone API key.

With this change in place, users will be able to control which database they're using without changing any code.

61cygni commented 1 year ago

Unfortunately this won't work because .env.local is not available client side. However, we have a version that does similar using actions in another branch which we'll merge eventually.

zeke commented 1 year ago

Ah of course! Didn't realize that was client-side code. Whoops. Closing.