Skip to the page

Ask the assistant

Answers a question about the workspace by looking it up with the methods of this API. A change is never carried out by asking: the answer holds the change it proposes, and sending that back as run carries it out.

View as
opensend.ask.send(input)
Needs the scopeworkspace:readFrom a terminalopensend ask send

Input

  • messagesobject[]Required

    The conversation so far, oldest first. The last message is the question. Up to 40 items.

  • messages[].rolestringRequired

    Who said it: user or assistant.

    One ofuserassistant

  • messages[].textstringRequired

    What was said. Up to 4,000 characters.

  • pagestring

    The screen the person is on, so the answer can be about it. Up to 200 characters.

  • runobject

    A change the assistant proposed and the person confirmed. With it the change is made and no model is asked.

  • run.callstringRequired

    The name of the method to run, such as domains.create. Up to 80 characters.

  • run.inputRecord<string, unknown>Required

    The input for that method.

Returns

The call resolves to the answer, already parsed. A call the API refuses throws OpenSendError with the code and the message of the answer. SDK lists the errors of the client itself.

  • object"ask_answer"

    Always ask_answer.

  • textstring

    The answer, as plain text.

  • stepsobject[]

    The methods that were run to find the answer.

  • steps[].callstring

    The method that was run.

  • steps[].titlestring

    The method in a few words.

  • steps[].okboolean

    Whether it worked.

  • proposalobject | null

    A change the assistant wants to make and is waiting for a yes on, or null.

  • proposal.callstring

    The method the assistant wants to run.

  • proposal.titlestring

    The method in a few words.

  • proposal.descriptionstring

    What running it would do.

  • proposal.effectstring

    What it does to your data: write, send or destroy.

    One ofreadwritesenddestroy

  • proposal.inputRecord<string, unknown>

    The input it would be run with.

  • resultRecord<string, unknown> | null

    What a confirmed change returned, or null.