Bugfixes, store output logs

This commit is contained in:
Anton Osika
2023-06-25 10:48:51 +02:00
parent 8b2ea8ef58
commit 2a39cc4cd7
5 changed files with 66 additions and 25 deletions

View File

@@ -32,8 +32,9 @@ def get_prompt(dbs):
colored("Please put the prompt in the file `prompt`, not `main_prompt", "red")
)
print()
return dbs.input["main_prompt"]
return dbs.input.get("prompt", dbs.input["main_prompt"])
return dbs.input["prompt"]
def simple_gen(ai: AI, dbs: DBs):
@@ -65,9 +66,7 @@ def clarify(ai: AI, dbs: DBs):
print()
messages = ai.next(
messages,
ai.fuser(
"Make your own assumptions and state them explicitly before starting"
),
"Make your own assumptions and state them explicitly before starting",
)
print()
return messages
@@ -192,7 +191,16 @@ def execute_entrypoint(ai, dbs):
print("You can press ctrl+c *once* to stop the execution.")
print()
subprocess.run("bash run.sh", shell=True, cwd=dbs.workspace.path)
p = subprocess.Popen("bash run.sh", shell=True, cwd=dbs.workspace.path)
try:
p.wait()
except KeyboardInterrupt:
print("Stopping execution...")
print()
p.kill()
print()
print("Execution stopped.")
return []