Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3801,6 +3801,7 @@ export type ModerationConfig = {
automod_semantic_filters_config?: AutomodSemanticFiltersConfig;
automod_toxicity_config?: AutomodToxicityConfig;
block_list_config?: BlockListConfig;
llm_config?: LLMConfig;
team?: string;
};

Expand Down Expand Up @@ -4004,6 +4005,8 @@ export type ModerationActionType =
| 'bounce_flag'
| 'bounce_remove';

export type ModerationSeverity = 'low' | 'medium' | 'high' | 'critical';

export type AutomodRule = {
action: ModerationActionType;
label: string;
Expand All @@ -4021,6 +4024,24 @@ export type BlockListConfig = {
async?: boolean;
};

export type LLMConfig = {
rules: LLMRule[];
severity_descriptions?: Record<ModerationSeverity, string>;
app_context?: string;
};

export type LLMRule = {
label: string;
description: string;
action: ModerationActionType;
severity_rules?: LLMSeverityRule[];
};

export type LLMSeverityRule = {
severity: ModerationSeverity;
action: ModerationActionType;
};

export type AutomodToxicityConfig = {
enabled: boolean;
rules: AutomodRule[];
Expand All @@ -4047,7 +4068,7 @@ export type AutomodSemanticFiltersConfig = {

export type AITextSeverityRule = {
action: ModerationActionType;
severity: 'low' | 'medium' | 'high' | 'critical';
severity: ModerationSeverity;
};

export type AITextRule = {
Expand Down
Loading