@@ -8,6 +8,8 @@ Concise Python SDK and MCP server for generating and extending videos with Googl
88- MCP tools with progress streaming (start/get/cancel, continue_video) and recent videos resource
99- Model discovery (local registry + remote list, cached)
1010- Accurate metadata via ffprobe/OpenCV; outputs under project ` output/ ` (override with ` VEO_OUTPUT_DIR ` )
11+ - Safety settings pass-through for generation (best-effort)
12+ - Context caching helpers and ` cached_content ` support
1113
1214## Install
1315
@@ -70,11 +72,14 @@ Install exposes the `veo` command. Use `-h/--help` on any subcommand.
7072veo preflight
7173veo list-models --remote
7274
73- # Generate from text
74- veo generate --prompt " cat riding a hat" --model veo-3.0-fast-generate-preview
75+ # Generate from text (optional safety + cached content)
76+ veo generate --prompt " cat riding a hat" --model veo-3.0-fast-generate-preview \
77+ --safety-json " [{\" category\" :\" HARM_CATEGORY_HARASSMENT\" ,\" threshold\" :\" BLOCK_ONLY_HIGH\" }]" \
78+ --cached-content " caches/your-cache-name"
7579
7680# Continue a video and stitch seamlessly
77- veo continue --video dog.mp4 --prompt " the dog finds a treasure chest" --overlap 1.0
81+ veo continue --video dog.mp4 --prompt " the dog finds a treasure chest" --overlap 1.0 \
82+ --safety-json " [{\" category\" :\" HARM_CATEGORY_HARASSMENT\" ,\" threshold\" :\" BLOCK_ONLY_HIGH\" }]"
7883
7984# Help
8085veo --help
@@ -105,6 +110,13 @@ final_video = (bridge
105110- ` generate_from_image(image_path, prompt, model, **kwargs) ` - Generate video from image
106111- ` generate_from_video(video_path, prompt, extract_at, model, **kwargs) ` - Continue video
107112
113+ Optional config supported (best-effort pass-through):
114+ - ` aspect_ratio ` (model-dependent)
115+ - ` negative_prompt `
116+ - ` person_generation ` (validated per Veo model and mode)
117+ - ` safety_settings ` (list of {category, threshold} or ` types.SafetySetting ` )
118+ - ` cached_content ` (cache name string)
119+
108120### Processing
109121
110122- ` extract_frame(video_path, time_offset) ` - Extract single frame
@@ -158,6 +170,50 @@ status = veo.generate_get(job_id)
158170veo.generate_cancel(job_id)
159171```
160172
173+ ### Caching helpers
174+
175+ Programmatic usage via MCP-friendly APIs:
176+
177+ ``` python
178+ import veotools as veo
179+
180+ # Create a cache from files
181+ cache = veo.cache_create_from_files(
182+ model = " gemini-1.5-flash-001" ,
183+ files = [" media/a11.txt" ],
184+ system_instruction = " You are an expert analyzing transcripts."
185+ )
186+
187+ # Use cached content in generation
188+ start = veo.generate_start({
189+ " prompt" : " Summarize the transcript" ,
190+ " model" : " veo-3.0-fast-generate-preview" ,
191+ " options" : {" cached_content" : cache.get(" name" )}
192+ })
193+ ```
194+
195+ Manage cached content:
196+
197+ ``` python
198+ import veotools as veo
199+
200+ # List caches (metadata only)
201+ listing = veo.cache_list()
202+ for c in listing.get(" caches" , []):
203+ print (c.get(" name" ), c.get(" display_name" ), c.get(" expire_time" ))
204+
205+ # Get single cache metadata
206+ meta = veo.cache_get(name = " caches/abc123" )
207+
208+ # Update TTL or expiry time
209+ veo.cache_update(name = " caches/abc123" , ttl_seconds = 600 ) # set TTL to 10 minutes
210+ # or
211+ veo.cache_update(name = " caches/abc123" , expire_time_iso = " 2025-01-27T16:02:36.473528+00:00" )
212+
213+ # Delete cache
214+ veo.cache_delete(name = " caches/abc123" )
215+ ```
216+
161217### Cursor MCP configuration
162218
163219Add an entry in ` ~/.cursor/mcp.json ` pointing to the installed ` veo-mcp ` (or your venv path):
@@ -279,6 +335,9 @@ Organized file management (local now, cloud-ready for future).
279335
280336- Generation usually takes 1–3 minutes
281337- Veo access may require allowlist
338+ - Person generation constraints per Veo docs:
339+ - Veo 3: text→video allows ` allow_all ` ; image/video-seeded allows ` allow_adult `
340+ - Veo 2: text→video allows ` allow_all ` , ` allow_adult ` , ` dont_allow ` ; image/video-seeded allows ` allow_adult ` , ` dont_allow `
282341
283342## License
284343
0 commit comments