Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Update gemini.py

Abi Raja0b7afa03a8b9
diff --git a/backend/models/gemini.py b/backend/models/gemini.py
index 2762832d..a33618e9 100644
--- a/backend/models/gemini.py
+++ b/backend/models/gemini.py
@@ -281,11 +281,14 @@ async def stream_gemini_response_video(
client = genai.Client(api_key=api_key)
full_response = ""
- # Create content with video inline data
+ # Create content with video inline data at 10fps for better fidelity
contents = types.Content(
role="user",
parts=[
- types.Part.from_bytes(data=video_bytes, mime_type=video_mime_type),
+ types.Part(
+ inline_data=types.Blob(data=video_bytes, mime_type=video_mime_type),
+ video_metadata=types.VideoMetadata(fps=10),
+ ),
types.Part(text="Analyze this video and generate the code."),
],
)