Commit Graph
6 Commits
Author SHA1 Message Date
kicer 4264ed0e39 video-gen: make prompt a required parameter in tool schema 2026-09-05 19:22:29 +08:00
kicer dab3732b50 fix tools name 2026-09-04 22:31:25 +08:00
kicer 88120d61c1 video-gen: drop duration param, restrict image_url to a single URL
The cogvideox-flash API does not accept a duration field — passing
one gets rejected upstream. Remove DEFAULT_DURATION, the
X-Video-Gen-Duration header parser, and the field forwarded to
Zhipu, both in code and README.

image_url was documented as accepting up to 2 URLs for first/last
frame, but the upstream schema only accepts a single string. Tighten
the zod schema to z.string().url().optional() and update README /
FAQ to make the single-URL constraint explicit.
2026-09-04 22:28:39 +08:00
kicer daaa01878d video-gen: auto-expire uploaded files older than UPLOAD_TTL_HOURS
Adds cleanupUploads(): on startup and every hour, deletes files in
UPLOAD_DIR whose mtime is older than UPLOAD_TTL_HOURS (default 24).
Uses fs.promises + parallel stat/unlink, unref() the interval so it
never blocks process shutdown, ignore ENOENT races silently.

Storage is multer diskStorage so memory never holds a full file body,
but disk could grow without bound if uploads pile up unused. This
bounds the disk footprint without requiring a manual cron, and keeps
the 'temp upload' semantics: the URL is meant to be consumed within
the same session anyway.

README: document UPLOAD_TTL_HOURS / UPLOAD_DIR env vars, add design
note for the cleanup loop.
2026-09-04 21:34:24 +08:00
kicer e378ad001f video-gen: add /upload endpoint for local image upload
Adds POST /upload (multer diskStorage, max 8MB, image/* only) returning
a public URL under /uploads/* that can be passed directly to
generate_video.image_url. Uploads live in container temp storage and
are discarded on restart (no persistence, no auth).

generate_video tool description is now built at startup with the real
upload URL baked in (resolved from PUBLIC_BASE_URL env, falls back to
http://localhost:<port>) so the AI sees an exact curl command and
doesn't have to guess the host.

docker-compose: set PUBLIC_BASE_URL=https://video-gen.ai.foresh.com
README: new upload section, reverse-proxy note, FAQ entries
2026-09-04 20:58:51 +08:00
kicer 710200605b add video-gen support 2026-09-04 16:19:34 +08:00