Basic usage
Basic usage
Send a text input to translate it into another language
Copy
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('Helsinki-NLP/opus-mt-en-zh');
// provide the model with input
const input = "Hello, how are you? Beautiful day today, isn't it?";
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });