SDK reference · Node SDK

prov.trace.guard

prov.trace.guard in Node SDK. Wrap fn so it only ever sees a completion the account's Trace rules let through.

Signature

prov.trace.guard<R>(fn: (completion: TracedChatCompletion) => R | Promise<R>, opts?: TraceGuardOptions): (params: ChatCompletionParams) => Promise<R>

Parameters

fn(completion: TracedChatCompletion) => R | Promise<R>Required
optsTraceGuardOptions

Returns

(params: ChatCompletionParams) => Promise<R>

HTTP operation

Runs locally, with no request to the API.

Was this page helpful? Send us feedback

LLM? Read llms.txt.