Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

test(util): pin fence stripping on the no-carrier fallback

askalfd4e930638773
diff --git a/runtime/krillinai/pkg/util/json_test.go b/runtime/krillinai/pkg/util/json_test.go
index 5ca00db0..9f14c73c 100644
--- a/runtime/krillinai/pkg/util/json_test.go
+++ b/runtime/krillinai/pkg/util/json_test.go
@@ -289,6 +289,12 @@ func TestExtractJSONObjectLeavesUnparsableInputAlone(t *testing.T) {
key: "align",
want: `{"note":"x"} {"other":1}`,
},
+ {
+ name: "围栏内没有候选含目标字段时返回去围栏后的文本",
+ response: "```json\n{\"note\":\"x\"}\n```",
+ key: "align",
+ want: `{"note":"x"}`,
+ },
{
name: "同名字段只嵌套在下层时不算命中",
response: `{"data":{"align":[{"origin_part":"a"}]}}`,