Documentation
    Preparing search index...

    Interface PajaLlmHost

    Paja's NAP-LLM host plus the configuration probe the shell adapter needs.

    interface PajaLlmHost {
        authorize(
            context: LlmRequestContext,
            connection: LlmConnection,
            request: LlmGenerationRequest,
            options?: LlmPromptOptions,
        ): boolean | Promise<boolean>;
        describe(
            context: LlmRequestContext,
            connectionId: string,
        ): LlmConnection | Promise<LlmConnection | null> | null;
        generate(
            context: LlmRequestContext,
            connection: LlmConnection,
            request: LlmGenerationRequest,
            hooks: LlmGenerateHooks,
        ): Promise<LlmGeneration>;
        isConfigured(): boolean;
        select(
            context: LlmRequestContext,
            requirements: LlmRequirements,
            options?: LlmPromptOptions,
        ): LlmConnection | Promise<LlmConnection | null> | null;
        subscribe?(listener: () => void): () => void;
    }

    Hierarchy

    • LlmConnectionHost
      • PajaLlmHost
    Index

    Methods

    • Obtain disclosure consent for one generation before any prompt content leaves the runtime. options.signal aborts when the generation settles while the prompt is still open.

      Parameters

      • context: LlmRequestContext
      • connection: LlmConnection
      • request: LlmGenerationRequest
      • Optionaloptions: LlmPromptOptions

      Returns boolean | Promise<boolean>

    • Revalidate a connection by host id; null when it no longer exists.

      Parameters

      • context: LlmRequestContext
      • connectionId: string

      Returns LlmConnection | Promise<LlmConnection | null> | null

    • Perform the provider request. Throw LlmServiceError for typed failures; anything else becomes provider-error.

      Parameters

      • context: LlmRequestContext
      • connection: LlmConnection
      • request: LlmGenerationRequest
      • hooks: LlmGenerateHooks

      Returns Promise<LlmGeneration>

    • Ask the user to choose a connection meeting the requirements. Return null when the user declines (user-cancelled). Throw new LlmServiceError('unsupported', …) when no compatible connection exists.

      Parameters

      • context: LlmRequestContext
      • requirements: LlmRequirements
      • Optionaloptions: LlmPromptOptions

      Returns LlmConnection | Promise<LlmConnection | null> | null

    • Notify the service when connections, credentials or the account change so every handle expires.

      Parameters

      • listener: () => void

      Returns () => void