mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
fix: Removed console logs.
This commit is contained in:
@@ -13,22 +13,10 @@ const handler = async (req, res) => {
|
|||||||
res.status(401).end();
|
res.status(401).end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(JSON.parse(req.body));
|
|
||||||
// Parse out the local task ID and the interaction contents.
|
// Parse out the local message_id, task ID and the interaction contents.
|
||||||
const { post_id, label_map, text } = await JSON.parse(req.body);
|
const { message_id, post_id, label_map, text } = await JSON.parse(req.body);
|
||||||
console.log(JSON.stringify(
|
|
||||||
{
|
|
||||||
"type": "text_labels",
|
|
||||||
"message_id": post_id,
|
|
||||||
"labels": label_map,
|
|
||||||
"text": text,
|
|
||||||
"user": {
|
|
||||||
"id": token.sub,
|
|
||||||
"display_name": token.name || token.email,
|
|
||||||
"auth_method": "local",
|
|
||||||
}}));
|
|
||||||
console.log("Here sending text_labels1...");
|
|
||||||
// Send the interaction to the Text Label to the Backend.
|
|
||||||
const interactionRes = await fetch(`${process.env.FASTAPI_URL}/api/v1/text_labels`, {
|
const interactionRes = await fetch(`${process.env.FASTAPI_URL}/api/v1/text_labels`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -37,7 +25,7 @@ const handler = async (req, res) => {
|
|||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
"type": "text_labels",
|
"type": "text_labels",
|
||||||
"message_id": post_id,
|
"message_id": message_id,
|
||||||
"labels": label_map,
|
"labels": label_map,
|
||||||
"text": text,
|
"text": text,
|
||||||
"user": {
|
"user": {
|
||||||
@@ -48,7 +36,6 @@ const handler = async (req, res) => {
|
|||||||
|
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
console.log(interactionRes);
|
|
||||||
res.status(interactionRes.status).json(interactionRes.json());
|
res.status(interactionRes.status).json(interactionRes.json());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user