Oryksa class

Server client for Dart backends (shelf, dart_frog, serverpod...). Uses the SECRET API key (oryk_live_...). Never put the key inside a Flutter app: in the app use OryksaClient with a session token created here with createSession.

Constructors

Oryksa(String apiKey, {String baseUrl = oryksaDefaultBase, Client? httpClient, Duration timeout = const Duration(seconds: 60)})
Creates the server client.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
timeout → Duration
Time limit for each request.
final

Methods

account() → Future<Map<String, dynamic>>
Account, plan and usage.
addFaq(List<Map<String, String>> items) → Future<Map<String, dynamic>>
Add questions and answers to the Brain.
chat(String message, {String? conversationId, String? customerName}) → Future<OryksaReply>
Chat with the AI employee. Reuse conversationId to keep the context.
close() → void
Closes the underlying HTTP client.
createSession({String? conversationId, String? customerName, int ttlMinutes = 60}) → Future<Map<String, dynamic>>
Short-lived token for one app user. Send only client_token to the app.
learnApp({required String name, String? description, String? url, String? agentName, List<String>? languages, List<Map<String, String>> screens = const [], Map<String, Object?> settings = const {}, List<Map<String, String>> faq = const []}) → Future<Map<String, dynamic>>
Teach the AI employee about your app: what it is, its screens, settings and FAQ. Call it on every release so the Brain stays in sync with the app.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setPages(List<Map<String, String>> pages, {String? businessSummary, String? siteUrl}) → Future<Map<String, dynamic>>
Replace the app pages the AI knows (Brain).
toString() → String
A string representation of this object.
inherited
updateAgent(Map<String, dynamic> fields) → Future<Map<String, dynamic>>
Update the AI employee profile (name, business, languages...).

Operators

operator ==(Object other) → bool
The equality operator.
inherited