modal-labs / devlooper

A program synthesis agent that autonomously fixes its output by running tests!
MIT License
441 stars 28 forks source link

TypeError: _Image._from_args() got an unexpected keyword argument 'dockerfile_commands' #4

Open simonw opened 3 months ago

simonw commented 3 months ago

The dockerfile_commands= parameter was removed in this commit: https://github.com/modal-labs/modal-client/commit/8dbe0e65be9b46a19d38114d1470456706c6e3b3

Refs:

Affected code:

https://github.com/modal-labs/devlooper/blob/4140c87fc29ee16b09300846e371ba6584a8c092/src/env_templates.py#L44

https://github.com/modal-labs/devlooper/blob/4140c87fc29ee16b09300846e371ba6584a8c092/src/env_templates.py#L65

simonw commented 3 months ago

I tried working around this like so:

diff --git a/src/env_templates.py b/src/env_templates.py
index 73f288b..39f31c9 100644
--- a/src/env_templates.py
+++ b/src/env_templates.py
@@ -41,7 +41,7 @@ TEMPLATES = {
         workdir="/app",
         image=(
             # modal.Image.from_registry("rust:slim", setup_modal_client=False)
-            modal.Image._from_args(dockerfile_commands=["FROM rust:slim"])
+            modal.Image.from_registry("rust:slim")
             .apt_install("build-essential")
             .run_commands("cargo new app --bin")
             .workdir("/app")
@@ -61,8 +61,7 @@ TEMPLATES = {
         test_cmd="yarn run jest --bail",
         workdir="/app",
         image=(
-            # modal.Image.from_registry("node:slim", setup_modal_client=False)
-            modal.Image._from_args(dockerfile_commands=["FROM node:slim"])
+            modal.Image.from_registry("node:slim")
             .run_commands("yarn create vite app --template react")
             .workdir("/app")
             .run_commands(

I got a different error then:

openai.error.InvalidRequestError: The model gpt-3.5-turbo-0613 has been deprecated

simonw commented 3 months ago

Also this deprecation warning:

/root/src/main.py:26: DeprecationError: 2024-04-29: The use of "Stub" has been deprecated in favor of "App". This is a pure name change with no other implications.

simonw commented 3 months ago

It looks like the GPT-3.5 error is in /usr/local/lib/python3.11/site-packages/smol_dev/prompts.py", line 36, in specify_file_paths

That version is installed here: https://github.com/modal-labs/devlooper/blob/4140c87fc29ee16b09300846e371ba6584a8c092/src/main.py#L28-L33

Looks like that package hasn't had an update in a while: https://github.com/smol-ai/developer/commits/main/

nathanielmhld commented 3 months ago

I think the GPT-3.5 error comes from functions being deprecated and replaced with tools by OpenAI.

kning commented 1 month ago

think i just pushed a fix, give it another a try!