Skip to Content

TopicExtractOptions

Defined in: src/lib/memory/topicExtract.ts:70 

Options for the topic-extraction LLM call. Auth follows the portal dual pattern — one of apiKey / getToken is required (see PortalLlmAuth).

Extends

Properties

apiKey?

optional apiKey: string

Defined in: src/lib/memory/portalLlm.ts:72 

Direct API key — sent as x-api-key (server-side / CLI usage). Wins when both are provided.

Inherited from

PortalLlmAuth.apiKey


backoffMs()?

optional backoffMs: (attempt: number) => number

Defined in: src/lib/memory/topicExtract.ts:92 

Parameters

ParameterType

attempt

number

Returns

number


baseUrl?

optional baseUrl: string

Defined in: src/lib/memory/topicExtract.ts:72 


endpointOverride?

optional endpointOverride: string

Defined in: src/lib/memory/topicExtract.ts:83 

Optional per-call request path override, forwarded to callPortalJsonCompletion. When set, topic extraction POSTs to baseUrl + endpointOverride instead of the default /api/v1/chat/completions. The body follows the transport, not the path: a model that needs the Responses API is moved from a .../chat/completions override to its sibling .../responses with a Responses-shaped body. Lets callers route this internal-utility pass to a dedicated endpoint. Invalid values throw at call time (see validateEndpointOverride).


existingEntityNames?

optional existingEntityNames: readonly string[]

Defined in: src/lib/memory/topicExtract.ts:100 

The user’s existing entity vocabulary (canonical names). Included in the prompt so independent batches reuse canonical names instead of fragmenting (“ZetaChain” / “Zetachain” / “zeta chain” as three graph nodes). Truncated to the first MAX_VOCABULARY_NAMES names — pass the most-linked names first.


fetchFn()?

optional fetchFn: {(input: RequestInfo | URL, init?: RequestInit): Promise<Response>; (input: string | Request | URL, init?: RequestInit): Promise<Response>; }

Defined in: src/lib/memory/topicExtract.ts:88 

Override the global fetch implementation (useful for tests).

Call Signature

(input: RequestInfo | URL, init?: RequestInit): Promise<Response>

MDN Reference 

Parameters

ParameterType

input

RequestInfo | URL

init?

RequestInit

Returns

Promise<Response>

Call Signature

(input: string | Request | URL, init?: RequestInit): Promise<Response>

MDN Reference 

Parameters

ParameterType

input

string | Request | URL

init?

RequestInit

Returns

Promise<Response>


getToken()?

optional getToken: () => Promise<string | null>

Defined in: src/lib/memory/portalLlm.ts:74 

Function to get an auth token (e.g., Privy’s getIdentityToken). Token is sent as Authorization: Bearer.

Returns

Promise<string | null>

Inherited from

PortalLlmAuth.getToken


maxAttempts?

optional maxAttempts: number

Defined in: src/lib/memory/topicExtract.ts:89 


model?

optional model: string

Defined in: src/lib/memory/topicExtract.ts:86 

Defaults to DEFAULT_EXTRACTION_MODEL — the sanctioned extraction model. Don’t point this at a second model without an eval.


onBatch()?

optional onBatch: (diagnostics: TopicExtractionBatchDiagnostics) => void

Defined in: src/lib/memory/topicExtract.ts:71 

Parameters

ParameterType

diagnostics

TopicExtractionBatchDiagnostics

Returns

void


piiRedaction?

optional piiRedaction: boolean | PiiRedactor

Defined in: src/lib/memory/topicExtract.ts:108 

When set, PII in memory contents is replaced with tagged placeholders before the LLM call and returned entity names are de-anonymized (entities whose placeholders can’t be restored are dropped) — mirrors ExtractFactsOptions.piiRedaction. Vault contents hold REAL values, so callers that redact the conversation pipeline must redact this pass too.


timeoutMs?

optional timeoutMs: number

Defined in: src/lib/memory/topicExtract.ts:90 


totalTimeoutMs?

optional totalTimeoutMs: number

Defined in: src/lib/memory/topicExtract.ts:91 

Last updated on