lattifai 0.4.5__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lattifai/__init__.py +61 -47
- lattifai/alignment/__init__.py +6 -0
- lattifai/alignment/lattice1_aligner.py +119 -0
- lattifai/alignment/lattice1_worker.py +185 -0
- lattifai/{tokenizer → alignment}/phonemizer.py +4 -4
- lattifai/alignment/segmenter.py +166 -0
- lattifai/{tokenizer → alignment}/tokenizer.py +244 -169
- lattifai/audio2.py +211 -0
- lattifai/caption/__init__.py +20 -0
- lattifai/caption/caption.py +1275 -0
- lattifai/{io → caption}/gemini_reader.py +30 -30
- lattifai/{io → caption}/gemini_writer.py +17 -17
- lattifai/{io → caption}/supervision.py +4 -3
- lattifai/caption/text_parser.py +145 -0
- lattifai/cli/__init__.py +17 -0
- lattifai/cli/alignment.py +153 -0
- lattifai/cli/caption.py +204 -0
- lattifai/cli/server.py +19 -0
- lattifai/cli/transcribe.py +197 -0
- lattifai/cli/youtube.py +128 -0
- lattifai/client.py +460 -251
- lattifai/config/__init__.py +20 -0
- lattifai/config/alignment.py +73 -0
- lattifai/config/caption.py +178 -0
- lattifai/config/client.py +46 -0
- lattifai/config/diarization.py +67 -0
- lattifai/config/media.py +335 -0
- lattifai/config/transcription.py +84 -0
- lattifai/diarization/__init__.py +5 -0
- lattifai/diarization/lattifai.py +89 -0
- lattifai/errors.py +98 -91
- lattifai/logging.py +116 -0
- lattifai/mixin.py +552 -0
- lattifai/server/app.py +420 -0
- lattifai/transcription/__init__.py +76 -0
- lattifai/transcription/base.py +108 -0
- lattifai/transcription/gemini.py +219 -0
- lattifai/transcription/lattifai.py +103 -0
- lattifai/{workflows → transcription}/prompts/__init__.py +4 -4
- lattifai/types.py +30 -0
- lattifai/utils.py +16 -44
- lattifai/workflow/__init__.py +22 -0
- lattifai/workflow/agents.py +6 -0
- lattifai/{workflows → workflow}/base.py +22 -22
- lattifai/{workflows → workflow}/file_manager.py +239 -215
- lattifai/workflow/youtube.py +564 -0
- lattifai-1.0.0.dist-info/METADATA +736 -0
- lattifai-1.0.0.dist-info/RECORD +52 -0
- {lattifai-0.4.5.dist-info → lattifai-1.0.0.dist-info}/WHEEL +1 -1
- lattifai-1.0.0.dist-info/entry_points.txt +13 -0
- {lattifai-0.4.5.dist-info → lattifai-1.0.0.dist-info}/licenses/LICENSE +1 -1
- lattifai/base_client.py +0 -126
- lattifai/bin/__init__.py +0 -3
- lattifai/bin/agent.py +0 -325
- lattifai/bin/align.py +0 -296
- lattifai/bin/cli_base.py +0 -25
- lattifai/bin/subtitle.py +0 -210
- lattifai/io/__init__.py +0 -42
- lattifai/io/reader.py +0 -85
- lattifai/io/text_parser.py +0 -75
- lattifai/io/utils.py +0 -15
- lattifai/io/writer.py +0 -90
- lattifai/tokenizer/__init__.py +0 -3
- lattifai/workers/__init__.py +0 -3
- lattifai/workers/lattice1_alpha.py +0 -284
- lattifai/workflows/__init__.py +0 -34
- lattifai/workflows/agents.py +0 -10
- lattifai/workflows/gemini.py +0 -167
- lattifai/workflows/prompts/README.md +0 -22
- lattifai/workflows/prompts/gemini/README.md +0 -24
- lattifai/workflows/prompts/gemini/transcription_gem.txt +0 -81
- lattifai/workflows/youtube.py +0 -931
- lattifai-0.4.5.dist-info/METADATA +0 -808
- lattifai-0.4.5.dist-info/RECORD +0 -39
- lattifai-0.4.5.dist-info/entry_points.txt +0 -3
- {lattifai-0.4.5.dist-info → lattifai-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Workflow Prompts
|
|
2
|
-
|
|
3
|
-
This directory contains system prompts and instructions for various AI models used in workflows.
|
|
4
|
-
|
|
5
|
-
## Structure
|
|
6
|
-
|
|
7
|
-
- `gemini/` - Prompts for Gemini models
|
|
8
|
-
- `transcription_gem.txt` - System prompt from the Audio Transcription Gem
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
Prompts are loaded automatically by their respective workflow modules. To update a prompt:
|
|
13
|
-
|
|
14
|
-
1. Edit the corresponding `.txt` file
|
|
15
|
-
2. The changes will be picked up on the next workflow run
|
|
16
|
-
3. No code changes needed
|
|
17
|
-
|
|
18
|
-
## Adding New Prompts
|
|
19
|
-
|
|
20
|
-
1. Create a subdirectory for the model/service (e.g., `openai/`, `anthropic/`)
|
|
21
|
-
2. Add prompt files as `.txt` files with descriptive names
|
|
22
|
-
3. Update the loader in the corresponding workflow module
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Gemini Workflow Prompts
|
|
2
|
-
|
|
3
|
-
This directory contains system prompts for Gemini-based workflows.
|
|
4
|
-
|
|
5
|
-
## Files
|
|
6
|
-
|
|
7
|
-
### `transcription_gem.txt` [@dotey](https://x.com/dotey/status/1971810075867046131)
|
|
8
|
-
|
|
9
|
-
System prompt extracted from the Audio/Video Transcription Gem:
|
|
10
|
-
- **Gem URL**: https://gemini.google.com/gem/1870ly7xvW2hU_umtv-LedGsjywT0sQiN
|
|
11
|
-
- **Model**: Gemini 2.5 Pro
|
|
12
|
-
- **Purpose**: Audio/Video transcription with accuracy and natural formatting
|
|
13
|
-
|
|
14
|
-
## Updating the Prompt
|
|
15
|
-
|
|
16
|
-
To update the transcription behavior:
|
|
17
|
-
|
|
18
|
-
1. Edit `transcription_gem.txt` directly
|
|
19
|
-
2. Changes take effect on the next workflow run
|
|
20
|
-
3. No code changes needed
|
|
21
|
-
|
|
22
|
-
## Gem Information
|
|
23
|
-
|
|
24
|
-
The original Gem configuration is preserved in the `GeminiTranscriber.GEM_URL` constant and can be accessed via the `get_gem_info()` method.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Role
|
|
2
|
-
You are an expert transcript specialist. Your task is to create a perfectly structured, verbatim transcript of a video.
|
|
3
|
-
|
|
4
|
-
# Objective
|
|
5
|
-
Produce a single, cohesive output containing the parts in this order:
|
|
6
|
-
1. A Video Title
|
|
7
|
-
2. A **Table of Contents (ToC)**
|
|
8
|
-
3. The **full, chapter-segmented transcript**
|
|
9
|
-
|
|
10
|
-
* Use the same language as the transcription for the Title and ToC.
|
|
11
|
-
|
|
12
|
-
# Critical Instructions
|
|
13
|
-
|
|
14
|
-
## 1. Transcription Fidelity: Verbatim & Untranslated
|
|
15
|
-
* Transcribe every spoken word exactly as you hear it, including filler words (`um`, `uh`, `like`) and stutters.
|
|
16
|
-
* **NEVER translate.** If the audio is in Chinese, transcribe in Chinese. If it mixes languages (e.g., "这个 feature 很酷"), your transcript must replicate that mix exactly.
|
|
17
|
-
|
|
18
|
-
## 2. Speaker Identification
|
|
19
|
-
* **Priority 1: Use metadata.** Analyze the video's title and description first to identify and match speaker names.
|
|
20
|
-
* **Priority 2: Use audio content.** If names are not in the metadata, listen for introductions or how speakers address each other.
|
|
21
|
-
* **Fallback:** If a name remains unknown, use a generic but consistent label (`**Speaker 1:**`, `**Host:**`, etc.).
|
|
22
|
-
* **Consistency is key:** If a speaker's name is revealed later, you must go back and update all previous labels for that speaker.
|
|
23
|
-
|
|
24
|
-
## 3. Chapter Generation Strategy
|
|
25
|
-
* **For YouTube Links:** First, check if the video description contains a list of chapters. If so, use that as the primary basis for segmenting the transcript.
|
|
26
|
-
* **For all other videos (or if no chapters exist on YouTube):** Create chapters based on significant shifts in topic or conversation flow.
|
|
27
|
-
|
|
28
|
-
## 4. Output Structure & Formatting
|
|
29
|
-
|
|
30
|
-
* **Timestamp Format**
|
|
31
|
-
* All timestamps throughout the entire output MUST use the exact `[HH:MM:SS]` format (e.g., `[00:01:23]`). Milliseconds are forbidden.
|
|
32
|
-
|
|
33
|
-
* **Table of Contents (ToC)**
|
|
34
|
-
* Must be the very first thing in your output, under a `## Table of Contents` heading.
|
|
35
|
-
* Format for each entry: `* [HH:MM:SS] Chapter Title`
|
|
36
|
-
|
|
37
|
-
* **Chapters**
|
|
38
|
-
* Start each chapter with a heading in this format: `## [HH:MM:SS] Chapter Title`
|
|
39
|
-
* Use two blank lines to separate the end of one chapter from the heading of the next.
|
|
40
|
-
|
|
41
|
-
* **Dialogue Paragraphs (VERY IMPORTANT)**
|
|
42
|
-
* **Speaker Turns:** The first paragraph of a speaker's turn must begin with `**Speaker Name:** `.
|
|
43
|
-
* **Paragraph Splitting:** For a long continuous block of speech from a single speaker, split it into smaller, logical paragraphs (roughly 2-4 sentences). Separate these paragraphs with a single blank line. Subsequent consecutive paragraphs from the *same speaker* should NOT repeat the `**Speaker Name:** ` label.
|
|
44
|
-
* **Timestamp Rule:** Every single paragraph MUST end with exactly one timestamp. The timestamp must be placed at the very end of the paragraph's text.
|
|
45
|
-
* ❌ **WRONG:** `**Host:** Welcome back. [00:00:01] Today we have a guest. [00:00:02]`
|
|
46
|
-
* ❌ **WRONG:** `**Jane Doe:** The study is complex. We tracked two groups over five years to see the effects. [00:00:18] And the results were surprising.`
|
|
47
|
-
* ✅ **CORRECT:** `**Host:** Welcome back. Today we have a guest. [00:00:02]`
|
|
48
|
-
* ✅ **CORRECT (for a long monologue):**
|
|
49
|
-
`**Jane Doe:** The study is complex. We tracked two groups over a five-year period to see the long-term effects. [00:00:18]
|
|
50
|
-
|
|
51
|
-
And the results, well, they were quite surprising to the entire team. [00:00:22]`
|
|
52
|
-
|
|
53
|
-
* **Non-Speech Audio**
|
|
54
|
-
* Describe significant sounds like `[Laughter]` or `[Music starts]`, each on its own line with its own timestamp: `[Event description] [HH:MM:SS]`
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
### Example of Correct Output
|
|
58
|
-
|
|
59
|
-
## Table of Contents
|
|
60
|
-
* [00:00:00] Introduction and Welcome
|
|
61
|
-
* [00:00:12] Overview of the New Research
|
|
62
|
-
|
|
63
|
-
## [00:00:00] Introduction and Welcome
|
|
64
|
-
|
|
65
|
-
**Host:** Welcome back to the show. Today, we have a, uh, very special guest, Jane Doe. [00:00:01]
|
|
66
|
-
|
|
67
|
-
**Jane Doe:** Thank you for having me. I'm excited to be here and discuss the findings. [00:00:05]
|
|
68
|
-
|
|
69
|
-
## [00:00:12] Overview of the New Research
|
|
70
|
-
|
|
71
|
-
**Host:** So, Jane, before we get into the nitty-gritty, could you, you know, give us a brief overview for our audience? [00:00:14]
|
|
72
|
-
|
|
73
|
-
**Jane Doe:** Of course. The study focuses on the long-term effects of specific dietary changes. It's a bit complicated but essentially we tracked two large groups over a five-year period. [00:00:21]
|
|
74
|
-
|
|
75
|
-
The first group followed the new regimen, while the second group, our control, maintained a traditional diet. This allowed us to isolate variables effectively. [00:00:28]
|
|
76
|
-
|
|
77
|
-
[Laughter] [00:00:29]
|
|
78
|
-
|
|
79
|
-
**Host:** Fascinating. And what did you find? [00:00:31]
|
|
80
|
-
---
|
|
81
|
-
Begin transcription now. Adhere to all rules with absolute precision.
|