WebSearchPreProcessorOptions
Defined in: src/lib/chat/webSearchClassifier.ts:66
Properties
fetchSearchResults()?
optionalfetchSearchResults: (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
| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
Returns
Promise<string | LlmapiMessage[]>
margin?
optionalmargin: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.02onClassification()?
optionalonClassification: (result:WebSearchClassification) =>void
Defined in: src/lib/chat/webSearchClassifier.ts:88
Observe the classification without injecting anything.
Parameters
| Parameter | Type |
|---|---|
|
|
Returns
void