tv library

ORYKSA for TV apps (Android TV, Google TV, Fire TV with Fire OS).

OryksaTvFakeBackend is a SIMULATED backend for tests and demos: nothing shown with it proves the real server.

Docs: https://developer.oryksa.com

Classes

OryksaAgent
Public look of the AI employee (the same data the ORYKSA website chat shows).
OryksaAiResult
The answer of OryksaClient.ai: an AI task of your own app (read a photo, extract data, classify, write), counted as ORYKSA interactions.
OryksaAppContext
Where the customer is inside your app. Sent with each message so the AI knows the current screen (for example a product page) and answers about it.
OryksaAudio
Audio returned by an ORYKSA endpoint (OryksaClient.requestAudio): the bytes and the response headers.
OryksaBottomBar
A bottom tab bar with your destinations and the AI bubble (OryksaTabBubble) in the middle, in the Material 3 NavigationBar style. It takes the same NavigationDestination items, selectedIndex and onDestinationSelected, so moving from a NavigationBar is one line:
OryksaChat
The ORYKSA chat panel: header with the photo and name of the AI, messages, suggested questions and the input. Same look as the ORYKSA website chat.
OryksaChatButton
Floating "Talk to name" button with the photo of the AI. Put it in a Stack (or as a Scaffold.floatingActionButton); tapping it opens showOryksaChat.
OryksaChatTheme
Colors of the chat. The defaults are the ORYKSA website chat colors.
OryksaClient
In-app client. Uses a short-lived session token (oryk_cs_...) created by YOUR server with POST /v1/sessions. The secret API key never goes into the app.
OryksaFile
A document from the customer (PDF, Word, text or CSV, up to about 8 MB). The AI reads it.
OryksaImage
A photo the customer picked in your app (for example with the image_picker package). The AI looks at it and answers about it, as in the ORYKSA website chat.
OryksaLinkCard
The card under a reply for a link of the business's own site: its picture, its title and an Open button. Links of other sites show the address and the button.
OryksaLinkPreview
Title and picture of a link of the business's own site (OryksaClient.linkPreview).
OryksaMessage
One message of the conversation.
OryksaPairing
A phone pairing (OryksaTvBackend.pair): the QR and the code shown on the TV.
OryksaPairingCard
The QR to talk on the phone: the code, the short address and where it stands (waiting, connected, listening, expired). Starts tv.phoneVoice when it appears (unless autoStart is false). The phone page is from ORYKSA; the TV never needs a microphone.
OryksaPhoneEvent
One event of the phone, from GET /v1/client/tv/pair/{id}/events.
OryksaPhoneEventsPage
One answer of the events long-poll.
OryksaPhoneVoice
The phone as the microphone: the TV shows a QR, the phone opens the ORYKSA page and what the person says arrives here as text (texts, onText). For TVs that give no microphone to apps (for example the Fire TV Stick). Get it from OryksaTv.phoneVoice and show it with OryksaPairingCard.
OryksaPresenter
The presenter: the AI speaks on screen with the voice of the locale (from the server, never in the code) and big subtitles. Get it from OryksaTv.presenter and show it with OryksaPresenterView.
OryksaPresenterView
The presenter on screen: her photo and name, and the subtitles in big letters. Place it over your screen (for example at the bottom of a Stack). It hides itself when she is quiet unless showWhenIdle.
OryksaProfanity
Masks swear words the customer types (owner rule: every ORYKSA chat shows them as asterisks).
OryksaReply
Answer of send: replied with the text, or pending while the AI is still writing.
OryksaRichText
Text of a message with bold parts and links (web and e-mail) the customer can tap.
OryksaTabBubble
The round button with the photo of the AI for the middle of a bottom tab bar, the same as in the ORYKSA app. Tapping it opens the chat (with voice) with showOryksaChatScreen: a full screen on phones, a side panel on wide screens.
OryksaTv
The ORYKSA TV pieces of one app: the presenter, the phoneVoice and the configuration from the server. Create one and keep it while the app runs.
OryksaTvAction
A button of the assistant panel, from the ORYKSA server (tv.actions).
OryksaTvAssistant
The assistant panel: a conversation with the AI driven only by the remote (arrows, OK, Back). The questions and buttons come from the server; the person can also talk on the phone (QR) or type with the system keyboard. Replies are read by the presenter when the server allows it.
OryksaTvAudioPlayer
Plays the presenter's voice. The default is OryksaTvJustAudioPlayer; tests pass their own.
OryksaTvAvatar
Round photo of the AI, with a ring while she speaks.
OryksaTvBackend
What the TV pieces need from ORYKSA. The real one is OryksaTvClientBackend; tests and demos use OryksaTvFakeBackend. Your app never changes when one is swapped for the other.
OryksaTvButton
A button for the TV remote: OK presses it, the arrows move to it, and when it has the focus it grows, fills with the accent colour and gets a thick ring.
OryksaTvClientBackend
The real backend: the ORYKSA API through an OryksaClient (its session token, its platform). Written against the contract in the TV SDK design (section 9); each call is only proven once the server side is live.
OryksaTvConfig
Everything the TV pieces read from the server: GET /v1/client/agent?locale=..., block tv.
OryksaTvFakeBackend
SIMULATED backend, for tests and demos only. It never calls ORYKSA, never counts interactions and its texts are samples: nothing shown with it proves the real server.
OryksaTvJustAudioPlayer
The presenter's voice with just_audio. Plays from a file: bytes from memory go through a local http://127.0.0.1 proxy on Android, which Android 9+ blocks unless the app allows cleartext traffic (Fire TV with Fire OS 7 is Android 9).
OryksaTvMetrics
Sizes for a TV screen: given in pixels of a 1080p screen and scaled to the real one, so they look the same on any TV whatever its density.
OryksaTvMic
The TV's own microphone.
OryksaTvRules
Rules of the TV pieces, from the ORYKSA server (tv.rules).
OryksaTvSpeech
The presenter's voice for one text (OryksaTvBackend.speak).
OryksaTvTexts
The texts of the TV pieces, from the ORYKSA server (tv.texts), already in the locale the server chose. A missing key uses a short English text and is logged once.
OryksaTvTheme
Colours of the TV pieces. Pass your app's colours; the sizes and the focus ring stay big.
OryksaVoiceController
The ORYKSA voice conversation (the same behaviour as the ORYKSA app and every other ORYKSA channel):
OryksaVoiceScreen
Full-screen voice conversation, the same as the ORYKSA app: the photo of the AI with a halo, "I'm listening" / her answer, Mute and Close. What is said goes to the chat through OryksaVoiceController.onUserText and OryksaVoiceController.onReply.
Vad
Decide QUANDO o dono começou e acabou de falar.
VadStep
O que o ecrã deve fazer com o pedaço que acabou de chegar.

