Skip to content

@codesoul-co/hypha-serving-cache / prefix-shape

Using this module

Use the Prefix shape module for using the public contracts and operations for this capability boundary. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  PrefixCacheShapeTracker,
} from '@codesoul-co/hypha-serving-cache';

import type {
  PrefixCacheShapeInput,
} from '@codesoul-co/hypha-serving-cache';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
PrefixCacheShapeTrackerclassnew PrefixCacheShapeTracker(maxSnapshots?: number): PrefixCacheShapeTrackerPrefix Cache Shape Tracker class with 2 public constructor or member entries; its exact declarations are listed below.
PrefixCacheShapeInputinterfaceinterface PrefixCacheShapeInputPrefix Cache Shape Input interface with 4 public fields or methods.

PrefixCacheShapeTracker

Prefix Cache Shape Tracker class with 2 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { PrefixCacheShapeTracker } from '@codesoul-co/hypha-serving-cache';
  • Source module: prefix-shape

Declaration

text
export declare class PrefixCacheShapeTracker {
    constructor(maxSnapshots?: number);
    observe(input: PrefixCacheShapeInput): PrefixCacheShapeObservation;
}

Public members

MemberKindSignatureDescription
constructorconstructor(maxSnapshots?: number): PrefixCacheShapeTrackerCreates an instance of this class.
observemethodobserve(input: PrefixCacheShapeInput): PrefixCacheShapeObservationPublic method; parameters and return type are shown in the signature.

PrefixCacheShapeInput

Prefix Cache Shape Input interface with 4 public fields or methods.

  • Kind: interface
  • Import: import type { PrefixCacheShapeInput } from '@codesoul-co/hypha-serving-cache';
  • Source module: prefix-shape

Declaration

text
export interface PrefixCacheShapeInput {
    provider: string;
    model: string;
    scope?: CacheScope;
    prefixMetadata: PromptPrefixMetadata;
}

Contract members

MemberKindSignatureDescription
modelpropertymodel: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
prefixMetadatapropertyprefixMetadata: PromptPrefixMetadataPublic property; its type, readonly modifier and optionality are shown in the signature.
providerpropertyprovider: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
scopepropertyscope?: CacheScopePublic property; its type, readonly modifier and optionality are shown in the signature.