Skip to main content
Version: v1 (Current)

AI-assisted form fields

The aiBuilder field configuration opens the platform's conversational field assistant. This is separate from Developer Hub agents that generate Apps or plugins. It proposes field values; the containing form and its normal validation/save workflow remain responsible for persistence.

Add the assistant​

The reviewed text and textarea wrappers render the assistant when field.aiBuilder is truthy. Dynamic-options and repeatable configuration components also have integrations, with their own output/application contracts; do not assume every field type accepts the same payload.

A text-field configuration can use:

{
"name": "welcome_message",
"type": "text",
"label": "Welcome Message",
"aiBuilder": {
"role": "Help staff write a short welcome message for attendees.",
"tooltipText": "Generate Welcome Message"
}
}

Use it inside the platform's supported field/form renderer with the expected store and dashboard context. The assistant request uses the current team slug and optional project slug from page props. Adding this configuration to a standalone component does not install authentication, a data store or the backend service. The inspected dashboard route inherits Sanctum authentication, verified-user checks, dashboard session/CSRF middleware and team-scope resolution, including team-access checks. This is a dashboard integration, not a public/attendee API contract.

Backend prerequisites and conversation state​

The field component posts to the team dashboard's gemini/request route (dashboard.admin-ai-session-messages). The inspected handler requires string field type/user message, an optional project string/system prompt and an optional existing integer admin-session ID. It looks up the system model with slug gemini and uses server Google Cloud configuration; selecting another project AI interface does not switch this handler's model.

A new conversation records the current admin, team and optional resolved project. Continuation looks up the supplied session by current team and adds a project constraint only when a project was supplied. That query has no explicit admin-owner filter. Do not describe component context IDs or this service lookup as a per-admin privacy boundary; verify actual route access and the intended team/project conversation policy in deployment. For setup, a system administrator should verify the gemini model record and endpoint using model configuration, while a platform maintainer verifies app.google_cloud_key using the driver transport prerequisites. Use the existing dashboard form renderer/store rather than treating field JSON as a standalone app. The handler's optional project_slug validation is not the project selection branch; this component sends project.

The current handler persists a user message before the provider request. On continuation it adds that message before checking whether history exceeds 20 entries, returning 400 when over the limit. A rejected request can therefore leave another saved user message; blindly retrying does not reset history. Provider failures can also follow saved input. The UI marks a history-limit error with a clear-chat action. Clear Chat forgets the component context’s local history/session ID; it does not delete the backend conversation records. Subsequent input can start a new session. Preserve/reconcile the conversation and use a new conversation deliberately when appropriate, rather than assuming request failure rolled back state.

A missing selected project or gemini model returns 404 in this handler. The response parser stores the first candidate/first text part, or the text Invalid response structure when that expected path is absent. A returned model message is not proof that the frontend has a usable suggestion. Check the actual saved field after selecting an option.

Configuration properties​

PropertyCurrent behavior
roleRole instructions for the generated system prompt. Optional: the component supplies a general form-writing role when absent.
toneAdds tone instructions; defaults to a professional, approachable conversation.
tooltipTextButton tooltip in supporting wrappers; verify the wrapper's fallback/display.
examplesAdditional examples appended to the prompt; objects are JSON-stringified, strings appended directly.
outputFormatDetailsExtra format instructions appended to the generated prompt.
outputFormatOverrides the option shape used in the generated prompt. This is prompting, not runtime schema validation.
includeLabelWhen no custom field outputFormat is supplied and the wrapper format lacks a label, adds a label to the suggested option shape. It does not make a text wrapper save a label.
fullFormSuppresses this component's current-field context. It does not generate a whole form or grant access to other fields.
systemPromptDeclared/passed by wrappers, but the reviewed send path submits finalSystemPrompt constructed from role/tone/format/examples/context. Do not rely on this property as a complete prompt override in this component.

The component's own outputFormat prop is supplied by its wrapper. Text/textarea wrappers request an option with value, including their configured maximum-length hint. Choose an option shape that the receiving wrapper actually understands before overriding it.

Response and applying a suggestion​

The generated prompt asks for this conversational envelope:

{
"chat": "Here is a suggested welcome message.",
"options": [
{"value": "Welcome! We are glad you are here."}
],
"chat_end": "You can select this option or ask for a revision."
}

This is a requested format, not a guarantee that every model/error response is valid JSON. The conversation parser and option UI process the response before a selected option is emitted as a save payload. For the reviewed text/textarea wrappers, the selected payload must be JSON representing an option with a truthy value, for example:

{"value":"Welcome! We are glad you are here."}

