tongflow 0.2.2__tar.gz → 0.2.3__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.
Files changed (99) hide show
  1. {tongflow-0.2.2/tongflow.egg-info → tongflow-0.2.3}/PKG-INFO +1 -1
  2. {tongflow-0.2.2 → tongflow-0.2.3}/pyproject.toml +1 -1
  3. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/__init__.py +1 -1
  4. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/_data/tongflow.abi.json +259 -0
  5. tongflow-0.2.3/tongflow/models/music_brief.py +26 -0
  6. tongflow-0.2.3/tongflow/models/music_complete.py +22 -0
  7. tongflow-0.2.3/tongflow/models/music_cover.py +24 -0
  8. tongflow-0.2.3/tongflow/models/music_extract.py +21 -0
  9. tongflow-0.2.3/tongflow/models/music_lego.py +23 -0
  10. tongflow-0.2.3/tongflow/models/music_repaint.py +25 -0
  11. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/node_slots.py +12 -0
  12. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/slots.py +21 -2
  13. {tongflow-0.2.2 → tongflow-0.2.3/tongflow.egg-info}/PKG-INFO +1 -1
  14. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow.egg-info/SOURCES.txt +6 -0
  15. {tongflow-0.2.2 → tongflow-0.2.3}/LICENSE +0 -0
  16. {tongflow-0.2.2 → tongflow-0.2.3}/README.md +0 -0
  17. {tongflow-0.2.2 → tongflow-0.2.3}/setup.cfg +0 -0
  18. {tongflow-0.2.2 → tongflow-0.2.3}/tests/test_engine.py +0 -0
  19. {tongflow-0.2.2 → tongflow-0.2.3}/tests/test_protocol.py +0 -0
  20. {tongflow-0.2.2 → tongflow-0.2.3}/tests/test_scan.py +0 -0
  21. {tongflow-0.2.2 → tongflow-0.2.3}/tests/test_slots.py +0 -0
  22. {tongflow-0.2.2 → tongflow-0.2.3}/tests/test_subproc.py +0 -0
  23. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/__main__.py +0 -0
  24. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/_ast_utils.py +0 -0
  25. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/abi.py +0 -0
  26. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/deploy_marker.py +0 -0
  27. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/__init__.py +0 -0
  28. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/__main__.py +0 -0
  29. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/_subproc.py +0 -0
  30. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/abi_schema.py +0 -0
  31. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/assets.py +0 -0
  32. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/bindings.py +0 -0
  33. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/invoker.py +0 -0
  34. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/output_view.py +0 -0
  35. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/paths.py +0 -0
  36. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/plugins.py +0 -0
  37. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/runner.py +0 -0
  38. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/engine/store.py +0 -0
  39. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/gen_models.py +0 -0
  40. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/gen_node_slots.py +0 -0
  41. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/llm_batch_handlers.py +0 -0
  42. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/__init__.py +0 -0
  43. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/arrange_group.py +0 -0
  44. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/asset.py +0 -0
  45. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/audio_describe.py +0 -0
  46. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/audio_image_gen_video.py +0 -0
  47. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/audio_video_lip_sync.py +0 -0
  48. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/combine_text.py +0 -0
  49. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/concat_videos.py +0 -0
  50. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/convert_voice.py +0 -0
  51. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/denoise_audio.py +0 -0
  52. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/drop_video.py +0 -0
  53. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/extract_audio.py +0 -0
  54. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/gen_music.py +0 -0
  55. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/gen_text.py +0 -0
  56. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/get_first_frame.py +0 -0
  57. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/get_last_frame.py +0 -0
  58. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_describe.py +0 -0
  59. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_edit.py +0 -0
  60. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_fusion.py +0 -0
  61. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_gen.py +0 -0
  62. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_gen_model.py +0 -0
  63. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_gen_text.py +0 -0
  64. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_gen_video.py +0 -0
  65. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_image_gen_video.py +0 -0
  66. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/image_upscale.py +0 -0
  67. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/images_gen_video.py +0 -0
  68. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/link.py +0 -0
  69. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/merge_video_audio.py +0 -0
  70. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/parse_document.py +0 -0
  71. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/remove_video_audio.py +0 -0
  72. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/remove_watermark.py +0 -0
  73. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/separate_audio_track.py +0 -0
  74. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/separate_speaker.py +0 -0
  75. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/speech_text_gen_video.py +0 -0
  76. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/speech_video_gen_video.py +0 -0
  77. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/split_text.py +0 -0
  78. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/split_video.py +0 -0
  79. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/subtitle_remove.py +0 -0
  80. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/text_audio_gen_speech.py +0 -0
  81. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/text_gen_speech_clone.py +0 -0
  82. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/text_gen_speech_instruct.py +0 -0
  83. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/text_gen_speech_preset.py +0 -0
  84. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/text_gen_video.py +0 -0
  85. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/transcribe.py +0 -0
  86. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/transcribe_timestamp.py +0 -0
  87. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/video_describe.py +0 -0
  88. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/video_edit.py +0 -0
  89. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/video_gen_text.py +0 -0
  90. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/video_image_gen_video_mix.py +0 -0
  91. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/video_image_gen_video_move.py +0 -0
  92. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/models/video_upscale.py +0 -0
  93. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/parse_deploy.py +0 -0
  94. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/progress.py +0 -0
  95. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/protocol.py +0 -0
  96. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow/scan.py +0 -0
  97. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow.egg-info/dependency_links.txt +0 -0
  98. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow.egg-info/requires.txt +0 -0
  99. {tongflow-0.2.2 → tongflow-0.2.3}/tongflow.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tongflow
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for TongFlow — author plugins and run multi-modal GenAI workflows
5
5
  Author: TongFlow contributors
