sigoden / llm-functions

Easily create LLM tools and agents using Bash/JavaScript/Python, also a library of commonly used LLM tools and agents.
MIT License
166 stars 22 forks source link

may_execute_py_code executes without asking for permission #43

Closed tomsib2001 closed 4 months ago

tomsib2001 commented 4 months ago

Describe the bug aichat executes "may" types of commands without asking for permission

aichat --model openai:gpt-4o -r %functions% print the 123rd prime
Call may_execute_py_code {"code":"from sympy import primerange\nprime_list = list(primerange(0,730))\nprint(prime_list[122])"}
The 123rd prime number is 677.

I'm using the current main version of aichat (#64982b45) on WSL on Windows, along with commit a799428b397ac7789a91cf94a9c408ee8a2dd6e2 of llm-functions

Expected behavior I expect to be asked whether to run the command.

Screenshots/Logs

 cat tools.txt
get_current_weather.sh
may_execute_py_code.py
may_execute_command.sh
cat bots.txt
todo-sh
cat ~/.config/aichat/config.yaml
model: openai
keybindings: emacs
compress_threshold: 50000
function_calling: true
clients:
- type: openai
  api_key: <my-openai-api-key>

Environment

argc version
Linux DESKTOP-DBPFNLP 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
argc 1.18.0
jq-1.6
/usr/bin/bash GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
/usr/bin/python Python 3.10.12
sigoden commented 4 months ago

see sigoden/aichat#582