Skip to Content
Anuma SDKReactInternalInterfacesWebSearchPreProcessorOptions

WebSearchPreProcessorOptions

Defined in: src/lib/chat/webSearchClassifier.ts:66 

Properties

fetchSearchResults()?

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

Defined in: src/lib/chat/webSearchClassifier.ts:77 

Called with the caller’s search provider when the classifier decides a web search is needed. Return either a plain string (the SDK will wrap it in a default user message) or a fully-formed message array (full control over role/shape). Omit to run in observer mode — classification still fires but no messages are injected.

The signal argument is forwarded from the tool loop so long-running search 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/webSearchClassifier.ts:86 

Score margin: searchScore must exceed noSearchScore by at least this amount to classify as “needs web search”.

Default

0.02

onClassification()?

optional onClassification: (result: WebSearchClassification) => void

Defined in: src/lib/chat/webSearchClassifier.ts:88 

Observe the classification without injecting anything.

Parameters

ParameterType

result

WebSearchClassification

Returns

void

Last updated on