mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 21:08:17 +00:00
PromptService gains importSourceGroup, which finds or creates a source pointer group, grants the PUBLIC viewer role and rolls the group back if the grant fails. The Langfuse catalog sync calls it instead of four storage callbacks and two Mongo error predicates, and the prompt service is composed once in api/server/services/Prompts.js and passed to the prompt routes, linked instructions, instructions prompt access and the Langfuse sync runner. Co-authored-by: Rebase Probe <probe@example.com>
24 lines
958 B
JavaScript
24 lines
958 B
JavaScript
const { logger } = require('@librechat/data-schemas');
|
|
const { CacheKeys } = require('librechat-data-provider');
|
|
const { createLinkedInstructionsResolver } = require('@librechat/api');
|
|
const { promptService } = require('~/server/services/Prompts');
|
|
const { getLogStores } = require('~/cache');
|
|
|
|
/**
|
|
* Shared resolver for an agent's `instructionsPrompt` link. Resolve and cache
|
|
* logic lives in `@librechat/api` (`createLinkedInstructionsResolver`); this
|
|
* module wires in the LibreChat prompt service and the
|
|
* `AGENT_LINKED_INSTRUCTIONS` cache namespace (`~/cache/getLogStores.js`).
|
|
*/
|
|
const linkedInstructionsResolver = createLinkedInstructionsResolver({
|
|
promptService,
|
|
cache: getLogStores(CacheKeys.AGENT_LINKED_INSTRUCTIONS),
|
|
logger,
|
|
});
|
|
|
|
/** @returns {import('@librechat/api').ResolveLinkedInstructions} */
|
|
function getLinkedInstructionsResolver() {
|
|
return linkedInstructionsResolver;
|
|
}
|
|
|
|
module.exports = { getLinkedInstructionsResolver };
|