Transcript Schema Definitions (transcript/schema.ts)

AFFiNE · packages/backend/server/src/plugins/copilot/transcript/schema.ts · typescript · MIT
ai, database, voice, tag:legacy, tag:data

Defines schemas for transcription data, including segments, audio blobs, and manifests, for legacy compatibility and data projection.

// Source: https://github.com/toeverything/AFFiNE | License: MIT | Copyright 2022-present TOEVERYTHING PTE. LTD. and its affiliates
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';

import {
  buildStructuredResponseContract,
  type RequiredStructuredOutputContract,
} from '../runtime/contracts';

// Owner: DB/job/API legacy compatibility and transcript projection.
// Native owns transcript domain result schemas; this file accepts historical
// nullable/partial payloads used by backend persistence and resolver surfaces.
export const LegacyTranscriptionSegmentSchema = z.object({
  speaker: z.string(),
  start: z.string(),
  end: z.string(),
  transcription: z.string(),
});

export const LegacyTranscriptionSchema = z.array(
  LegacyTranscriptionSegmen

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key