Capability first · transport second

IsolatedModelQuestionRunner.js

Inspects one exact model and runs one isolated question while preserving complete results.

SDK 0.5.18Runtime 0.8.12Protocol arcane/1
On this page

Overview

Inspects one exact model and runs one isolated question while preserving complete results.

  • Artifact
    IsolatedModelQuestionRunner.js · esm
  • Classification
    public first party
  • Availability
    Native bridge or injected provider
  • Normalization
    Complete inspection/question forwarding, complete provider results, informative sentence counts, and coded malformed-result errors are normalized.

Import and lifecycle

JavaScript
import * as module from '/arcane/modules/IsolatedModelQuestionRunner.js';

Construction only validates and binds an injected localAI bridge. inspectModel() and runQuestion() make one Core call each; onPhase is forwarded only for that operation and the runner retains no listener.

Application-facing behavior: default/named runner, countSentences(), inspectModel(), runQuestion().

Protocol and host implementation

localAI isolated-model methods This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
IsolatedModelQuestionRunnerclassclass IsolatedModelQuestionRunner
countSentencesfunctionfunction countSentences(value)value
defaultdefault · classclass IsolatedModelQuestionRunner
CallableKindExact public signatureParameter syntax
countSentencesexported-functionfunction countSentences(value)value
IsolatedModelQuestionRunner.inspectModelpublic-memberasync inspectModel(model,expectedModel,contextTokens)model,expectedModel,contextTokens
IsolatedModelQuestionRunner.runQuestionpublic-memberasync runQuestion(input={})input={}
MemberKindExact public declarationParameter syntax
IsolatedModelQuestionRunner.constructorconstructorconstructor({localAI}={}){localAI}={}
IsolatedModelQuestionRunner.inspectModelasync methodasync inspectModel(model,expectedModel,contextTokens)model,expectedModel,contextTokens
IsolatedModelQuestionRunner.runQuestionasync methodasync runQuestion(input={})input={}

Parameter meanings and results

countSentences(string) returns an informative punctuation-group count without limiting the answer. new Runner({localAI}) binds the selected bridge; inspectModel(model,expectedModel?,contextTokens?) forwards the complete request and accepts any positive context value. runQuestion() accepts {model,prompt,systemPrompt?,options?,expectedModel?,think?,onPhase?}, preserves the complete provider result, and adds sentenceCount.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

  • Optional onPhase(phase,event) callback from the Core operation.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • INVALID_ISOLATED_MODEL_RUNNER_REQUEST
  • ARCANE_ISOLATED_MODEL_API_UNAVAILABLE
  • ARCANE_ISOLATED_MODEL_RESPONSE_INVALID
  • TypeError for non-string countSentences().
  • Underlying Core rejection is preserved.

Availability and capabilities

Native bridge or injected provider. Complete inspection/question forwarding, complete provider results, informative sentence counts, and coded malformed-result errors are normalized.

Core-only ai.inference; bound to Kempo. Question execution is exclusive, and Core cleanup remains owned by the bridge.

Contract example

JavaScript
import Runner from '/arcane/modules/IsolatedModelQuestionRunner.js';

async function ask({model, expectedModel, prompt, onPhase}) {
    const runner = new Runner({localAI:Arcane.localAI});
    await runner.inspectModel(model, expectedModel, 8192);
    return runner.runQuestion({
        model,
        expectedModel,
        prompt,
        systemPrompt:'Answer only the supplied question.',
        options:{num_ctx:8192, temperature:0.2},
        onPhase
    });
}