mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
⚙️ perf: reduce first-load MongoDB round trips (#14101)
* perf(api): reduce first-load database round trips * docs: move agent guidance to claude docs * refactor(api): move message validation into api package * fix(api): narrow active generation job lookup * fix(api): preserve omitted source identity
This commit is contained in:
parent
a0aa1f2b9d
commit
44d1275f36
25 changed files with 895 additions and 242 deletions
14
api/server/middleware/messageValidation.js
Normal file
14
api/server/middleware/messageValidation.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
const {
|
||||
GenerationJobManager,
|
||||
createMessageRequestMiddleware,
|
||||
isPendingActionStale,
|
||||
} = require('@librechat/api');
|
||||
const { logger } = require('@librechat/data-schemas');
|
||||
const { getConvo } = require('~/models');
|
||||
|
||||
module.exports = createMessageRequestMiddleware({
|
||||
getConvo,
|
||||
getJob: (conversationId) => GenerationJobManager.getJob(conversationId),
|
||||
isPendingActionStale,
|
||||
logger,
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue