Tyr Admission Controller - v0.36.1
    Preparing search index...

    Class ResponsesStateStore

    Index
    file: string

    Absolute path of the state file.

    maxEntries: number
    ttlMs: number
    • Records a finished response and appends it to the state file before returning. Returns false when the response cannot be recorded. Never throws: a failed write is counted and the record stays usable in memory.

      Parameters

      • input: {
            owner?: Readonly<{ applicationId?: string; tenantId?: string }>;
            pool: string;
            responseId: string;
            tokens: number;
        }
        • Optionalowner?: Readonly<{ applicationId?: string; tenantId?: string }>
        • pool: string

          Pool that admitted the response.

        • responseId: string
        • tokens: number

          Provider-reported input plus output tokens.

      Returns boolean

    • Returns the recorded size of the response a follow-up names, or undefined when the follow-up must be refused: the id was never recorded here, its record was dropped or has expired, or it belongs to another owner. The three cases are deliberately indistinguishable to the caller.

      Parameters

      • input: {
            owner?: Readonly<{ applicationId?: string; tenantId?: string }>;
            pool: string;
            responseId: string;
        }
        • Optionalowner?: Readonly<{ applicationId?: string; tenantId?: string }>
        • pool: string

          Pool the follow-up is routed to.

        • responseId: string

      Returns number | undefined