Skip to content

Commit a3bc077

Browse files
Check for vid file existence
1 parent f7ae155 commit a3bc077

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

prompts/examples/ffmpeg.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
name: "ffmpeg - convert to gif"
33
tools:
44
- name: imagemagick
5+
- name: file-exists
6+
description: check if a file exists
7+
parameters:
8+
type: object
9+
properties:
10+
path:
11+
type: string
12+
container:
13+
image: busybox:latest
14+
volumes:
15+
- "{{path|safe}}:{{path|safe}}"
16+
command:
17+
- test
18+
- -f
19+
- "{{path|safe}}"
520
- name: ffmpeg
621
description: run the ffmpeg command
722
parameters:
@@ -25,7 +40,8 @@ model: claude-3-5-sonnet-20241022
2540

2641
# prompt user
2742

28-
You will convert /Users/slim/vids/UsingPuppeteer.mp4 to a gif using ffmpeg.
43+
Ask for a video file to convert to a gif. Check that the file exists and if it does not,
44+
then ask again.
2945

3046
Figure out the basedir for this file and use that as the basedir parameter when running ffmpeg.
3147

src/git.clj

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@
8282
{:image "alpine/git:latest"}
8383
(if (string/starts-with? (str dir) "/prompts")
8484
{:workdir (str dir)
85-
:volumes ["docker-prompts-git:/git"]
85+
:volumes ["docker-prompts-git:/git"
86+
"docker-prompts:/prompts:rw"]
8687
:command (concat ["clone" "--depth" "1" (format "https://github.com/%s/%s" owner repo)]
8788
(when ref ["-b" ref])
88-
[(format "/prompts/%s" ref-hash)])
89-
:mounts ["docker-prompts:/prompts:rw"]}
89+
[(format "/prompts/%s" ref-hash)])}
9090
{:host-dir (str dir)
9191
:volumes ["docker-prompts-git:/git"]
9292
:command (concat ["clone" "--depth" "1" (format "https://github.com/%s/%s" owner repo)]

0 commit comments

Comments
 (0)