Skip to content
1 min read · 106 words

Type Alias: SpoolHook ​

ts
type SpoolHook = (
  id: string,
  text: string,
  recommended: ArtifactConstructorResolver,
) => SpooledArtifact | undefined;

Defined in: src/batteries/tools/web_retrieval/index.ts:46

A reader-backed-artifact hook. Called by a converter for content that may be large; the converter passes the artifact constructor it recommends for this content (an open @nhtio/adk/forge!ArtifactConstructorResolver) so the caller can wrap with the right subclass — preserving its forged query tools — using the caller's own core import. Return a @nhtio/adk!SpooledArtifact to store the content reader-backed, or undefined to keep it inline as a string.

Parameters ​

ParameterType
idstring
textstring
recommendedArtifactConstructorResolver

Returns ​

| SpooledArtifact | undefined