fix: custom api example

This commit is contained in:
Gabe
2025-10-17 10:14:28 +08:00
parent 8da5aaf259
commit 65c325de9a

View File

@@ -24,7 +24,7 @@ Response Hook
```js ```js
async ({ res }) => { async ({ res }) => {
return { translations: [[res.sentences[0].trans]] }; return { translations: [[res?.sentences?.[0]?.trans || "", res?.src]] };
}; };
``` ```
@@ -201,6 +201,6 @@ Response Hook
```js ```js
async ({ res }) => { async ({ res }) => {
return { translations: [res?.choices?.[0]?.message?.content || ""] }; return { translations: [[res?.choices?.[0]?.message?.content || ""]] };
}; };
``` ```