0.6.11 • Published 3 months ago

@turbopuffer/turbopuffer v0.6.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

The official TypeScript SDK for Turbopuffer.

To install,

npm i @turbopuffer/turbopuffer

Usage:

// Make a new client
// Connections are pooled for the lifetime of the client
// We recommend creating a single instance and reusing it for all calls
const tpuf = new Turbopuffer({
  apiKey: process.env.TURBOPUFFER_API_KEY as string,
  // see https://turbopuffer.com/docs/regions for available regions
  baseUrl: "https://gcp-us-east4.turbopuffer.com",
});

// Instantiate an object to work with a namespace
const ns = tpuf.namespace("my-cool-namespace");

// Upsert some vectors
await ns.upsert({
  vectors: [
    {
      id: 1,
      vector: [1, 2],
      attributes: {
        foo: "bar",
        numbers: [1, 2, 3],
      },
    },
    {
      id: 2,
      vector: [3, 4],
      attributes: {
        foo: "baz",
        numbers: [2, 3, 4],
      },
    },
  ],
  distance_metric: "cosine_distance",
});

// Query
let results = await ns.query({
  vector: [1, 1],
  filters: {
    numbers: ["In", [2, 4]],
  },
});

To run the tests,

npm run test

To publish a new version,

  1. Bump version in package.json
  2. npm install to update package-lock.json
  3. npm publish --access public
  4. git tag vX.Y.Z
  5. git push origin vX.Y.Z
0.6.11

3 months ago

0.6.7

3 months ago

0.6.6

3 months ago

0.6.9

3 months ago

0.6.8

3 months ago

0.6.10

3 months ago

0.6.5

3 months ago

0.6.3

3 months ago

0.6.2

3 months ago

0.6.4

3 months ago

0.6.1

3 months ago

0.5.19

3 months ago

0.6.0

3 months ago

0.5.18

4 months ago

0.5.17

4 months ago

0.5.16

4 months ago

0.5.15

4 months ago

0.5.14

5 months ago

0.5.12

6 months ago

0.5.13

6 months ago

0.5.11

7 months ago

0.5.10

9 months ago

0.5.8

9 months ago

0.5.7

9 months ago

0.5.9

9 months ago

0.5.6

9 months ago

0.5.4

11 months ago

0.5.3

12 months ago

0.5.5

11 months ago

0.5.2

12 months ago

0.5.1

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.2

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.2

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago