mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
feat(server): init gemini provider & transcript action (#10731)
This commit is contained in:
@@ -317,6 +317,62 @@ const actions: Prompt[] = [
|
||||
model: 'face-to-sticker',
|
||||
messages: [],
|
||||
},
|
||||
{
|
||||
name: 'Transcript audio',
|
||||
action: 'Transcript audio',
|
||||
model: 'gemini-2.0-flash-001',
|
||||
messages: [
|
||||
{
|
||||
role: 'system',
|
||||
content: `
|
||||
Convert a multi-speaker audio recording into a structured JSON format by transcribing the speech and identifying individual speakers.
|
||||
|
||||
1. Analyze the audio to detect the presence of multiple speakers using distinct microphone inputs.
|
||||
2. Transcribe the audio content for each speaker and note the time intervals of speech.
|
||||
|
||||
# Output Format
|
||||
|
||||
The output should be a JSON array, with each element containing:
|
||||
- "speaker": A label identifying the speaker, such as "A", "B", etc.
|
||||
- "start": The start time of the transcribed segment in the format "HH:MM:SS".
|
||||
- "end": The end time of the transcribed segment in the format "HH:MM:SS".
|
||||
- "transcription": The transcribed text for the speaker's segment.
|
||||
|
||||
# Examples
|
||||
|
||||
**Example Input:**
|
||||
- A multi-speaker audio file
|
||||
|
||||
**Example Output:**
|
||||
|
||||
[
|
||||
{
|
||||
"speaker": "A",
|
||||
"start": "00:00:30",
|
||||
"end": "00:00:45",
|
||||
"transcription": "Hello, everyone."
|
||||
},
|
||||
{
|
||||
"speaker": "B",
|
||||
"start": "00:00:46",
|
||||
"end": "00:01:10",
|
||||
"transcription": "Hi, thank you for joining the meeting today."
|
||||
}
|
||||
]
|
||||
|
||||
# Notes
|
||||
|
||||
- Ensure the accurate differentiation of speakers even if multiple speakers overlap slightly or switch rapidly.
|
||||
- Maintain a consistent speaker labeling system throughout the transcription.
|
||||
`,
|
||||
},
|
||||
],
|
||||
config: {
|
||||
audioTimestamp: true,
|
||||
jsonMode: true,
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: 'Generate a caption',
|
||||
action: 'Generate a caption',
|
||||
|
||||
Reference in New Issue
Block a user