braidio 0.0.83__tar.gz → 0.0.84__tar.gz
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.
- {braidio-0.0.83 → braidio-0.0.84}/PKG-INFO +1 -1
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/tools.py +1 -1
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/__init__.py +53 -10
- {braidio-0.0.83 → braidio-0.0.84}/pyproject.toml +1 -1
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_transforms.py +88 -2
- {braidio-0.0.83 → braidio-0.0.84}/.editorconfig +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/.gitattributes +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/.gitignore +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/LICENSE +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/README.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/__init__.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/_paths.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/bodies/__init__.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/bodies/_domain.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/bodies/_render_nodes.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/bodies/_tiers.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/bodies/_video.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/captions.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/compose.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/conversation.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/cost.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/data/skills/braidio/SKILL.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/data/skills/braidio-commentary-video/SKILL.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/defaults.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/delivery.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/downloads.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/formats.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/genre.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/importing/__init__.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/importing/__main__.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/importing/_catalog.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/importing/_manifest.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/importing/_writer.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/kinds.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/leveling.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/markdown_script.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/__init__.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/_docs.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/_guide.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/_helpers.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/_media.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/credentials.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/metering.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/mcp/workspace.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/multivoice.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/music.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/pacing.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/project.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/provenance.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/relevance.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/render.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/rights.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/script.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/sources.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/structure.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/style.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/textprep.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/timeline.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_asset_refs.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_common.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_dialogue.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_episode.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_ingest.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_narration.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_segment.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_video_cut.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_video_panels.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/transforms/_voice.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/tts.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/video.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/voice_library.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/weave.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/braidio/weave_config.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/conftest.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/Extraction and nw-App Design.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/research/commentary-formats-and-styles.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/research/conversational-vs-narration-tts.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/research/notebooklm-and-conversational-pacing.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/README.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/anti-platitude-checklist.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/commentary-voice-guide.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/_style-groups.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/amanda-dobbins.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/david-sims.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/griffin-newman.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/helen-molesworth.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/hrishikesh-hirway.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/jason-mantzoukas.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/john-mcwhorter.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/jon-caramanica.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/june-diane-raphael.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/karina-longworth.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/katy-hessel.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/louis-theroux.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/mallory-rubin.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/melvyn-bragg.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/michael-barbaro.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/nate-sloan-charlie-harding.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/paul-scheer.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/sean-fennessey.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/talk-art.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/style/voices/yasi-salek.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/misc/docs/youtube_ingest_credentials.md +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/_audio.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_body_schema_stability.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_conversation.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_cost.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_credits_card.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_defaults.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_delivery.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_downloads.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_expressiveness.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_formats.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_genre_placement.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_graph_speak.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_importing.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_leveling.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_markdown_script.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_mcp.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_mcp_caller_key.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_media_auth.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_multivoice.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_music.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_namespaced_source.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_nw_app.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_pacing.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_packaging.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_render_settings.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_script.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_sources.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_speak_seam.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_structure.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_textprep_style.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_timeline.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_transforms_dialogue.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_transforms_episode_members.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_transforms_rights.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_transforms_secrets.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_transforms_structure.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_tts_api_key.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_turn_overlap.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_video.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_video_bodies.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_video_footage.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_video_transforms.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_voice_library.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_weave.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_weave_config.py +0 -0
- {braidio-0.0.83 → braidio-0.0.84}/tests/test_wire_descriptions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: braidio
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.84
|
|
4
4
|
Summary: Weave narration with extracted media segments into audiovisual productions
|
|
5
5
|
Project-URL: Homepage, https://github.com/thorwhalen/braidio
|
|
6
6
|
Project-URL: Repository, https://github.com/thorwhalen/braidio
|
|
@@ -91,6 +91,7 @@ video_cut_reuses_existing = _video_cut.reuses_existing_cut
|
|
|
91
91
|
|
|
92
92
|
__all__ = [
|
|
93
93
|
"format_config",
|
|
94
|
+
"resolve_config",
|
|
94
95
|
"ingest_script",
|
|
95
96
|
"IngestedScript",
|
|
96
97
|
"weave_project",
|
|
@@ -122,16 +123,27 @@ __all__ = [
|
|
|
122
123
|
]
|
|
123
124
|
|
|
124
125
|
|
|
126
|
+
#: What a narration render was synthesized with: the config keys a re-weave
|
|
127
|
+
#: must keep, or every one of those renders re-synthesizes (and re-bills).
|
|
128
|
+
VOICE_KEYS = ("model_id", "voice_settings")
|
|
129
|
+
|
|
130
|
+
|
|
125
131
|
def format_config(fmt=None, *, config=None, voice_id=None):
|
|
126
|
-
"""The weave-config a production
|
|
132
|
+
"""The weave-config a production asks for: one rule for every writer.
|
|
127
133
|
|
|
128
134
|
``config`` else the format's ``weave``, carrying the narration voice —
|
|
129
|
-
``voice_id`` else ``fmt.narration_voice`` — when there is one.
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
``voice_id`` else ``fmt.narration_voice`` — when there is one. A format's
|
|
136
|
+
``weave`` holds the editing knobs and its ``narration_delivery`` what the
|
|
137
|
+
narrator speaks with, so the format's config takes the delivery's model and
|
|
138
|
+
settings: what the fast path renders with (braidio#120). An explicit
|
|
139
|
+
``config`` is used as given. Pure: :func:`resolve_config` is what applies
|
|
140
|
+
it to a project.
|
|
132
141
|
"""
|
|
133
142
|
if config is None and fmt is not None:
|
|
134
|
-
|
|
143
|
+
delivery = fmt.narration_delivery
|
|
144
|
+
config = fmt.weave.with_(
|
|
145
|
+
model_id=delivery.model_id, voice_settings=dict(delivery.voice_settings)
|
|
146
|
+
)
|
|
135
147
|
if voice_id is None and fmt is not None:
|
|
136
148
|
voice_id = fmt.narration_voice
|
|
137
149
|
if voice_id is not None:
|
|
@@ -139,6 +151,33 @@ def format_config(fmt=None, *, config=None, voice_id=None):
|
|
|
139
151
|
return config
|
|
140
152
|
|
|
141
153
|
|
|
154
|
+
def resolve_config(project, fmt=None, *, config=None, voice_id=None):
|
|
155
|
+
"""The weave-config to ingest into ``project``: :func:`format_config`, minus
|
|
156
|
+
any change to what its narration was already synthesized with.
|
|
157
|
+
|
|
158
|
+
Once a project has narration renders, a re-weave keeps the model and
|
|
159
|
+
settings (:data:`VOICE_KEYS`) its weave-config records, with or without a
|
|
160
|
+
format, unless the caller passes ``config=`` explicitly: changing them
|
|
161
|
+
would re-synthesize, and re-bill, every narration beat (braidio#135,
|
|
162
|
+
option 2). So the model and settings are fixed by a project's first
|
|
163
|
+
render; ``config=`` is how to change them. Before any render (a script
|
|
164
|
+
saved, not yet woven) there is nothing to re-bill, and the format's
|
|
165
|
+
delivery applies. ``weave_project`` and ``save_script`` both resolve
|
|
166
|
+
through here, so saving and then weaving never rewrites the config node.
|
|
167
|
+
"""
|
|
168
|
+
import nw
|
|
169
|
+
|
|
170
|
+
resolved = format_config(fmt, config=config, voice_id=voice_id)
|
|
171
|
+
if config is not None or not nw.annotations_at_tier(
|
|
172
|
+
project.root, "narration-renders"
|
|
173
|
+
):
|
|
174
|
+
return resolved
|
|
175
|
+
nodes = nw.annotations_at_tier(project.root, "weave-configs")
|
|
176
|
+
recorded = dict(nodes[0].body.get("config", {})) if nodes else {}
|
|
177
|
+
kept = {key: recorded[key] for key in VOICE_KEYS if key in recorded}
|
|
178
|
+
return (resolved or WeaveConfig()).with_(**kept)
|
|
179
|
+
|
|
180
|
+
|
|
142
181
|
def weave_project(
|
|
143
182
|
project,
|
|
144
183
|
script,
|
|
@@ -168,10 +207,14 @@ def weave_project(
|
|
|
168
207
|
``fmt`` (a :class:`~braidio.formats.Format`) supplies the format's declared
|
|
169
208
|
defaults — its ``weave`` config, its ``structure`` and its dialogue
|
|
170
209
|
``cast`` — for whichever of ``config`` / ``structure`` / ``cast`` the
|
|
171
|
-
caller left out; an explicit argument always wins.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
210
|
+
caller left out; an explicit argument always wins. Its config carries the
|
|
211
|
+
format's ``narration_delivery`` model and settings, as the fast path renders
|
|
212
|
+
them, until the project has narration renders: from then on a re-weave
|
|
213
|
+
keeps the model and settings it was synthesized with, so it never re-bills
|
|
214
|
+
by surprise, and ``config=`` is how to change them (:func:`resolve_config`,
|
|
215
|
+
braidio#120). ``bed`` is the app-supplied music bed
|
|
216
|
+
(:class:`~braidio.music.MusicBed`). With no format, no structure and no
|
|
217
|
+
bed, this is the plain weave it always was (thorwhalen/braidio#39).
|
|
175
218
|
|
|
176
219
|
``cast`` (a :class:`~braidio.conversation.ConversationCast`) is what the
|
|
177
220
|
script's :class:`~braidio.script.Dialogue` beats are voiced with, resolved
|
|
@@ -218,7 +261,7 @@ def weave_project(
|
|
|
218
261
|
"""
|
|
219
262
|
import nw
|
|
220
263
|
|
|
221
|
-
config =
|
|
264
|
+
config = resolve_config(project, fmt, config=config, voice_id=voice_id)
|
|
222
265
|
if fmt is not None:
|
|
223
266
|
structure = structure if structure is not None else fmt.structure
|
|
224
267
|
cast = cast if cast is not None else fmt.cast
|
|
@@ -634,13 +634,99 @@ def test_weave_project_applies_a_format_and_its_declared_structure(
|
|
|
634
634
|
}
|
|
635
635
|
assert structure.body["sting_asset_id"] is None # no asset supplied
|
|
636
636
|
(cfg,) = nw.annotations_at_tier(project.root, "weave-configs")
|
|
637
|
-
# the format's narration voice rides in the config
|
|
637
|
+
# the format's narration voice rides in the config (braidio#115), and so do
|
|
638
|
+
# its delivery's model and settings, which is what the fast path speaks with
|
|
639
|
+
# (braidio#120: the graph used to record the weave's v2 default instead)
|
|
640
|
+
delivery = braidio.SOLO_EXPLAINER.narration_delivery
|
|
638
641
|
expected = braidio.SOLO_EXPLAINER.weave.with_(
|
|
639
|
-
narration_voice=braidio.SOLO_EXPLAINER.narration_voice
|
|
642
|
+
narration_voice=braidio.SOLO_EXPLAINER.narration_voice,
|
|
643
|
+
model_id=delivery.model_id,
|
|
644
|
+
voice_settings=dict(delivery.voice_settings),
|
|
640
645
|
)
|
|
641
646
|
assert cfg.body["config"] == expected.to_dict()
|
|
642
647
|
|
|
643
648
|
|
|
649
|
+
def test_a_format_narrates_with_its_delivery_on_the_graph(
|
|
650
|
+
project, script_and_source, patched_synthesis, monkeypatch
|
|
651
|
+
):
|
|
652
|
+
"""Fast/graph parity (braidio#120): the model a format's narrator speaks
|
|
653
|
+
with is its ``narration_delivery``'s on both paths."""
|
|
654
|
+
seen = []
|
|
655
|
+
real = braidio.narrate
|
|
656
|
+
|
|
657
|
+
def _narrate(text, out, **kw):
|
|
658
|
+
seen.append(kw["model_id"])
|
|
659
|
+
return real(text, out, **kw)
|
|
660
|
+
|
|
661
|
+
monkeypatch.setattr(braidio, "narrate", _narrate)
|
|
662
|
+
script, source = script_and_source
|
|
663
|
+
braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
|
|
664
|
+
assert seen and set(seen) == {braidio.DEEP_DIVE.narration_delivery.model_id}
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
def _counting_narrate(monkeypatch):
|
|
668
|
+
"""Count synthesis calls over the patched stub (the re-bill measure)."""
|
|
669
|
+
calls = []
|
|
670
|
+
real = braidio.narrate
|
|
671
|
+
|
|
672
|
+
def _narrate(text, out, **kw):
|
|
673
|
+
calls.append(kw["model_id"])
|
|
674
|
+
return real(text, out, **kw)
|
|
675
|
+
|
|
676
|
+
monkeypatch.setattr(braidio, "narrate", _narrate)
|
|
677
|
+
return calls
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
def test_an_existing_project_keeps_the_model_it_recorded(
|
|
681
|
+
project, script_and_source, patched_synthesis, monkeypatch
|
|
682
|
+
):
|
|
683
|
+
"""No surprise re-bill (braidio#135): a project woven before the delivery
|
|
684
|
+
rule keeps its model and settings when re-woven under a format."""
|
|
685
|
+
import nw
|
|
686
|
+
|
|
687
|
+
calls = _counting_narrate(monkeypatch)
|
|
688
|
+
script, source = script_and_source
|
|
689
|
+
legacy = braidio.SOLO_EXPLAINER.weave.with_(
|
|
690
|
+
narration_voice=braidio.SOLO_EXPLAINER.narration_voice
|
|
691
|
+
) # what the graph recorded before #120
|
|
692
|
+
braidio.weave_project(project, script, source=source, config=legacy)
|
|
693
|
+
synthesized = len(calls)
|
|
694
|
+
|
|
695
|
+
braidio.weave_project(project, script, source=source, fmt=braidio.SOLO_EXPLAINER)
|
|
696
|
+
(cfg,) = nw.annotations_at_tier(project.root, "weave-configs")
|
|
697
|
+
assert cfg.body["config"] == legacy.to_dict()
|
|
698
|
+
assert len(calls) == synthesized # nothing re-synthesized
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
def test_dropping_and_restoring_the_format_never_re_bills(
|
|
702
|
+
project, script_and_source, patched_synthesis, monkeypatch
|
|
703
|
+
):
|
|
704
|
+
"""Woven under a format, re-woven without it, then with it again: the
|
|
705
|
+
voice it was synthesized with is kept throughout (#138 review)."""
|
|
706
|
+
calls = _counting_narrate(monkeypatch)
|
|
707
|
+
script, source = script_and_source
|
|
708
|
+
braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
|
|
709
|
+
first = list(calls)
|
|
710
|
+
assert set(first) == {braidio.DEEP_DIVE.narration_delivery.model_id}
|
|
711
|
+
braidio.weave_project(project, script, source=source)
|
|
712
|
+
braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
|
|
713
|
+
assert calls == first
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
def test_a_script_saved_before_its_first_weave_still_gets_the_delivery(
|
|
717
|
+
project, script_and_source, patched_synthesis, monkeypatch
|
|
718
|
+
):
|
|
719
|
+
"""reelee's flow: ingest with the format's bare weave, then weave with the
|
|
720
|
+
format. Nothing was rendered yet, so nothing is kept: the delivery applies."""
|
|
721
|
+
calls = _counting_narrate(monkeypatch)
|
|
722
|
+
script, source = script_and_source
|
|
723
|
+
braidio.transforms.ingest_script(
|
|
724
|
+
project, script, config=braidio.DEEP_DIVE.weave, source=source
|
|
725
|
+
)
|
|
726
|
+
braidio.weave_project(project, script, source=source, fmt=braidio.DEEP_DIVE)
|
|
727
|
+
assert calls and set(calls) == {braidio.DEEP_DIVE.narration_delivery.model_id}
|
|
728
|
+
|
|
729
|
+
|
|
644
730
|
# --- re-ingest: identity, freshness, retry (braidio#49, braidio#51) ------------
|
|
645
731
|
|
|
646
732
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{braidio-0.0.83 → braidio-0.0.84}/misc/docs/research/notebooklm-and-conversational-pacing.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|