This repo contains TypeScript code to follow along with the Weaviate Quickstart. The code corresponds to the Quickstart as of 2024-07-31.
There are two code files. Both files use the TypeScript v3 client.
quickstart-setup.ts
This code creates a collection.quickstart-query.ts
This code queries the collection.
To run the project, follow these steps:
- Clone the repository.
- Install all relevant dependencies with
npm run install
. - Configure environment variables to connect to a Weaviate instance.
- Use
quickstart-setup.ts
to create the example collection by runningnpm run setup
in your terminal - To make a query, edit
quickstart-query.ts
and uncomment the line that calls the query then runnpm run query
in your terminal.
The client connection uses these environment variables:
Variable | Meaning |
---|---|
WCD_URL | The URL for your Weaviate instance |
WCD_API_KEY | The authentication API key for your Weaviate instance |
OPENAI_API_KEY | The authentication API key for your OpenAI account |
If you are using a Weaviate Cloud instance to run the Quickstart, the instance URL and API key are listed in the cluster details panel.
If you don't have an OpenAI key, register at OpenAI to get one.
For more information, see Environment variables