Basic usage
Basic usage
Send an image of a document along with a question to get relevant answers
import Bytez from 'bytez.js';
// insert your key
const sdk = new Bytez('BYTEZ_KEY');
// choose your model
const model = sdk.model('cloudqi/CQI_Visual_Question_Awnser_PT_v0');
// provide the model with input
const input = {
"question": "Whats the total cost?",
"url": "https://templates.invoicehome.com/invoice-template-us-neat-750px.png"
};
// send to the model
const { error, output } = await model.run(input);
// observe the output
console.log({ error, output });
from bytez import Bytez
# insert your key
sdk = Bytez("BYTEZ_KEY")
# choose your model
model = sdk.model("cloudqi/CQI_Visual_Question_Awnser_PT_v0")
# provide the model with input
input = {
"question": "Whats the total cost?",
"url": "https://templates.invoicehome.com/invoice-template-us-neat-750px.png"
}
# send to the model
result = model.run(input)
# observe the output
print({"error": result.error, "output": result.output})
curl -X POST 'https://api.bytez.com/models/v2/cloudqi/CQI_Visual_Question_Awnser_PT_v0' \
-H 'Authorization: BYTEZ_KEY' \
-H 'Content-Type: application/json' \
--data '{
"question": "Whats the total cost?",
"url": "https://templates.invoicehome.com/invoice-template-us-neat-750px.png"
}'
You can send the document image via
url or base64 data URL.We recommend
url for better performance, as base64 increases payload size.