muellerberndt / mini-agi

MiniAGI is a simple general-purpose autonomous agent based on the OpenAI API.
MIT License
2.81k stars 294 forks source link

Running on windows #15

Closed HamzaETTH closed 1 year ago

HamzaETTH commented 1 year ago

Executing commands works fine but when trying to write a python script.

I've noticed that the generate file contain no new lines so execute_python fails and retry again and again . I've tried reminding the AI that this is running on a W10 machine to no avail so I'm guessing the issue lies in the script?

I've had no trouble running https://github.com/emcf/engshell but it does say "for any OS" .

muellerberndt commented 1 year ago

Hmm that’s weird, I checked the engshell code and they don’t seem to do anything special. Are you running the latest commit of the main branch? I just removed a part of the prompt related to escaping newlines.

ismaelc commented 1 year ago

I think, it's thinking it will write the code, but calls execute_python instead. Ran into it just now...

Your thought: I need to write the Flask app code with the required endpoint and back-end logic
Your command: execute_python
Cmd argument:
from flask import Flask, render_template, request, jsonify
import pyocr
muellerberndt commented 1 year ago

I think, it's thinking it will write the code, but calls execute_python instead. Ran into it just now...

Your thought: I need to write the Flask app code with the required endpoint and back-end logic
Your command: execute_python
Cmd argument:
from flask import Flask, render_template, request, jsonify
import pyocr

This seems like expected behavior. execute_python takes an entire Python program as its argument.

ismaelc commented 1 year ago

Yeah but shouldn't it write the code first? Let me try again and investigate

muellerberndt commented 1 year ago

@HamzaETTH I added some explicit instructions for how to treat newlines in Python code. It now seems to consistently produce working code on my Mac. Does it help on Windows?

muellerberndt commented 1 year ago

Yeah but shouldn't it write the code first? Let me try again and investigate

No, the code gets passed directly to Python exec.

muellerberndt commented 1 year ago

@HamzaETTH #18 which should hopefully address the issue, please let me know if it works for you.

HamzaETTH commented 1 year ago

It's fixed ! Thank you.