Skip to Content
Anuma SDKReactInternalInterfacesCryptoPricePreProcessorOptions

CryptoPricePreProcessorOptions

Defined in: src/lib/chat/cryptoPriceClassifier.ts:69 

Properties

fetchCryptoPriceData()?

optional fetchCryptoPriceData: (prompt: string, options: object) => Promise<string | LlmapiMessage[]>

Defined in: src/lib/chat/cryptoPriceClassifier.ts:80 

Called with the caller’s crypto-price provider when the classifier decides the prompt is asking for crypto prices. Return either a plain string (wrapped by the SDK in a default user message) or a fully-formed LlmapiMessage[] (full control over role/shape). Omit to run in observer mode — classification still fires but nothing is injected.

The signal argument is forwarded from the tool loop so long-running price-API requests can be aborted when the caller aborts.

Parameters

ParameterType

prompt

string

options

object

options.signal?

AbortSignal

Returns

Promise<string | LlmapiMessage[]>


margin?

optional margin: number

Defined in: src/lib/chat/cryptoPriceClassifier.ts:89 

Score margin: cryptoPriceScore must exceed noCryptoPriceScore by at least this amount to classify as “needs crypto price data”.

Default

0.02

onClassification()?

optional onClassification: (result: CryptoPriceClassification) => void

Defined in: src/lib/chat/cryptoPriceClassifier.ts:91 

Observe the classification without injecting anything.

Parameters

ParameterType

result

CryptoPriceClassification

Returns

void

Last updated on