diff options
| author | sigoden <sigoden@gmail.com> | 2025-02-10 14:47:37 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 14:47:37 +0800 |
| commit | fad2c60605b67a44dc6d242cd99f6f79f1bd4b13 (patch) | |
| tree | 1e09d16e378c273ad2d3668e329c80aeaf6d741c /scripts/run-agent.js | |
| parent | e4f85a056cdd2081374e3923af660942363f1133 (diff) | |
| download | llm-functions-docker-fad2c60605b67a44dc6d242cd99f6f79f1bd4b13.tar.gz | |
refactor: improve run-agent/run-agent scripts (#160)
Diffstat (limited to 'scripts/run-agent.js')
| -rwxr-xr-x | scripts/run-agent.js | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/scripts/run-agent.js b/scripts/run-agent.js index 6a14990..48096c7 100755 --- a/scripts/run-agent.js +++ b/scripts/run-agent.js @@ -106,15 +106,10 @@ async function loadEnv(filePath) { } async function run(agentName, agentPath, agentFunc, agentData) { - let mod; if (os.platform() === "win32") { agentPath = `file://${agentPath}`; } - try { - mod = await import(agentPath); - } catch { - throw new Error(`Unable to load agent tools at '${agentPath}'`); - } + const mod = await import(agentPath); if (!mod || !mod[agentFunc]) { throw new Error(`Not module function '${agentFunc}' at '${agentPath}'`); } |
