Skip to main content
Defined in: client/sampling/generic.ts:46 Contribution template. Wraps any async function into a SamplingHandler. The adapter resolves the model from modelPreferences, defaults maxTokens, and threads onToken through. Message format conversion, tool translation, and streaming are the caller’s responsibility. Example:

Implements

Constructors

Constructor

Defined in: client/sampling/generic.ts:50

Parameters

fn
GenericCompletionFn
options?
SamplingAdapterOptions & { defaultModel?: string; }

Returns

GenericSamplingAdapter

Methods

asHandler()

Defined in: client/sampling/generic.ts:58

Returns

SamplingHandler

Implementation of

SamplingAdapter.asHandler