mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* refactor: Remove Unused Agent Helpers and Superseded Wrappers * refactor: Remove Dead Auth, Middleware, Protection and Prompt Helpers * refactor: Remove Dead MCP, File, Skill and Endpoint Code * refactor: Remove Dead Stream, Telemetry, Utility and Type Exports * chore: Drop Unused packages/api Dependencies From bun.lock * refactor: Keep Published Compatibility and Deprecated packages/api Exports
22 lines
1.1 KiB
JavaScript
22 lines
1.1 KiB
JavaScript
const { createProvisionService } = require('@librechat/api');
|
|
const { loadAuthValues } = require('~/server/services/Tools/credentials');
|
|
const { uploadVectors } = require('./VectorDB/crud');
|
|
const { getStrategyFunctions } = require('./strategies');
|
|
|
|
/* Wiring only: the provisioning logic lives in packages/api, where it is type checked.
|
|
* Storage strategies, vector upload, and credential lookup are api-workspace concerns,
|
|
* so they are bound here and injected.
|
|
*
|
|
* Built on first use rather than at module load: this module is reachable from the
|
|
* OpenAI-compatible controllers, whose suites partially mock @librechat/api, and a
|
|
* load-time call would throw before any provisioning is requested. */
|
|
let service;
|
|
const getService = () =>
|
|
(service ??= createProvisionService({ getStrategyFunctions, uploadVectors, loadAuthValues }));
|
|
|
|
module.exports = {
|
|
loadCodeApiKey: (...args) => getService().loadCodeApiKey(...args),
|
|
provisionToCodeEnv: (...args) => getService().provisionToCodeEnv(...args),
|
|
provisionToVectorDB: (...args) => getService().provisionToVectorDB(...args),
|
|
checkSessionsAlive: (...args) => getService().checkSessionsAlive(...args),
|
|
};
|