New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

refuel-sdk

Package Overview
Dependencies
Maintainers
6
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

refuel-sdk

Label, clean and enrich text datasets with LLMs

latest
Source
npmnpm
Version
0.25.0
Version published
Maintainers
6
Created
Source

Refuel JavaScript SDK

The Refuel JavaScript SDK is a lightweight and easy-to-use client library for interacting with the Refuel API. It enables you to label data, manage application responses, and collect feedback seamlessly within your JavaScript or TypeScript applications.

Note: We also have a SDK for Python.

📦 Installation

To install the SDK, use npm or yarn:

npm install refuel-sdk

or

yarn add refuel-sdk

🧑‍💻 Usage

To get started, you'll need a Refuel API key. You can find this in your account settings or contact your team administrator.

Import the SDK into your application and start interacting with the Refuel API:

Example: Label Data

import { Refuel } from "refuel-sdk";

const refuel = new Refuel("your_access_token");

const applicationLabels = await refuel.applications.label(
    "your_application_id",
    [
        // Data to label
        {
            menu_text:
                "Grilled chicken sandwich with avocado and chipotle mayo",
        },
    ]
);

Example: Update Label with Feedback

import { Refuel } from "refuel-sdk";

const refuel = new Refuel("your_access_token");

await refuel.applications.feedback(
    "your_application_id",
    "your_labeled_item_id",
    // Correct label
    {
        vegetarian: "no",
    }
);

🔨 Developing the SDK

These steps are intended for developers of the refuel-sdk. If you are just installing refuel-sdk to use in your application then you can ignore this section.

Local development

After making changes, use the following steps to test your changes locally:

  • From the refuel-sdk directory run npm run build
  • cd to the directory of your application (for example, cd ~/Development/refuel-cloud-web)
  • Run npm install /local/path/to/refuel-sdk

Publishing new versions

After merging your changes to main, complete the following steps to publish a new version of the SDK:

  • Edit package.json and increase the version number (follow semver starting with v1.0.0, for versions prior to v1.0.0 always increase the minor version by one)
  • Run npm run build
  • Create a new commit called "build vX.X.X" using the version number you saved to package.json in step 1
  • Create a new PR with this commit and get that approved and merged to the main branch
  • Checkout the latest main branch locally
  • Ensure that the latest commit is "build vX.X.X"
  • Run git tag vX.X.X
  • Run git push origin --tags
  • Run npm publish

Questions?

Reach out to us at support@refuel.ai with any questions!

Keywords

openai

FAQs

Package last updated on 04 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts