Aventora Intake (Flutter)
Embedding-style form intake client: connects to the Aventora agent WebSocket as an anonymous user, with forms_enabled: true. Domain and target form id come from assets/intake.env (same idea as the HTML embedding samples under aventora-bot/embedding/).
The agent is expected to run with SECURE_AGENT=true. Before each WebSocket session the app obtains a JWT by:
POST {INTAKE_API_BASE_URL}/auth/api/v1/tokens/generatewith headerAuthorization: Bearer {INTAKE_DOMAIN_API_KEY}and JSON bodyusername: "anonymous",language,expires_in_hours(same pattern as domain API keys used for embedding / internal services).POST {INTAKE_API_BASE_URL}/auth/autologinwith JSON{ "token": "<temporary token from step 1>" }and usesaccess_tokenas the session JWT on the socket (?token=query +tokenin the first metadata message).
Start over closes the socket and runs that flow again (new temporary token, new JWT, new session).
On launch the app connects immediately; after the server sends connection, it optionally sends one bootstrap user message so the model can select_form for INTAKE_FORM_ID.
Configure assets/intake.env
| Key | Purpose |
|---|---|
AGENT_WS_URL | e.g. ws://127.0.0.1:7861/ws (Android emulator → ws://10.0.2.2:7861/ws) |
INTAKE_DOMAIN | Domain folder under SEARCH_DOMAIN_FOLDER (must contain form-depo/) |
INTAKE_FORM_ID | Form schema id (e.g. contact_form, mortgage_quote from LLM_full/domains/demo/form-depo/) |
INTAKE_LANGUAGE | e.g. en |
INTAKE_API_BASE_URL | HTTP base for auth (same as backend BACKEND_URL), e.g. https://api.example.com |
INTAKE_DOMAIN_API_KEY | Domain API key for /auth/api/v1/tokens/generate |
AGENT_JWT | Dev/test only: if set, skips the two-step mint and uses this JWT directly |
Overrides without editing the file
flutter run --dart-define=INTAKE_DOMAIN=demo --dart-define=INTAKE_FORM_ID=mortgage_quote
AGENT_WS_URL, INTAKE_API_BASE_URL, INTAKE_DOMAIN_API_KEY, and other keys support the same pattern.
Run
cd aventora-intake
flutter pub get
flutter run
Reference
For a parallel “configure URL + domain + embed” mental model, see aventora-bot/embedding/ (static HTML embeds). This app is the Flutter equivalent for intake-only sessions, with API-key → JWT aligned to how internal services authenticate (LLM/utils/internal_auth.py uses generate; this client adds autologin because the WebSocket validates a JWT, not the raw temporary token).