Enums

OryksaPhoneEventType
Kind of OryksaPhoneEvent.
OryksaPhoneVoiceState
Where the phone voice is.
OryksaPresenterPhase
What the presenter is doing.
OryksaTvActionKind
What a button of the assistant panel does (OryksaTvAction.kind).
OryksaTvPlatform
The TV the app runs on, sent as platform to ORYKSA (so the owner's reports say "in your app (Fire TV)"). A pure Dart package cannot tell a Fire TV from an Android TV: your app says which one it is.
OryksaVoicePhase
What the voice conversation is doing now.

Constants

oryksaWideBreakpoint → const double
From this width (in logical pixels, dp) the tab bar bubble opens the chat as a side panel instead of a full screen: tablets, open foldables and desktop.

Functions

oryksaBold(String text, TextStyle base) → List<TextSpan>
Text with bold parts (the server marks them, the app only draws them).
oryksaChatTexts(String lang) → Map<String, String>
Texts of the chat for lang (en, pt, br, es).
oryksaLang(String? lang) → String
The SDK language for a language code or locale tag: en, pt, br (Portuguese of Brazil) or es. Accepts pt-BR, pt_BR, pt-PT, es-ES, en-GB...; anything else is en.
oryksaLangOf(BuildContext context, [String? lang]) → String
The SDK language of the app: lang when given, otherwise the locale of context.
oryksaLinksIn(String text, {int max = 3}) → List<String>
The distinct web links of text, in order (at most max).
Opens link: your handler first, then the browser or the app that owns the address.
oryksaTvChatLang(String locale) → String
The language code the chat endpoint has always taken (en, pt, br, es...): pt-BR is br, any other Portuguese is pt, the rest is the language code.
oryksaTvLocaleTag(Locale l) → String
BCP-47 tag of a Locale with a hyphen: pt-BR, es-419, en.
oryksaTvNormalizeLocale(String raw) → String
Normalises a locale string (pt_BR, pt-br, PT-BR) to pt-BR. Empty stays empty.
oryksaTvReadingTime(String line) → Duration
How long a subtitle stays on screen when there is no voice: about 14 characters per second, never under 1.8 s.
oryksaTvSentences(String text) → List<String>
The sentences of text (ends at ., !, ?, …, keeping the mark).
oryksaTvSplitForSpeech(String text, int max) → List<String>
Splits text into pieces of at most max characters for the voice, at the end of a sentence when possible, then at a comma, then at a space.
oryksaTvSubtitleLines(String text, {int max = 90}) → List<String>
The subtitle lines of text: one sentence per line, sentences longer than max characters cut at a comma or a space.
oryksaVoiceTexts(String lang) → Map<String, String>
Texts of the voice screen for lang (en, pt, br, es).
text without its web links (for the voice screen: the link is on the button).
showOryksaChat(BuildContext context, {required OryksaClient client, String lang = 'en', OryksaChatTheme theme = const OryksaChatTheme(), bool alignLeft = false, OryksaAppContext? appContext()?, bool voice = true, Future<OryksaImage?> onPickImage()?, OryksaLinkHandler? onLink}) → Future<void>
Opens the ORYKSA chat: a bottom sheet on phones, a floating panel on wide screens.
showOryksaChatScreen(BuildContext context, {required OryksaClient client, String? lang, OryksaChatTheme? theme, OryksaAppContext? appContext()?, bool voice = true, Future<OryksaImage?> onPickImage()?, double panelWidth = 420, bool startInVoice = false, OryksaLinkHandler? onLink}) → Future<void>
Opens the ORYKSA chat the way the tab bar bubble does (OryksaTabBubble):
showOryksaTvAssistant(BuildContext context, {required OryksaTv tv, OryksaAppContext? appContext()?, bool sidePanel = false, OryksaTvTheme theme = const OryksaTvTheme()}) → Future<void>
Opens the assistant panel over your screen. Back closes it and the focus goes back where it was. sidePanel: a panel on the right instead of the whole screen.

Typedefs

OryksaLinkHandler = bool Function(Uri link)
What your app does with a link the AI gave (a product, a service, a page). Return true when your app opened it itself (for example its own product screen); return false and the SDK opens it in the browser (or the app that owns the address).

Exceptions / Errors

OryksaException
Error returned by the ORYKSA API.