How to run weaviaate

I am first time using weaviate and typsecript as well.

I have set all options in embeded client:

const client: EmbeddedClient = weaviate.client(
  new EmbeddedOptions({
    port: 7878,
    version: '1.18.1',
    env: {
      QUERY_DEFAULTS_LIMIT: 50,
      DEFAULT_VECTORIZER_MODULE: 'text2vec-openai',
    },
  }),
  // weaviate-ts-client ConnectionParams
  {
    scheme: 'http',
    host: '127.0.0.1:7878',
  }
);

My question is how do i run the code in ts. I am using visual studio code as editor.

hi @starskiin3d ! Welcome to our community :hugs:

Here we have a nice example on how to properly run Weaviate Embedded with Typescript:

considering you have the package.json, tscofig.js and index.ts from that repo locally, all of them at the same folder,

Your next step is to run npm i && tsc that will install the depencies (for instance, weaviate-ts-embedded) and transform the typescript code in javascript. You can do it by running on that very same folder:

npm i && tsc

after, you will find your index.js file under the dist folder.

You can now run:

node dist/index.js

Please, be aware:

Let me know if this helps, or if you need any further assistance on installing and using Weaviate.

Thanks!

1 Like

Thanks a bunch. Will give it a go.