Gemini Transcription Evaluator (speech/gemini-transcription.ts)

airi · evals/tts-speech-formula/eval/evaluators/speech/gemini-transcription.ts · typescript · MIT
voice, ai

Parses Gemini generateContent responses to extract transcriptions, separating text from reasoning parts. Used in TTS and speech formula automated evaluations.

// Source: https://github.com/moeru-ai/airi | License: MIT | Copyright 2024-PRESENT Neko Ayaka
// Provided via justclaw.it.com; keep this notice with the code.
import type { TranscriptionExecutor } from './speech-models'

import { Buffer } from 'node:buffer'

// NOTICE:
// This module has no runtime relative import, because `eval/tasks/read-aloud/config.ts` imports it through the package
// export `./gemini-transcription`. Vieval loads configs with Node type stripping, which cannot follow an extensionless
// relative import. Type imports are stripped, so they are safe.
// Source: the same constraint as `speech-models.ts`, see eval/index.ts.
// Remove this notice when vieval loads configs with an extension-resolving loader.

/** The text part of a Gemini `generateContent` answer. Thought pa

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

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

Get a free API key