Use from software
The widget is one way to use viora. Your own apps can use the same assistant: a mobile app, a point-of-sale screen, a kiosk, a chatbot on another channel, or a voice assistant in the terminal.
Everything below works with viora cloud (https://viora-cloud.depriver-tech.workers.dev) and with a self-hosted viora server. You only need the site id; the public endpoints don't need a key.
JavaScript
One file, no dependencies, about 5 KB compressed. It works in browsers, Node.js 22 or newer, Deno, Bun and Cloudflare Workers.
import { Viora } from "https://viora-cloud.depriver-tech.workers.dev/sdk.js";
const viora = new Viora({ api: "https://viora-cloud.depriver-tech.workers.dev", site: "your-site" });
// stream the answer as it's written
for await (const piece of viora.stream("Mnafungua saa ngapi?")) {
process.stdout.write(piece);
}
// or wait for the whole answer
const reply = await viora.answer("Do you offer school transport?");
console.log(reply.text, reply.answered, reply.language);
The client remembers the conversation, so follow-up questions work (viora.reset() starts over). In Node.js you can also copy sdk.js into your project and import it from a file.
| Method | What it does |
|---|---|
stream(question) | Async iterator of answer text, piece by piece. |
answer(question) | The whole answer: {text, answered, language, sources, handoff}. |
events(question) | Every event, including the final done event. |
transcribe(audio) | Speech to text for a recording (a Blob or bytes): {text, language}. |
speak(text) | Text to speech: audio bytes in an English voice. |
lead({name, contact, message}) | Leave contact details for the business. |
live(options) | A real-time voice conversation. See Live voice. |
config() | The assistant's public settings. |
Python
Install the package: pip install viora-ai. The client needs no AI keys; it talks to viora cloud or your own server.
from viora.client import Client
bot = Client("https://viora-cloud.depriver-tech.workers.dev", "your-site")
for piece in bot.stream("Ada ya bweni ni shilingi ngapi?"):
print(piece, end="", flush=True)
reply = bot.answer("Do you offer school transport?")
if not reply.answered:
print("Talk to a person:", reply.handoff)
In async code, use AsyncClient with the same methods: async for piece in bot.stream(...). Both clients also have transcribe(), speak() and lead().
A voice assistant in your terminal
The package includes a hands-free assistant. It uses your microphone and speakers and talks like a phone call:
viora talk --site your-site viora talk --site your-site --wake "hey viora" # only answers when called viora talk --site your-site --barge-in # interrupt by talking (use headphones)
To install just the command, use uv tool install viora-ai or pipx install viora-ai. On Linux it uses PulseAudio or PipeWire, which most desktops already have. On Windows and macOS, install the audio extra first: pip install "viora-ai[audio]". To talk to your own server, add --api https://your-server.
Any other language
Every SDK method is a plain HTTP request, so PHP, Java, Go, Kotlin, Swift or Dart apps can call the HTTP API directly. For live voice, open a WebSocket and follow the live protocol.
curl -N https://viora-cloud.depriver-tech.workers.dev/v1/sites/your-site/ask \
-H "Content-Type: application/json" \
-d '{"question": "Do you offer school transport?"}'
Good to know
- Questions from your software count toward the same daily plan limit as questions from your website.
- If your profile lists allowed websites, browsers on other websites are refused. Apps and servers that don't send an
Originheader are not affected. - Don't put your site key (
vk_…) in an app. The public endpoints don't need it; keep it on your server for the owner endpoints.