Chat with AI models using text and audio. Also known as audio-text-to-text
Basic usage
Send a conversation to a model to generate text from text and audio
import Bytez from 'bytez.js';// insert your keyconst sdk = new Bytez('BYTEZ_KEY');// choose your modelconst model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');// provide the model with inputconst input = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }];// send to the modelconst { error, output } = await model.run(input);// observe the outputconsole.log({ error, output });
from bytez import Bytez# insert your keysdk = Bytez("BYTEZ_KEY")# choose your modelmodel = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")# provide the model with inputinput = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }]# send to the modelresult = model.run(input)# observe the outputprint({"error": result.error, "output": result.output})
import Bytez from 'bytez.js';// insert your keyconst sdk = new Bytez('BYTEZ_KEY');// choose your modelconst model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');// provide the model with inputconst input = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }];// provide the model with paramsconst params = { "temperature": 0};// send to the modelconst { error, output } = await model.run(input, params);// observe the outputconsole.log({ error, output });
from bytez import Bytez# insert your keysdk = Bytez("BYTEZ_KEY")# choose your modelmodel = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")# provide the model with inputinput = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }]# provide the model with paramsparams = { "temperature": 0}# send to the modelresult = model.run(input, params)# observe the outputprint({"error": result.error, "output": result.output})
import Bytez from 'bytez.js';// insert your keyconst sdk = new Bytez('BYTEZ_KEY');// choose your modelconst model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');// provide the model with inputconst input = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }];// set streaming to "true"const stream = true;// send to the modelconst readStream = await model.run(input, stream);let text = '';for await (const tokens of readStream) { text += tokens; console.log(tokens);}// observe the outputconsole.log({ text });
from bytez import Bytez# insert your keysdk = Bytez("BYTEZ_KEY")# choose your modelmodel = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")# provide the model with inputinput = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }]# set streaming to "true"stream = True# send to the modelreadStream = model.run(input, stream=stream)text = ""for tokens in readStream: text += tokens print(tokens)# observe the outputprint({"text": text})
import Bytez from 'bytez.js';// insert your keyconst sdk = new Bytez('BYTEZ_KEY');// choose your modelconst model = sdk.model('Qwen/Qwen2-Audio-7B-Instruct');// provide the model with inputconst input = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }];// provide the model with paramsconst params = { "temperature": 0};// set streaming to "true"const stream = true;// send to the modelconst readStream = await model.run(input, params, stream);let text = '';for await (const tokens of readStream) { text += tokens; console.log(tokens);}// observe the outputconsole.log({ text });
from bytez import Bytez# insert your keysdk = Bytez("BYTEZ_KEY")# choose your modelmodel = sdk.model("Qwen/Qwen2-Audio-7B-Instruct")# provide the model with inputinput = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this audio" }, { "type": "audio", "url": "https://dn720307.ca.archive.org/0/items/various-bird-sounds/Various%20Bird%20Sounds.mp3" } ] }]# provide the model with paramsparams = { "temperature": 0}# set streaming to "true"stream = True# send to the modelreadStream = model.run(input, params, stream)text = ""for tokens in readStream: text += tokens print(tokens)# observe the outputprint({"text": text})