6
6
  License-Expression: AGPL-3.0-only
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tongflow"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "Python SDK for TongFlow — author plugins and run multi-modal GenAI workflows"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -11,6 +11,6 @@ from .deploy_marker import deploy
11
11
  from .engine import run_workflow
12
12
  from .progress import progress
13
13
 
14
- __version__ = "0.2.2"
14
+ __version__ = "0.2.3"
15
15
 
16
16
  __all__ = ["deploy", "progress", "run_workflow"]
@@ -1225,6 +1225,265 @@
1225
1225
  "additionalProperties": false
1226
1226
  }
1227
1227
  },
1228
+ {
1229
+ "nodeSlot": "music-repaint",
1230
+ "inputs": {
1231
+ "type": "object",
1232
+ "required": ["audio", "start_time", "end_time"],
1233
+ "properties": {
1234
+ "audio": {
1235
+ "$ref": "#/$defs/Asset"
1236
+ },
1237
+ "text": {
1238
+ "type": "string"
1239
+ },
1240
+ "lyrics": {
1241
+ "type": "string"
1242
+ },
1243
+ "start_time": {
1244
+ "type": "number"
1245
+ },
1246
+ "end_time": {
1247
+ "type": "number"
1248
+ },
1249
+ "strength": {
1250
+ "type": "number"
1251
+ },
1252
+ "seed": {
1253
+ "type": "integer"
1254
+ }
1255
+ },
1256
+ "additionalProperties": false
1257
+ },
1258
+ "outputs": {
1259
+ "type": "object",
1260
+ "required": ["success"],
1261
+ "properties": {
1262
+ "success": {
1263
+ "type": "boolean"
1264
+ },
1265
+ "error": {
1266
+ "type": "string"
1267
+ },
1268
+ "audio": {
1269
+ "$ref": "#/$defs/AudioRef"
1270
+ }
1271
+ },
1272
+ "additionalProperties": false
1273
+ }
1274
+ },
1275
+ {
1276
+ "nodeSlot": "music-cover",
1277
+ "inputs": {
1278
+ "type": "object",
1279
+ "required": ["audio"],
1280
+ "properties": {
1281
+ "audio": {
1282
+ "$ref": "#/$defs/Asset"
1283
+ },
1284
+ "ref_audio": {
1285
+ "$ref": "#/$defs/Asset"
1286
+ },
1287
+ "text": {
1288
+ "type": "string"
1289
+ },
1290
+ "lyrics": {
1291
+ "type": "string"
1292
+ },
1293
+ "strength": {
1294
+ "type": "number"
1295
+ },
1296
+ "seed": {
1297
+ "type": "integer"
1298
+ }
1299
+ },
1300
+ "additionalProperties": false
1301
+ },
1302
+ "outputs": {
1303
+ "type": "object",
1304
+ "required": ["success"],
1305
+ "properties": {
1306
+ "success": {
1307
+ "type": "boolean"
1308
+ },
1309
+ "error": {
1310
+ "type": "string"
1311
+ },
1312
+ "audio": {
1313
+ "$ref": "#/$defs/AudioRef"
1314
+ }
1315
+ },
1316
+ "additionalProperties": false
1317
+ }
1318
+ },
1319
+ {
1320
+ "nodeSlot": "music-extract",
1321
+ "inputs": {
1322
+ "type": "object",
1323
+ "required": ["audio", "track"],
1324
+ "properties": {
1325
+ "audio": {
1326
+ "$ref": "#/$defs/Asset"
1327
+ },
1328
+ "track": {
1329
+ "type": "string"
1330
+ },
1331
+ "seed": {
1332
+ "type": "integer"
1333
+ }
1334
+ },
1335
+ "additionalProperties": false
1336
+ },
1337
+ "outputs": {
1338
+ "type": "object",
1339
+ "required": ["success"],
1340
+ "properties": {
1341
+ "success": {
1342
+ "type": "boolean"
1343
+ },
1344
+ "error": {
1345
+ "type": "string"
1346
+ },
1347
+ "audio": {
1348
+ "$ref": "#/$defs/AudioRef"
1349
+ }
1350
+ },
1351
+ "additionalProperties": false
1352
+ }
1353
+ },
1354
+ {
1355
+ "nodeSlot": "music-lego",
1356
+ "inputs": {
1357
+ "type": "object",
1358
+ "required": ["audio", "track"],
1359
+ "properties": {
1360
+ "audio": {
1361
+ "$ref": "#/$defs/Asset"
1362
+ },
1363
+ "track": {
1364
+ "type": "string"
1365
+ },
1366
+ "text": {
1367
+ "type": "string"
1368
+ },
1369
+ "lyrics": {
1370
+ "type": "string"
1371
+ },
1372
+ "seed": {
1373
+ "type": "integer"
1374
+ }
1375
+ },
1376
+ "additionalProperties": false
1377
+ },
1378
+ "outputs": {
1379
+ "type": "object",
1380
+ "required": ["success"],
1381
+ "properties": {
1382
+ "success": {
1383
+ "type": "boolean"
1384
+ },
1385
+ "error": {
1386
+ "type": "string"
1387
+ },
1388
+ "audio": {
1389
+ "$ref": "#/$defs/AudioRef"
1390
+ }
1391
+ },
1392
+ "additionalProperties": false
1393
+ }
1394
+ },
1395
+ {
1396
+ "nodeSlot": "music-complete",
1397
+ "inputs": {
1398
+ "type": "object",
1399
+ "required": ["audio"],
1400
+ "properties": {
1401
+ "audio": {
1402
+ "$ref": "#/$defs/Asset"
1403
+ },
1404
+ "tracks": {
1405
+ "type": "array",
1406
+ "items": {
1407
+ "type": "string"
1408
+ }
1409
+ },
1410
+ "text": {
1411
+ "type": "string"
1412
+ },
1413
+ "seed": {
1414
+ "type": "integer"
1415
+ }
1416
+ },
1417
+ "additionalProperties": false
1418
+ },
1419
+ "outputs": {
1420
+ "type": "object",
1421
+ "required": ["success"],
1422
+ "properties": {
1423
+ "success": {
1424
+ "type": "boolean"
1425
+ },
1426
+ "error": {
1427
+ "type": "string"
1428
+ },
1429
+ "audio": {
1430
+ "$ref": "#/$defs/AudioRef"
1431
+ }
1432
+ },
1433
+ "additionalProperties": false
1434
+ }
1435
+ },
1436
+ {
1437
+ "nodeSlot": "music-brief",
1438
+ "inputs": {
1439
+ "type": "object",
1440
+ "required": ["text"],
1441
+ "properties": {
1442
+ "text": {
1443
+ "type": "string",
1444
+ "minLength": 1
1445
+ },
1446
+ "instrumental": {
1447
+ "type": "boolean"
1448
+ },
1449
+ "language": {
1450
+ "type": "string"
1451
+ }
1452
+ },
1453
+ "additionalProperties": false
1454
+ },
1455
+ "outputs": {
1456
+ "type": "object",
1457
+ "required": ["success"],
1458
+ "properties": {
1459
+ "success": {
1460
+ "type": "boolean"
1461
+ },
1462
+ "error": {
1463
+ "type": "string"
1464
+ },
1465
+ "lyrics": {
1466
+ "type": "string"
1467
+ },
1468
+ "tags": {
1469
+ "type": "string"
1470
+ },
1471
+ "bpm": {
1472
+ "type": "number"
1473
+ },
1474
+ "keyscale": {
1475
+ "type": "string"
1476
+ },
1477
+ "duration": {
1478
+ "type": "number"
1479
+ },
1480
+ "language": {
1481
+ "type": "string"
1482
+ }
1483
+ },
1484
+ "additionalProperties": false
1485
+ }
1486
+ },
1228
1487
  {
1229
1488
  "nodeSlot": "audio-image-gen-video",
1230
1489
  "inputs": {
@@ -0,0 +1,26 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+ from .asset import Asset, AudioRef, FileRef, ImageRef, ModelRef, VideoRef
6
+
7
+
8
+ class MusicBriefInput(BaseModel):
9
+ model_config = ConfigDict(extra="forbid")
10
+
11
+ text: str
12
+ instrumental: bool | None = None
13
+ language: str | None = None
14
+
15
+ class MusicBriefOutput(BaseModel):
16
+ model_config = ConfigDict(extra="forbid")
17
+
18
+ success: bool
19
+ bpm: float | None = None
20
+ duration: float | None = None
21
+ error: str | None = None
22
+ keyscale: str | None = None
23
+ language: str | None = None
24
+ lyrics: str | None = None
25
+ tags: str | None = None
26
+
@@ -0,0 +1,22 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+ from .asset import Asset, AudioRef, FileRef, ImageRef, ModelRef, VideoRef
6
+
7
+
8
+ class MusicCompleteInput(BaseModel):
9
+ model_config = ConfigDict(extra="forbid")
10
+
11
+ audio: Asset
12
+ seed: int | None = None
13
+ text: str | None = None
14
+ tracks: list[str] | None = None
15
+
16
+ class MusicCompleteOutput(BaseModel):
17
+ model_config = ConfigDict(extra="forbid")
18
+
19
+ success: bool
20
+ audio: Asset | None = None
21
+ error: str | None = None
22
+
@@ -0,0 +1,24 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+ from .asset import Asset, AudioRef, FileRef, ImageRef, ModelRef, VideoRef
6
+
7
+
8
+ class MusicCoverInput(BaseModel):
9
+ model_config = ConfigDict(extra="forbid")
10
+
11
+ audio: Asset
12
+ lyrics: str | None = None
13
+ ref_audio: Asset | None = None
14
+ seed: int | None = None
15
+ strength: float | None = None
16
+ text: str | None = None
17
+
18
+ class MusicCoverOutput(BaseModel):
19
+ model_config = ConfigDict(extra="forbid")
20
+
21
+ success: bool
22
+ audio: Asset | None = None
23
+ error: str | None = None
24
+
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+ from .asset import Asset, AudioRef, FileRef, ImageRef, ModelRef, VideoRef
6
+
7
+
8
+ class MusicExtractInput(BaseModel):
9
+ model_config = ConfigDict(extra="forbid")
10
+
11
+ audio: Asset
12
+ track: str
13
+ seed: int | None = None
14
+
15
+ class MusicExtractOutput(BaseModel):
16
+ model_config = ConfigDict(extra="forbid")
17
+
18
+ success: bool
19
+ audio: Asset | None = None
20
+ error: str | None = None
21
+
@@ -0,0 +1,23 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+ from .asset import Asset, AudioRef, FileRef, ImageRef, ModelRef, VideoRef
6
+
7
+
8
+ class MusicLegoInput(BaseModel):
9
+ model_config = ConfigDict(extra="forbid")
10
+
11
+ audio: Asset
12
+ track: str
13
+ lyrics: str | None = None
14
+ seed: int | None = None
15
+ text: str | None = None
16
+
17
+ class MusicLegoOutput(BaseModel):
18
+ model_config = ConfigDict(extra="forbid")
19
+
20
+ success: bool
21
+ audio: Asset | None = None
22
+ error: str | None = None
23
+
@@ -0,0 +1,25 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+ from .asset import Asset, AudioRef, FileRef, ImageRef, ModelRef, VideoRef
6
+
7
+
8
+ class MusicRepaintInput(BaseModel):
9
+ model_config = ConfigDict(extra="forbid")
10
+
11
+ audio: Asset
12
+ end_time: float
13
+ start_time: float
14
+ lyrics: str | None = None
15
+ seed: int | None = None
16
+ strength: float | None = None
17
+ text: str | None = None
18
+
19
+ class MusicRepaintOutput(BaseModel):
20
+ model_config = ConfigDict(extra="forbid")
21
+
22
+ success: bool
23
+ audio: Asset | None = None
24
+ error: str | None = None
25
+
@@ -47,6 +47,12 @@ class NodeSlots:
47
47
  IMAGE_DESCRIBE: Final[str] = 'image-describe'
48
48
  VIDEO_DESCRIBE: Final[str] = 'video-describe'
49
49
  AUDIO_DESCRIBE: Final[str] = 'audio-describe'
50
+ MUSIC_REPAINT: Final[str] = 'music-repaint'
51
+ MUSIC_COVER: Final[str] = 'music-cover'
52
+ MUSIC_EXTRACT: Final[str] = 'music-extract'
53
+ MUSIC_LEGO: Final[str] = 'music-lego'
54
+ MUSIC_COMPLETE: Final[str] = 'music-complete'
55
+ MUSIC_BRIEF: Final[str] = 'music-brief'
50
56
  AUDIO_IMAGE_GEN_VIDEO: Final[str] = 'audio-image-gen-video'
51
57
  SPEECH_TEXT_GEN_VIDEO: Final[str] = 'speech-text-gen-video'
52
58
  VIDEO_IMAGE_GEN_VIDEO_MIX: Final[str] = 'video-image-gen-video-mix'
@@ -99,6 +105,12 @@ ALL_NODE_SLOTS: Final[tuple[str, ...]] = (
99
105
  'image-describe',
100
106
  'video-describe',
101
107
  'audio-describe',
108
+ 'music-repaint',
109
+ 'music-cover',
110
+ 'music-extract',
111
+ 'music-lego',
112
+ 'music-complete',
113
+ 'music-brief',
102
114
  'audio-image-gen-video',
103
115
  'speech-text-gen-video',
104
116
  'video-image-gen-video-mix',
@@ -21,6 +21,7 @@
21
21
 
22
22
  from __future__ import annotations
23
23
 
24
+ import contextvars
24
25
  import functools
25
26
  import inspect
26
27
  import types
@@ -32,6 +33,20 @@ from pydantic import BaseModel
32
33
 
33
34
  F = TypeVar("F", bound=Callable[..., object])
34
35
 
36
+ # Per-request model selection (router-style plugins). The platform's envelope
37
+ # carries `model` top-level; bridges that forward it to a remote backend tuck
38
+ # it into the prompt dict under this reserved key, and the @node_slot wrapper
39
+ # pops it back out before constructing the typed input.
40
+ MODEL_KEY = "_model"
41
+ _current_model: contextvars.ContextVar[str | None] = contextvars.ContextVar(
42
+ "tongflow_current_model", default=None
43
+ )
44
+
45
+
46
+ def current_model() -> str | None:
47
+ """The model chosen on the node for this request, or None for default."""
48
+ return _current_model.get()
49
+
35
50
 
36
51
  def _basemodel_from_annotation(ann: object) -> type[BaseModel] | None:
37
52
  """If `ann` is `BaseModel`/`BaseModel | None`/`Optional[BaseModel]`, return the class.
@@ -150,8 +165,12 @@ def node_slot(*slots: str) -> Callable[[F], F]:
150
165
  is_method = _is_method(fn)
151
166
 
152
167
  def _marshal(input: Any) -> Any:
153
- if input_cls is not None and isinstance(input, dict):
154
- return _deep_construct(input_cls, input)
168
+ if isinstance(input, dict):
169
+ # Reserved routing key, never an ABI field: reset per call so a
170
+ # previous request's selection can't leak into this one.
171
+ _current_model.set(input.pop(MODEL_KEY, None))
172
+ if input_cls is not None:
173
+ return _deep_construct(input_cls, input)
155
174
  return input
156
175
 
157
176
  def _finalize(result: Any) -> Any:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tongflow
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: Python SDK for TongFlow — author plugins and run multi-modal GenAI workflows
5
5
  Author: TongFlow contributors
6
6
  License-Expression: AGPL-3.0-only
@@ -66,6 +66,12 @@ tongflow/models/image_upscale.py
66
66
  tongflow/models/images_gen_video.py
67
67
  tongflow/models/link.py
68
68
  tongflow/models/merge_video_audio.py
69
+ tongflow/models/music_brief.py
70
+ tongflow/models/music_complete.py
71
+ tongflow/models/music_cover.py
72
+ tongflow/models/music_extract.py
73
+ tongflow/models/music_lego.py
74
+ tongflow/models/music_repaint.py
69
75
  tongflow/models/parse_document.py
70
76
  tongflow/models/remove_video_audio.py
71
77
  tongflow/models/remove_watermark.py
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