Skip to main content
These examples assume a session created through the quickstart. They are independent alternatives: do not send every example for the same question. Choice labels are illustrative; use those of your question.

Open question

Send the person’s actual words.

Choice question

Use the exact labels returned by the pending question. Send one label for single choice, and several only if multiple choices are allowed.

Semi-open question

Choices alone are sufficient. If the person adds an explanation, send it in free_text / freeText. A free-text “other” answer alone is also possible.

No answer or refusal

These outcomes need no text. Do not use them as a substitute for an actual answer.

Context received outside the exchange

apply_events / applyEvents updates state without consuming a turn or selecting a new question. The engine may analyze this text.

Already-known data

Use the stable identifier of the information configured in your domain, not an invented ID. Here, available_budget must exist in the published version. Confirmed structured data needs no text analysis.

What the SDK handles

For answer(...), it associates the answer with the pending decision and resolves choice labels. Answering an open question without text is rejected locally, before any network call. It then returns the next decision, not just an acknowledgement. Choices alone and no-answer outcomes need no model call, provided no other text requiring analysis is supplied. Free text is analyzed by the engine: do not routinely copy a choice label into user_text. After adding context or data, a question may already be pending. Do not assume that the update automatically selected a new one. See Manage a conversation.