mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
* 🔧 feat: Add configurable S3 URL refresh expiry time
* fix: Set default width and height for URLIcon component in case container style results in NaN
* refactor: Enhance auto-save functionality with debounced restore methods
* feat: Add support for additionalProperties in JSON schema conversion to Zod
* test: Add tests for additionalProperties handling in JSON schema to Zod conversion
* chore: Reorder import statements for better readability in ask route
* fix: Handle additional successful response status code (200) in SSE error handler
* fix: add missing rate limiting middleware for bedrock and agent chat routes
* fix: update moderation middleware to check feature flag before processing requests
* fix: add moderation middleware to chat routes for text moderation
* Revert "refactor: Enhance auto-save functionality with debounced restore methods"
This reverts commit d2e4134d1f.
* refactor: Move base64 encoding/decoding functions to top-level scope and optimize input handling
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
const express = require('express');
|
|
const { PermissionTypes, Permissions } = require('librechat-data-provider');
|
|
const {
|
|
setHeaders,
|
|
handleAbort,
|
|
moderateText,
|
|
// validateModel,
|
|
generateCheckAccess,
|
|
validateConvoAccess,
|
|
buildEndpointOption,
|
|
} = require('~/server/middleware');
|
|
const { initializeClient } = require('~/server/services/Endpoints/agents');
|
|
const AgentController = require('~/server/controllers/agents/request');
|
|
const addTitle = require('~/server/services/Endpoints/agents/title');
|
|
|
|
const router = express.Router();
|
|
|
|
router.use(moderateText);
|
|
router.post('/abort', handleAbort());
|
|
|
|
const checkAgentAccess = generateCheckAccess(PermissionTypes.AGENTS, [Permissions.USE]);
|
|
|
|
/**
|
|
* @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,
|
|
checkAgentAccess,
|
|
validateConvoAccess,
|
|
buildEndpointOption,
|
|
setHeaders,
|
|
async (req, res, next) => {
|
|
await AgentController(req, res, next, initializeClient, addTitle);
|
|
},
|
|
);
|
|
|
|
module.exports = router;
|