Reference/Autoevals library/TypeScript/Modules

Namespace: Moderation

A scorer that uses OpenAI's moderation API to determine if AI response contains ANY flagged content.

Param

Param

Optional. Threshold to use to determine whether content has exceeded threshold. By default, it uses OpenAI's default. (Using flagged from the response payload.)

Param

Optional. Specific categories to look for. If not set, all categories will be considered.

Functions

partial

partial<T>(args): Scorer<string, Omit<{ threshold?: number } & OpenAIAuth, T> & Partial<Pick<{ threshold?: number } & OpenAIAuth, T>>>

Type parameters

NameType
Textends keyof OpenAIAuth | "threshold"

Parameters

NameType
args{ [K in keyof OpenAIAuth | "threshold"]: (Object & OpenAIAuth)[K] }

Returns

Scorer<string, Omit<{ threshold?: number } & OpenAIAuth, T> & Partial<Pick<{ threshold?: number } & OpenAIAuth, T>>>

Defined in

autoevals/js/partial.ts:5

On this page