Update rearanker code url. Add chat storage ip address (#717)

* save chat origin ip

* reranker code url
This commit is contained in:
Archer
2024-01-09 12:09:36 +08:00
committed by GitHub
parent 13eda40443
commit 5876a47da6
5 changed files with 23 additions and 27 deletions

View File

@@ -69,6 +69,8 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
} = req.body as Props;
try {
const originIp = requestIp.getClientIp(req);
await connectToDatabase();
// body data check
if (!messages) {
@@ -99,7 +101,7 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
if (shareId && outLinkUid) {
const { user, appId, authType, responseDetail, uid } = await authOutLinkChatStart({
shareId,
ip: requestIp.getClientIp(req),
ip: originIp,
outLinkUid,
question: question.value
});
@@ -245,7 +247,10 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
value: answerText,
responseData
}
]
],
metadata: {
originIp
}
});
}