deerflow2/src/podcast/graph
Willem Jiang bab60e6e3d
fix(podcast): add fallback for models without json_object support (#747) (#785)
* fix(podcast): add fallback for models without json_object support (#747)

Models like Kimi K2 don't support response_format.type: json_object.
Add try-except to fall back to regular prompting with JSON parsing
when BadRequestError mentions json_object not supported.

- Add fallback to prompting + repair_json_output parsing
- Re-raise other BadRequestError types
- Add unit tests for script_writer_node with 100% coverage

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fixes: the unit test error of test_script_writer_node.py

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-26 23:04:20 +08:00
..
audio_mixer_node.py chore: add copyright 2025-04-19 17:52:23 +08:00
builder.py feat: add langgraph.json for langgraph studio debug 2025-04-22 15:34:06 +08:00
script_writer_node.py fix(podcast): add fallback for models without json_object support (#747) (#785) 2025-12-26 23:04:20 +08:00
state.py chore: add copyright 2025-04-19 17:52:23 +08:00
tts_node.py refactor: refactor podcast genration stability (#11) 2025-05-09 11:34:19 +08:00