> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zelinqa.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Answers and context

> Send an open answer, choices, a refusal, or already-known information.

These examples assume a `session` created through the [quickstart](/en/quickstart/overview). **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.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    decision = session.answer("We would like to start in November.")
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    const decision = await session.answer({
      userText: "We would like to start in November.",
    });
    ```
  </Tab>
</Tabs>

## 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.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    decision = session.answer(choice_labels=["Hybrid"])
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    const decision = await session.answer({ choiceLabels: ["Hybrid"] });
    ```
  </Tab>
</Tabs>

## 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.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    decision = session.answer(
        choice_labels=["Hybrid"],
        free_text="Three days on site and two remotely.",
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    const decision = await session.answer({
      choiceLabels: ["Hybrid"],
      freeText: "Three days on site and two remotely.",
    });
    ```
  </Tab>
</Tabs>

## No answer or refusal

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

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    decision = session.answer(outcome="asked_no_answer")
    # For an actual refusal, use outcome="refused".
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    const decision = await session.answer({ outcome: "asked_no_answer" });
    // For an actual refusal, use outcome: "refused".
    ```
  </Tab>
</Tabs>

## 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.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    state = session.apply_events(
        context_update={
            "mode": "summary",
            "text": "The person confirmed by email that they are moving in November.",
        }
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    const state = await session.applyEvents({
      context_update: {
        mode: "summary",
        text: "The person confirmed by email that they are moving in November.",
      },
    });
    ```
  </Tab>
</Tabs>

## 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.

<Tabs>
  <Tab title="Python">
    ```python theme={null}
    state = session.apply_events(
        client_updates={
            "data": [{"id": "available_budget", "operation": "set", "value": 2500}]
        }
    )
    ```
  </Tab>

  <Tab title="TypeScript">
    ```ts theme={null}
    const state = await session.applyEvents({
      client_updates: {
        data: [{ id: "available_budget", operation: "set", value: 2500 }],
      },
    });
    ```
  </Tab>
</Tabs>

## 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](/en/concepts/session-lifecycle).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.