Elements runtime reference / AI and delivery

askDashbot

Call Dashbot from inside an Element and read the answer under the execution access context.

Signatuur

askDashbot(prompt, responseFormat=None, allowTools=None, maxToolCalls=None, toolScope=None, contextId=None, timeoutSeconds=None, language=None, timeZone=None, localNow=None, localDate=None)

Doel

Call Dashbot from inside an Element and read the answer under the execution access context.

Aliases and imports

  • ask_dashbot
  • callDashbot
  • call_dashbot
  • dashbot.ask

Payloadformaat

Use these fields as the Python call arguments or keyword payload for this helper.

{
  "prompt": "Summarize these rows in one operational sentence.",
  "allowTools": false,
  "timeoutSeconds": 120,
  "responseFormat": {
    "type": "json_object"
  }
}
FieldDescription
promptRequired prompt string.
responseFormatOptional JSON response-format object passed to Dashbot.
allowToolsOptional bool. Defaults false in Element runtime to avoid recursive Element/Dashbot/tool loops.
maxToolCallsOptional tool-call cap when allowTools is true.
toolScopeOptional Dashbot tool scope, usually general.
contextIdOptional memory context id. Omit for isolated one-shot calls.
timeoutSecondsOptional request timeout.
language/timeZone/localNow/localDateOptional context forwarded to Dashbot.

Return payload

{
  "message": {
    "role": "assistant",
    "content": "{\"summary\":\"Orders are stable.\"}"
  },
  "text": "{\"summary\":\"Orders are stable.\"}",
  "parsed": {
    "summary": "Orders are stable."
  },
  "usage": {
    "inputTokens": 120,
    "outputTokens": 12
  },
  "warnings": []
}

Voorbeeld

def run():
    answer = askDashbot(
        "Summarize this status in one sentence.",
        allowTools=False,
        responseFormat={"type": "json_object"},
    )
    return {"summary": answer.parsed.get("summary") if answer.parsed else answer.text}

Scope-notities