sigoden/llm-functions

LLM_AGENT_CACHE_DIR not documented nor default fallback

einarpersson opened this issue · 2 comments

Describe the bug

LLM_AGENT_CACHE_DIR is not documented here and does not seem to have a default / fallback value.

To Reproduce

todo-sh>> add todo make a lasagne
Call todo-sh add_todo {"desc":"make a lasagne"}
No such file or directory (os error 2)

Expected behavior
I expected it to just work, since I am following the README here

Environment

❯ aichat --version
aichat 0.19.0

Additional context

The LLM_AGENT_CACHE_DIR is not provide by aichat. It comes from llm-function run-agent

setup_env() {
export LLM_ROOT_DIR="$root_dir"
if [[ -f "$LLM_ROOT_DIR/.env" ]]; then
source "$LLM_ROOT_DIR/.env"
fi
export LLM_TOOL_NAME="$tool_name"
export LLM_TOOL_CACHE_DIR="$LLM_ROOT_DIR/cache/$tool_name"
}

def setup_env(root_dir, tool_name):
os.environ["LLM_ROOT_DIR"] = root_dir
load_env(os.path.join(root_dir, ".env"))
os.environ["LLM_TOOL_NAME"] = tool_name
os.environ["LLM_TOOL_CACHE_DIR"] = os.path.join(root_dir, "cache", tool_name)

function setupEnv(rootDir, toolName) {
process.env["LLM_ROOT_DIR"] = rootDir;
loadEnv(path.resolve(rootDir, ".env"));
process.env["LLM_TOOL_NAME"] = toolName;
process.env["LLM_TOOL_CACHE_DIR"] = path.resolve(rootDir, "cache", toolName);
}

If you want to test agent, please try the argc command:

argc run@agent todo-sh 
llm-functions-run-agent.mp4