@codesoul-co/hypha-serving-cache / key
- Package index:
@codesoul-co/hypha-serving-cache - Source:
packages/serving-cache/src/key.ts - Exports: 6
Using this module
Use the Key module for using the public contracts and operations for this capability boundary. It exports 6 functions.
Import from the package entrypoint
ts
import {
buildPromptPrefixMetadata,
canonicalize,
createLLMCacheKey,
hashStableJson,
normalizeLLMCacheKeyInput,
stableJson,
} from '@codesoul-co/hypha-serving-cache';Usage patterns
- The module exposes 6 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
buildPromptPrefixMetadata | function | buildPromptPrefixMetadata(input: LLMCacheKeyInput): PromptPrefixMetadata | Build Prompt Prefix Metadata function with 1 public call signature; parameters and return types are listed below. |
canonicalize | function | canonicalize(value: unknown): unknown | Canonicalize function with 1 public call signature; parameters and return types are listed below. |
createLLMCacheKey | function | createLLMCacheKey(input: LLMCacheKeyInput): string | Create LLM Cache Key function with 1 public call signature; parameters and return types are listed below. |
hashStableJson | function | hashStableJson(value: unknown): string | Hash Stable JSON function with 1 public call signature; parameters and return types are listed below. |
normalizeLLMCacheKeyInput | function | normalizeLLMCacheKeyInput(input: LLMCacheKeyInput): LLMCacheKeyInput | Normalize LLM Cache Key Input function with 1 public call signature; parameters and return types are listed below. |
stableJson | function | stableJson(value: unknown): string | Stable JSON function with 1 public call signature; parameters and return types are listed below. |
buildPromptPrefixMetadata
Build Prompt Prefix Metadata function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { buildPromptPrefixMetadata } from '@codesoul-co/hypha-serving-cache'; - Source module:
key
Declaration
text
export declare function buildPromptPrefixMetadata(input: LLMCacheKeyInput): PromptPrefixMetadata;Call signature
text
buildPromptPrefixMetadata(input: LLMCacheKeyInput): PromptPrefixMetadataParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | LLMCacheKeyInput | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
PromptPrefixMetadata - Description: The return contract is defined by the type shown above.
canonicalize
Canonicalize function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { canonicalize } from '@codesoul-co/hypha-serving-cache'; - Source module:
key
Declaration
text
export declare function canonicalize(value: unknown): unknown;Call signature
text
canonicalize(value: unknown): unknownParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
unknown - Description: The return contract is defined by the type shown above.
createLLMCacheKey
Create LLM Cache Key function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { createLLMCacheKey } from '@codesoul-co/hypha-serving-cache'; - Source module:
key
Declaration
text
export declare function createLLMCacheKey(input: LLMCacheKeyInput): string;Call signature
text
createLLMCacheKey(input: LLMCacheKeyInput): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | LLMCacheKeyInput | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
hashStableJson
Hash Stable JSON function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { hashStableJson } from '@codesoul-co/hypha-serving-cache'; - Source module:
key
Declaration
text
export declare function hashStableJson(value: unknown): string;Call signature
text
hashStableJson(value: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
normalizeLLMCacheKeyInput
Normalize LLM Cache Key Input function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { normalizeLLMCacheKeyInput } from '@codesoul-co/hypha-serving-cache'; - Source module:
key
Declaration
text
export declare function normalizeLLMCacheKeyInput(input: LLMCacheKeyInput): LLMCacheKeyInput;Call signature
text
normalizeLLMCacheKeyInput(input: LLMCacheKeyInput): LLMCacheKeyInputParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | LLMCacheKeyInput | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
LLMCacheKeyInput - Description: The return contract is defined by the type shown above.
stableJson
Stable JSON function with 1 public call signature; parameters and return types are listed below.
- Kind: function
- Import:
import { stableJson } from '@codesoul-co/hypha-serving-cache'; - Source module:
key
Declaration
text
export declare function stableJson(value: unknown): string;Call signature
text
stableJson(value: unknown): stringParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
value | unknown | Yes | Required parameter; accepted values are defined by the type column. |
Returns
- Type:
string - Description: The return contract is defined by the type shown above.
