Databricks SDK for JavaScript
    Preparing search index...
    interface AiDecideRequest {
        options?: AiDecideOptions;
        questions?: JsonValue;
        state?: JsonValue;
    }
    Index

    Properties

    options?: AiDecideOptions

    Function options. Omitted fields fall back to their documented defaults.

    questions?: JsonValue

    A JSON object mapping question IDs to their definitions. Choose a nonempty string for each ID; its answer is returned with the same ID in response.answers.

    Each definition is an object with the required fields type and instructions. The criteria field is optional for the type noul but is required for the types choice and score.

    The instructions field describes the judgment to make and can be a string, object, or array. Use an object or array to include supporting context alongside the instructions.

    The type can be one of:

    • choice: Selects one option from a defined set. Requires criteria to be an object mapping 1 to 255 nonempty option names to descriptions. The criteria description can be a string, object, array, or null when the name needs no additional detail. For example:
    {
    "team": {
    "type": "choice",
    "instructions": "Which team should handle this ticket?",
    "criteria": {
    "billing": "Payments, charges, and refunds",
    "technical_support": null
    }
    }
    }
    • noul: Estimates the probability that the answer to a true-or-false question is true. criteria can take the fields true or false, or both, with descriptions that are strings, objects, or arrays. Omit criteria to use the question alone. For example, both of the following are valid:
    {
    "escalate": {
    "type": "noul",
    "instructions": "Does this ticket need escalation?",
    "criteria": {
    "true": "Suspected fraud or an exception to standard policy",
    "false": "A routine issue frontline support can resolve"
    }
    }
    }

    or

    {
    "escalate": {
    "type": "noul",
    "instructions": "Does this ticket need escalation?"
    }
    }
    • score: Rates the state on an ordered scale. Requires criteria to be an array of 2 to 10 level descriptions, ordered from low to high. Descriptions can be strings, objects, or arrays. Array positions define levels starting at 0. For example:
    {
    "urgency": {
    "type": "score",
    "instructions": "How urgent is this ticket?",
    "criteria": [
    "Routine: can wait a few days",
    "Time-sensitive: needs attention today",
    "Critical: needs immediate action"
    ]
    }
    }
    state?: JsonValue

    A string, JSON object, or array containing the content, related context, and examples needed to answer the provided questions. For example, provide a support message, a conversation, or records describing the current state of an application. All questions receive this same state.