From 19abfd1a3ef1ad37e73fe8ec3a5260b7758336f6 Mon Sep 17 00:00:00 2001 From: Finley Ge <32237950+FinleyGe@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:29:13 +0800 Subject: [PATCH] docs: add custom uid docs (#3572) --- .../zh-cn/docs/development/openapi/auth.md | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/docSite/content/zh-cn/docs/development/openapi/auth.md b/docSite/content/zh-cn/docs/development/openapi/auth.md index 5bcd72a0e..aa7014e80 100644 --- a/docSite/content/zh-cn/docs/development/openapi/auth.md +++ b/docSite/content/zh-cn/docs/development/openapi/auth.md @@ -55,4 +55,28 @@ curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' } ] }' -``` \ No newline at end of file +``` + +## 自定义用户 ID + +`v4.8.13`后支持传入自定义的用户 ID, 并且存入历史记录中。 + +```sh +curl --location --request POST 'https://api.fastgpt.in/api/v1/chat/completions' \ +--header 'Authorization: Bearer fastgpt-xxxxxx' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "chatId": "111", + "stream": false, + "detail": false, + "messages": [ + { + "content": "导演是谁", + "role": "user" + } + ], + "customUid": "xxxxxx" +}' +``` + +在历史记录中,该条记录的使用者会显示为 `xxxxxx`。