From 65c325de9a0fd4986afa4b80e3fd17980c04cd47 Mon Sep 17 00:00:00 2001 From: Gabe Date: Fri, 17 Oct 2025 10:14:28 +0800 Subject: [PATCH] fix: custom api example --- custom-api_v2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-api_v2.md b/custom-api_v2.md index c11bbee..6887920 100644 --- a/custom-api_v2.md +++ b/custom-api_v2.md @@ -24,7 +24,7 @@ Response Hook ```js async ({ res }) => { - return { translations: [[res.sentences[0].trans]] }; + return { translations: [[res?.sentences?.[0]?.trans || "", res?.src]] }; }; ``` @@ -201,6 +201,6 @@ Response Hook ```js async ({ res }) => { - return { translations: [res?.choices?.[0]?.message?.content || ""] }; + return { translations: [[res?.choices?.[0]?.message?.content || ""]] }; }; ```