Skip to main content

Basic usage

Send a question with context to a model to generate an answer
import Bytez from 'bytez.js';

// insert your key
const sdk = new Bytez('BYTEZ_KEY');

// choose your model
const model = sdk.model('deepset/roberta-base-squad2');

// provide the model with input
const input = {
  "question": "Where does Holly live?",
  "context": "My name is Holly and I live in NYC"
};

// send to the model
const { error, output } = await model.run(input);

// observe the output
console.log({ error, output });

I