Member Junction
    Preparing search index...

    Interface AISpeechToTextRunParams

    Parameters for AISpeechToTextRunner.RunSpeechToText: the audio, as audioData bytes or a base 64 audioFile (one is required), and the driver's optional hints, plus the runner's options.

    The driver's model is set by the runner, per candidate, to the candidate's API name.

    interface AISpeechToTextRunParams {
        AgentID?: string;
        AgentRunID?: string;
        APIKeys?: AIAPIKey[];
        audioData?: Buffer;
        audioFile?: string;
        CancellationToken?: AbortSignal;
        ContextUser: UserInfo;
        CredentialScope?: AICredentialScope;
        fileName?: string;
        language?: string;
        ModelID?: string;
        OnPromptRunCreated?: (promptRunId: string) => void | Promise<void>;
        ParentRunID?: string;
        prompt?: string;
        PromptID?: string;
        temperature?: number;
        TimeoutMS?: number;
    }

    Hierarchy (View Summary)

    Index

    Properties

    AgentID?: string

    The agent the call is made for, recorded as the run row's AgentID.

    AgentRunID?: string

    The agent run this call belongs to. MJ: AI Prompt Runs has no agent-run column, so it is recorded in the row's Messages, for reading only. To join the row to the run, use OnPromptRunCreated.

    APIKeys?: AIAPIKey[]

    Keys by driver class, passed through as the base runner's apiKeys. A key reaches only the candidates of its own driver class. They rank as they do for chat prompts, just above the environment keys: a credential bound to the prompt-model, the model-vendor or the vendor, or a default credential of the vendor's credential type, wins over them.

    audioData?: Buffer

    The raw audio bytes, as an alternative to the base 64 audioFile.

    Preferred whenever the caller already holds a Buffer: base 64 encoding an hour of audio costs a third more memory than the bytes themselves, for a string the implementation immediately decodes again.

    audioFile?: string

    Base 64 encoded audio file to convert to text.

    Optional only in the sense that audioData may be supplied instead; exactly one of the two is required.

    CancellationToken?: AbortSignal

    Cancels the call, as AIPromptParams.cancellationToken cancels a chat call. A token already aborted refuses the call before a run row exists. Aborted during the call, it ends the call at once, before any further failover candidate, and the run row is recorded as Cancelled. The driver is handed it (composed with TimeoutMS) as its params' CancellationToken, so a request already sent is torn down by a driver that honors it.

    ContextUser: UserInfo

    The user the run is made and recorded for. Required.

    CredentialScope?: AICredentialScope

    Passed through as the base runner's CredentialScope. 'RuntimeOnly' restricts the run to APIKeys: a candidate whose driver class has no key there is skipped, never run on the platform's credentials.

    fileName?: string

    Original file name, e.g. episode-104.mp3. Some providers infer the container format from the extension, so supplying it when known improves reliability.

    language?: string

    ISO 639-1 language code of the spoken audio. Supplying it typically improves both accuracy and latency versus letting the model detect the language.

    ModelID?: string

    Pins the model by ID. Failover then stays within that model's vendors. Leave it unset to let the carrier prompt's bindings choose.

    OnPromptRunCreated?: (promptRunId: string) => void | Promise<void>

    Called with the run row's ID as soon as the row exists, before the model call: the hook an agent step uses to point its TargetLogID at the row. An error it throws is logged, never raised.

    ParentRunID?: string

    A parent MJ: AI Prompt Runs row, recorded as this run's ParentID.

    prompt?: string

    Optional text to steer style, spelling or vocabulary — e.g. proper nouns the model would otherwise mis-transcribe. Should be in the same language as the audio.

    PromptID?: string

    The MJ: AI Prompts row whose bindings choose the model and whose failover settings apply. Defaults to the runner's default carrier prompt, found by name.

    temperature?: number

    Model temperature, optional.

    TimeoutMS?: number

    A bound, in milliseconds, on each driver call, as AIPromptParams.timeoutMS bounds each chat call: every failover candidate gets its own. A call that runs longer fails with an AIPromptTimeoutError, which reads as a network error and so fails over. For audio a driver splits, the bound covers the whole transcription. Unset or not positive means no bound, unless the runner declares a DefaultPromptTimeoutMS.

    The timeout is composed into the signal the driver is handed as its params' CancellationToken, so a request that times out is torn down by a driver that honors it, not left running.