Skip to content
1 min read · 240 words

Interface: SearxngRequestContext

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

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:77
instanceUrlreadonlystringThe target instance base URL (read-only).batteries/tools/searxng/index.ts:79
paramspublicRecord<string, string>Extra SearXNG query parameters (categories, engines, language, …). Mutable.batteries/tools/searxng/index.ts:75
querypublicstringThe search query. Mutable.batteries/tools/searxng/index.ts:73
stashreadonlyMap<string, unknown>Cross-stage scratch space; also carried onto the response context.batteries/tools/searxng/index.ts:81
toolNamereadonlystringThe tool's name (read-only).batteries/tools/searxng/index.ts:71

Methods

shortCircuit()

ts
shortCircuit(result: string): void;

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

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

Parameters

ParameterType
resultstring

Returns

void