Member Junction
    Preparing search index...

    The result of AIDecisionRunner.ExecuteDecision. The inherited members carry the outcome, the run row, timing, tokens, cost and the model that answered.

    interface AIDecisionRunResult {
        Answers: Record<string, DecisionAnswer>;
        cancellationReason?: CancellationReason;
        cancelled?: boolean;
        completionTokens?: number;
        cost?: number;
        costCurrency?: string;
        DecisionResult?: DecisionResult;
        DriverClass?: string;
        errorMessage?: string;
        executionTimeMS?: number;
        modelInfo?: ModelInfo;
        modelSelectionInfo?: AIModelSelectionInfo;
        promptRun?: MJAIPromptRunEntity;
        promptTokens?: number;
        status?: ExecutionStatus;
        success: boolean;
        tokensUsed?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Answers: Record<string, DecisionAnswer>

    The answers by question key. Empty on failure, so a caller never acts on partial answers.

    cancellationReason?: CancellationReason

    Reason for cancellation if applicable

    cancelled?: boolean

    Whether the execution was cancelled

    completionTokens?: number

    Number of tokens generated in the completion/output. This follows the ModelUsage convention from @memberjunction/ai

    cost?: number

    Cost of this execution if provided by the AI provider. The currency is specified in the costCurrency field.

    costCurrency?: string

    ISO 4217 currency code for the cost field. Examples: 'USD', 'EUR', 'GBP', 'JPY', etc.

    DecisionResult?: DecisionResult

    The driver's own result, including Usage and the vendor's ResolvedModel version.

    DriverClass?: string

    The driver class that answered, or was selected when the call failed.

    errorMessage?: string

    Error message if execution failed

    executionTimeMS?: number

    Total execution time in milliseconds

    modelInfo?: ModelInfo

    Model information for this result

    modelSelectionInfo?: AIModelSelectionInfo

    Model selection information for debugging and analysis

    The AIPromptRun entity that was created for tracking

    promptTokens?: number

    Number of tokens used in the prompt/input. This follows the ModelUsage convention from @memberjunction/ai

    Current execution status

    success: boolean

    Whether the execution was successful

    tokensUsed?: number

    Total tokens used (promptTokens + completionTokens). Note: This is a computed value - when creating objects, you don't need to set this.

    Use promptTokens and completionTokens separately for clarity