Documentation
    Preparing search index...

    Function deriveAnswer

    • Derive the deterministic answer for a request: a tool call when tools are offered and not yet answered, a tool-aware sentence after a toolResult, a JSON object for format: "json", else a canned sentence quoting the last user prompt.

      Parameters

      Returns MockLlmAnswer

      The answer to stream.

      deriveAnswer({ handle: 'h', messages: [{ role: 'user', content: [{ type: 'text', text: 'Hi' }] }] }, 'call_1').text;
      // 'You asked: "Hi". This is a deterministic mock completion; no provider was contacted.'