gorsejs
TypeScript icon, indicating that this package has built-in type declarations

0.4.8 • Public • Published

gorse.js

TypeScript SDK for Gorse recommender system.

CI npm

Install

  • Install with npm:
npm install gorsejs
  • Install with yarn:
yarn add gorsejs

Usage

Create a client by the entrypoint and api key.

import { Gorse } from "gorsejs";

const client = new Gorse({ endpoint: "http://127.0.0.1:8087", secret: "api_key" });

await client.insertFeedbacks([
    { FeedbackType: 'star', UserId: 'bob', ItemId: 'vuejs:vue', Timestamp: '2022-02-24' },
    { FeedbackType: 'star', UserId: 'bob', ItemId: 'd3:d3', Timestamp: '2022-02-25' },
    { FeedbackType: 'star', UserId: 'bob', ItemId: 'dogfalo:materialize', Timestamp: '2022-02-26' },
    { FeedbackType: 'star', UserId: 'bob', ItemId: 'mozilla:pdf.js', Timestamp: '2022-02-27' },
    { FeedbackType: 'star', UserId: 'bob', ItemId: 'moment:moment', Timestamp: '2022-02-28' }
]);

await client.getRecommend({ userId: 'bob', cursorOptions: { n: 10 } });

Package Sidebar

Install

npm i gorsejs

Weekly Downloads

277

Version

0.4.8

License

Apache-2.0

Unpacked Size

89.4 kB

Total Files

65

Last publish

Collaborators

  • zhenghaoz