open-interpreter icon indicating copy to clipboard operation
open-interpreter copied to clipboard

Encountered an unexpected function call. Please open an issue

Open MarkEdmondson1234 opened this issue 2 years ago • 1 comments

Describe the bug

I asked it to use a script in a tools/ folder and it looks like it used it for OpenAI functions instead

Screenshot 2023-11-24 at 15 40 22

the file_modifier.py file is one I have told is available within the prompt.

Reproduce

My prompt includes:

  When given a task, check if a script exists in /app/tools that does that task.  If none exists, make one.
  To modify files, use the /app/tools/file_modifier.py CLI and create temporary text files first you will use to modify existing files: an example of usage is ./file_modifier.py path/to/file.txt path/to/pattern_file.txt path/to/replacement_file.txt
  Do not use shell's 'echo' to change files, as there are other artifacts in stderr/stdout that pollute the stream.
  You can run the scripts in /app/tools with no commands to check the syntax needed e.g. "/app/tools/git_commit_and_push_to_branch.sh <commit-message> <branch-name>"

it doesn't do it every time

Expected behavior

For it to use the function as defined.

Screenshots

No response

Open Interpreter version

0.1.15

Python version

3.10

Operating System name and version

Docker debian

Additional context

No response

MarkEdmondson1234 avatar Nov 24 '23 14:11 MarkEdmondson1234

Hey there, @MarkEdmondson1234!

You might want to try adding this as a user message at the beginning of your conversation rather than in the system_message and see if that improves things.

There is some logic that appends the functions available to the model to the system_message and it might be creating confusion with the model’s function calling.

ericrallen avatar Nov 24 '23 23:11 ericrallen

Closing this stale issue. If this is still a problem with the latest version of Open Interpreter, please alert me to re-open the issue. Thanks!

MikeBirdTech avatar Mar 19 '24 18:03 MikeBirdTech