Skip to content
1 min read · 240 words

Interface: SearxngRequestContext

Defined in: batteries/tools/searxng/index.ts:83

Mutable context handed to each input-pipeline stage before the HTTP request is sent.

Remarks

Stages mutate this in place (onion (ctx, next) style) to adjust the outgoing request — inject or rotate auth headers, force a language, rewrite the query — or call SearxngRequestContext.shortCircuit to skip the fetch entirely (e.g. a cache hit).

Properties

PropertyModifierTypeDescriptionDefined in
headerspublicSearxngHeadersResolved request headers. Mutable — inject, redact, or rotate auth here.batteries/tools/searxng/index.ts:91
instanceUrlreadonlystringThe target instance base URL (read-only).batteries/tools/searxng/index.ts:93
paramspublicRecord<string, string>Extra SearXNG query parameters (categories, engines, language, …). Mutable.batteries/tools/searxng/index.ts:89
querypublicstringThe search query. Mutable.batteries/tools/searxng/index.ts:87
stashreadonlyMap<string, unknown>Cross-stage scratch space; also carried onto the response context.batteries/tools/searxng/index.ts:95
toolNamereadonlystringThe tool's name (read-only).batteries/tools/searxng/index.ts:85

Methods

shortCircuit()

ts
shortCircuit(result: string): void;

Defined in: batteries/tools/searxng/index.ts:97

Skip the fetch and return result verbatim as the tool's output.

Parameters

ParameterType
resultstring

Returns

void