fix: rename data to body
This commit is contained in:
@@ -137,23 +137,23 @@ ${customApiLangs}
|
||||
`;
|
||||
|
||||
const requestHookHelperZH = `1、第一个参数包含如下字段:'texts', 'from', 'to', 'url', 'key', 'model', 'systemPrompt', ...
|
||||
2、返回值必须是包含以下字段的对象: 'url', 'data', 'headers', 'userMsg', 'method'
|
||||
2、返回值必须是包含以下字段的对象: 'url', 'body', 'headers', 'userMsg', 'method'
|
||||
3、如返回空值,则hook函数不会产生任何效果。
|
||||
|
||||
// 示例
|
||||
async (args, { url, data, headers, userMsg, method } = {}) => {
|
||||
async (args, { url, body, headers, userMsg, method } = {}) => {
|
||||
console.log("request hook args:", args);
|
||||
return { url, data, headers, userMsg, method };
|
||||
return { url, body, headers, userMsg, method };
|
||||
}`;
|
||||
|
||||
const requestHookHelperEN = `1. The first parameter contains the following fields: 'texts', 'from', 'to', 'url', 'key', 'model', 'systemPrompt', ...
|
||||
2. The return value must be an object containing the following fields: 'url', 'data', 'headers', 'userMsg', 'method'
|
||||
2. The return value must be an object containing the following fields: 'url', 'body', 'headers', 'userMsg', 'method'
|
||||
3. If a null value is returned, the hook function will have no effect.
|
||||
|
||||
// Example
|
||||
async (args, { url, data, headers, userMsg, method } = {}) => {
|
||||
async (args, { url, body, headers, userMsg, method } = {}) => {
|
||||
console.log("request hook args:", args);
|
||||
return { url, data, headers, userMsg, method };
|
||||
return { url, body, headers, userMsg, method };
|
||||
}`;
|
||||
|
||||
const responsetHookHelperZH = `1、第一个参数包含如下字段:'res', ...
|
||||
|
||||
Reference in New Issue
Block a user