Skip to content

Commit

Permalink
fix: minor improvement to load command, added mandelbrot video test t…
Browse files Browse the repository at this point in the history
…o integration test examples
  • Loading branch information
ErikBjare committed Oct 30, 2023
1 parent 9ccb0a3 commit f26469c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gptme/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,11 @@ def handle_cmd(
n = int(args[0]) if args and args[0].isdigit() else 1
log.undo(n)
case "load":
# TODO: replace with automatic loading of any paths in prompt?
filename = args[0] if args else input("Filename: ")
with open(filename) as f:
contents = f.read()
yield Message("system", f"# filename: {filename}\n\n{contents}")
yield Message("system", f"```{filename}\n{contents}\n```")
case "save":
# undo
log.undo(1, quiet=True)
Expand Down
3 changes: 3 additions & 0 deletions tests/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,6 @@ if [ "$interactive" = "1" ]; then
fi

gptme 'render mandelbrot set to mandelbrot.png'

# very heavy! run by hand
# gptme 'render a zooming mandelbrot video to mandelbrot.mp4, use a colorful gradient, write scripts to file'

0 comments on commit f26469c

Please sign in to comment.