Skip to Content

Function render

  • Render an operation's result as text a model can read.

    Every result carries Instructions — the service's own guidance on what to do with what came back — and that is included, because a model that never sees it is left to guess.

    These results are interfaces, which have no run-time identity, so the dispatch here is on the field only one of them carries. outcome is tested before operationId because a revert carries both.

    Parameters

    • value: Rendered

      Any result a memory operation returns.

    Returns string

    The result as text.

    TypeError If the value is not a result this renders. The parameter type stops a typed caller reaching this; the guard is for the untyped ones, which is most agent code.

    console.log(render(await session.search('how does X work')))