mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-05-05 07:10:44 +00:00
auto embeddings
- HF embed by default - node imports fix
This commit is contained in:
parent
8dedda9d81
commit
a2c03c06d9
7 changed files with 141 additions and 66 deletions
|
|
@ -7,8 +7,9 @@ const Module = require('module');
|
|||
// Enhance `require` to search CWD first, then globally
|
||||
function customRequire(moduleName) {
|
||||
try {
|
||||
// Try resolving from CWD's node_modules
|
||||
const cwdPath = path.resolve(process.cwd(), 'node_modules', moduleName);
|
||||
// Try resolving from CWD's node_modules using Node's require.resolve
|
||||
const cwdPath = require.resolve(moduleName, { paths: [path.join(process.cwd(), 'node_modules')] });
|
||||
// console.log("resolved path:", cwdPath);
|
||||
return require(cwdPath);
|
||||
} catch (cwdErr) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue