0.6.11 • Published 11 months ago

@turbopuffer/turbopuffer v0.6.11

Weekly downloads
-
License
MIT
Repository
github
Last release
11 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

11 months ago

0.6.7

11 months ago

0.6.6

11 months ago

0.6.9

11 months ago

0.6.8

11 months ago

0.6.10

11 months ago

0.6.5

11 months ago

0.6.3

11 months ago

0.6.2

11 months ago

0.6.4

11 months ago

0.6.1

11 months ago

0.5.19

11 months ago

0.6.0

11 months ago

0.5.18

12 months ago

0.5.17

12 months ago

0.5.16

12 months ago

0.5.15

12 months ago

0.5.14

1 year ago

0.5.12

1 year ago

0.5.13

1 year ago

0.5.11

1 year ago

0.5.10

1 year ago

0.5.8

1 year ago

0.5.7

1 year ago

0.5.9

1 year ago

0.5.6

1 year ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.5

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.4.2

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.2

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago