Skip to content

Commit e80e42c

Browse files
feat: llm config types for upsert config api (#1640)
## CLA - [ ] I have signed the [Stream CLA](https://docs.google.com/forms/d/e/1FAIpQLScFKsKkAJI7mhCr7K9rEIOpqIDThrWxuvxnwUq2XkHyG154vQ/viewform) (required). - [ ] Code changes are tested ## Description of the changes, What, Why and How? https://linear.app/stream/issue/MOD2-481/add-support-for-llm-config-for-upsertconfig-endpoint-to-js-sdk ## Changelog - Adding typescript for `llm_config` param on request of UpsertConfig API.
1 parent ab895bb commit e80e42c

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

src/types.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3801,6 +3801,7 @@ export type ModerationConfig = {
38013801
automod_semantic_filters_config?: AutomodSemanticFiltersConfig;
38023802
automod_toxicity_config?: AutomodToxicityConfig;
38033803
block_list_config?: BlockListConfig;
3804+
llm_config?: LLMConfig;
38043805
team?: string;
38053806
};
38063807

@@ -4004,6 +4005,8 @@ export type ModerationActionType =
40044005
| 'bounce_flag'
40054006
| 'bounce_remove';
40064007

4008+
export type ModerationSeverity = 'low' | 'medium' | 'high' | 'critical';
4009+
40074010
export type AutomodRule = {
40084011
action: ModerationActionType;
40094012
label: string;
@@ -4021,6 +4024,24 @@ export type BlockListConfig = {
40214024
async?: boolean;
40224025
};
40234026

4027+
export type LLMConfig = {
4028+
rules: LLMRule[];
4029+
severity_descriptions?: Record<ModerationSeverity, string>;
4030+
app_context?: string;
4031+
};
4032+
4033+
export type LLMRule = {
4034+
label: string;
4035+
description: string;
4036+
action: ModerationActionType;
4037+
severity_rules?: LLMSeverityRule[];
4038+
};
4039+
4040+
export type LLMSeverityRule = {
4041+
severity: ModerationSeverity;
4042+
action: ModerationActionType;
4043+
};
4044+
40244045
export type AutomodToxicityConfig = {
40254046
enabled: boolean;
40264047
rules: AutomodRule[];
@@ -4047,7 +4068,7 @@ export type AutomodSemanticFiltersConfig = {
40474068

40484069
export type AITextSeverityRule = {
40494070
action: ModerationActionType;
4050-
severity: 'low' | 'medium' | 'high' | 'critical';
4071+
severity: ModerationSeverity;
40514072
};
40524073

40534074
export type AITextRule = {

0 commit comments

Comments
 (0)