Neutrome SDK reference
    Preparing search index...

    Type Alias RuntimeContext

    The runtime services available while a request is being served.

    Executors and transforms never talk to providers directly: they call RuntimeContext.invoke, which lets the runtime handle routing, auditing and cancellation.

    type RuntimeContext = {
        cache: Cache;
        signal: AbortSignal;
        invoke(executor: ExecutorInput, request: Program): Promise<Program>;
        invokeStream(
            executor: ExecutorInput,
            request: Program,
        ): AsyncIterable<Program>;
        observe(event: ExecutionEvent): void;
    }
    Index
    cache: Cache

    Request-scoped cache.

    signal: AbortSignal

    Aborts when the client goes away or the request times out.

    • Runs another executor, or a model id, to completion.

      Parameters

      Returns Promise<Program>

      The response program.

    • Runs another executor, or a model id, and streams its chunks.

      Parameters

      Returns AsyncIterable<Program>

      The response chunks.