refactor: config objects for feature toggles in ConversionRequest

This commit is contained in:
Artem Akymenko
2026-07-24 19:17:36 +03:00
parent 7d28b7eb52
commit 0ee5bb0496
10 changed files with 247 additions and 106 deletions
+14 -9
View File
@@ -25,6 +25,7 @@ from abogen.application.conversion_models import (
OutputLayout,
SegmentPlan,
)
from abogen.application.conversion_config import ChapterChunkConfig
from abogen.application.conversion_planner import build_conversion_plan
from abogen.application.conversion_request import ConversionRequest
@@ -74,10 +75,12 @@ class TestBuildConversionPlan:
req = ConversionRequest(
direct_text="Some text",
voice="M1",
chunks=[
{"text": "Chunk 1", "speaker_id": "narrator"},
{"text": "Chunk 2", "speaker_id": "narrator"},
],
chapter_chunk=ChapterChunkConfig(
chunks=[
{"text": "Chunk 1", "speaker_id": "narrator"},
{"text": "Chunk 2", "speaker_id": "narrator"},
],
),
)
plan = build_conversion_plan(req)
@@ -92,11 +95,13 @@ class TestBuildConversionPlan:
req = ConversionRequest(
direct_text="Text",
voice="M1",
chunks=[
{"text": "Narrator speaks", "speaker_id": "narrator"},
{"text": "Character speaks", "speaker_id": "alice", "voice": "F1"},
],
speakers={"alice": {"voice": "F1"}},
chapter_chunk=ChapterChunkConfig(
chunks=[
{"text": "Narrator speaks", "speaker_id": "narrator"},
{"text": "Character speaks", "speaker_id": "alice", "voice": "F1"},
],
speakers={"alice": {"voice": "F1"}},
),
)
plan = build_conversion_plan(req)