Skip to content
1 min read · 240 words

Interface: SearxngRequestContext

Defined in: src/batteries/tools/searxng/index.ts:85

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

Methods

shortCircuit()

ts
shortCircuit(result: string): void;

Defined in: src/batteries/tools/searxng/index.ts:99

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

Parameters

ParameterType
resultstring

Returns

void