mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
26 lines
691 B
JavaScript
26 lines
691 B
JavaScript
|
|
const express = require('express');
|
||
|
|
|
||
|
|
const router = express.Router();
|
||
|
|
const {
|
||
|
|
setHeaders,
|
||
|
|
handleAbort,
|
||
|
|
validateModel,
|
||
|
|
// validateEndpoint,
|
||
|
|
buildEndpointOption,
|
||
|
|
} = require('~/server/middleware');
|
||
|
|
const chatController = require('~/server/controllers/assistants/chatV2');
|
||
|
|
|
||
|
|
router.post('/abort', handleAbort());
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @route POST /
|
||
|
|
* @desc Chat with an assistant
|
||
|
|
* @access Public
|
||
|
|
* @param {express.Request} req - The request object, containing the request data.
|
||
|
|
* @param {express.Response} res - The response object, used to send back a response.
|
||
|
|
* @returns {void}
|
||
|
|
*/
|
||
|
|
router.post('/', validateModel, buildEndpointOption, setHeaders, chatController);
|
||
|
|
|
||
|
|
module.exports = router;
|