/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; /** * The kind of content the channel moderates. */ export const ContentType = { Profile: "profile", Message: "message", Post: "post", Comment: "comment", Event: "event", Product: "product", Review: "review", Voice: "voice", Other: "other", } as const; /** * The kind of content the channel moderates. */ export type ContentType = OpenEnum; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. */ export const FlaggingMode = { DryRun: "DRY_RUN", Active: "ACTIVE", } as const; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. */ export type FlaggingMode = OpenEnum; /** * Trade-off between transcription speed and accuracy. */ export const TranscriptionQuality = { Speed: "SPEED", Balanced: "BALANCED", Accuracy: "ACCURACY", } as const; /** * Trade-off between transcription speed and accuracy. */ export type TranscriptionQuality = OpenEnum; export type Channel = { /** * The ID of the channel. */ id: string; /** * The ID of the project the channel is in. */ projectId: string; /** * The key you pass as `channel` when you moderate content. Unique in the project. */ key: string; /** * The channel's name. */ name: string; /** * The channel's description. */ description: string | null; /** * Whether requests that name no channel use this one. Each project has one default channel. */ isDefault: boolean; contentType: ContentType | null; /** * `ACTIVE` flags content. `DRY_RUN` evaluates content without flagging it. */ flaggingMode: FlaggingMode; /** * Whether earlier messages in the conversation are read when moderating a message. */ contextEnabled: boolean; /** * Whether images are moderated. */ enableImageModeration: boolean; /** * Whether videos are moderated. */ enableVideoModeration: boolean; /** * Whether audio is moderated. */ enableAudioModeration: boolean; /** * Whether real-time voice streams are moderated. */ enableVoiceModeration: boolean; /** * Whether audio and video transcripts are returned in responses. */ includeTranscriptInResponse: boolean; /** * Trade-off between transcription speed and accuracy. */ transcriptionQuality: TranscriptionQuality; /** * Whether look-alike Unicode characters are normalized before moderation. */ unicodeSpoofDetectionEnabled: boolean; /** * Seconds between frames captured from a video. */ frameCaptureInterval: number; /** * The most frames moderated per video. */ maxFramesPerVideo: number; /** * Whether frames are spread evenly across the whole video. */ spreadFrames: boolean; /** * When the channel was created. */ createdAt: string; /** * When the channel was last changed. */ updatedAt: string; }; /** @internal */ export const ContentType$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(ContentType); /** @internal */ export const FlaggingMode$inboundSchema: z.ZodMiniType = openEnums.inboundSchema(FlaggingMode); /** @internal */ export const TranscriptionQuality$inboundSchema: z.ZodMiniType< TranscriptionQuality, unknown > = openEnums.inboundSchema(TranscriptionQuality); /** @internal */ export const Channel$inboundSchema: z.ZodMiniType = z.object({ id: types.string(), projectId: types.string(), key: types.string(), name: types.string(), description: types.nullable(types.string()), isDefault: types.boolean(), contentType: types.nullable(ContentType$inboundSchema), flaggingMode: FlaggingMode$inboundSchema, contextEnabled: types.boolean(), enableImageModeration: types.boolean(), enableVideoModeration: types.boolean(), enableAudioModeration: types.boolean(), enableVoiceModeration: types.boolean(), includeTranscriptInResponse: types.boolean(), transcriptionQuality: TranscriptionQuality$inboundSchema, unicodeSpoofDetectionEnabled: types.boolean(), frameCaptureInterval: types.number(), maxFramesPerVideo: types.number(), spreadFrames: types.boolean(), createdAt: types.string(), updatedAt: types.string(), }); export function channelFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Channel$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Channel' from JSON`, ); }