The text/textarea save handler parses that option, truncates the value to the wrapper's configured maximum length when applicable, and sends it through the normal field input handler. Empty/false values are not applied by this handler. Invalid JSON is logged to the browser console, and the modal closes; that is not a successful field update. A generated label is not saved by these text handlers. Review the new field value and complete the containing form's normal save process.

Dynamic-options applies selected properties to the active edit item's fields using lowercased field labels. It requires an active edit item and the correct store/field mapping; it is not interchangeable with the text value-only contract. Verify repeatable and other wrapper-specific behavior before using a custom output shape.

Repeatable fields and parser limits​

The reviewed repeatable configuration block builds output keys from lowercased labels of visible configured fields. Its save handler accepts a single option object or the first item of a legacy options array, applies matching label keys to the active item, then closes the modal and clears that active item. It does not create a new repeatable item merely because an option exists. Matching uses JavaScript toLowerCase() without trimming whitespace or removing punctuation. Unmatched keys are ignored; duplicate lowercased labels can apply one returned value to multiple configured fields. Use distinct labels and verify the target item; do not assume it follows text-field truncation or empty-value rules. For labels Display Name and Button Text, a selected repeatable option could be:

{"display name":"Guest welcome","button text":"Continue"}

Leading/trailing spaces in a configured label remain part of the key; normalize your labels deliberately instead of assuming the assistant removes them.

The frontend conversation parser attempts JSON parsing, recognizes expected envelope keys, can wrap arrays as options, and attempts limited repairs of malformed formatting. Some failures fall back to raw chat text or a generic error response. These paths are not schema validation for every custom option. Check the selectable option and receiving wrapper rather than treating visible chat text as a valid saved field value.

Existing content and context​

Text/textarea wrappers pass current content as {value: localValue}. Unless fullForm is set, the component can include the field label and serialized current value in the generated prompt. Choosing create-new mode suppresses that current-value context. The backend stores conversation messages, and the provider receives the constructed request. Provider handling, server-side retention and which staff can view records are deployment/policy questions for the platform owner; this component supplies no retention guarantee and Clear Chat does not remove those records. A custom prompt or fullForm flag is not a privacy boundary: inspect the actual request and avoid supplying sensitive field content unnecessarily.

Chat histories and backend admin-session IDs are tracked by the component's uniqueInputId context (default default). For direct AiFormFieldBuilder use, pass its Vue prop as :unique-input-id="stableFieldId" with a distinct stable string per input. This is a component prop, not a documented aiBuilder.uniqueInputId field option. The reviewed text/textarea wrappers do not forward such a field option, so do not add it to field JSON expecting context isolation. The component has shared loading state: its chat receives disabled/loading state while a request is in flight, and another-context text explains why sending is unavailable in that component. This UI behavior is not an authorization or backend concurrency guarantee.

Verify an integration​

  1. Confirm the assistant opens in the intended field wrapper and receives the correct team/project context.
  2. Use synthetic current content; check whether edit/create mode includes the intended context and configured examples.
  3. Inspect a successful response and select an option. Verify the field changes, maximum-length behavior and containing-form save/reload.
  4. In developer/component tests, inject malformed JSON and an empty value at the child assistant’s save event/parent save-handler boundary; this tests selected-option handling rather than merely malformed provider output. Mock a failed backend request separately. Confirm no unintended existing content is replaced. End-user acceptance should also cover a provider response with no selectable option.
  5. Test access using the actual dashboard role and backend AI configuration. A visible button or valid field JSON does not prove the user can call the assistant service.

Troubleshooting​

SymptomCheck
Assistant absentWrapper support and truthy aiBuilder configuration.
Custom prompt ignoredUse supported role/tone/format properties; the reviewed send path does not select the systemPrompt prop.
Suggestion shown but field unchangedSelected option JSON/value, active edit item for dynamic options, wrapper handler and normal form save.
Label not updatedText wrappers consume value only; includeLabel is a suggestion-shape instruction.
Existing content sent unexpectedlyCurrentValue, edit/create mode and fullForm; inspect the actual request.
Wrong chat contextDistinct uniqueInputId and the wrapper's component lifecycle.

Verification scope​

The documented wrapper/prompt/save, parser, backend session and route-middleware contracts completed source and fresh-reader review on 2026-10-15. Offline probes parse all four JSON examples and exercise actual text/textarea save handlers and conversation-parser branches with synthetic callbacks. These probes do not mount the browser UI or execute backend authorization/session persistence, provider calls, repeatable store mutations or deployment retention. Those remain integration acceptance work; source review does not establish stricter session ownership than the inspected query provides.