Skip to content

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

Python

set media resolution to high

Abi Rajaf0e2d5718edc
diff --git a/backend/models/gemini.py b/backend/models/gemini.py
index e90762ad..eecc275a 100644
--- a/backend/models/gemini.py
+++ b/backend/models/gemini.py
@@ -359,6 +359,7 @@ async def stream_gemini_response_video(
thinking_config=types.ThinkingConfig(
thinking_level="minimal", include_thoughts=True
),
+ media_resolution=types.MediaResolution.MEDIA_RESOLUTION_HIGH,
)
elif model == Llm.GEMINI_3_PRO_PREVIEW_HIGH:
config = types.GenerateContentConfig(
@@ -368,6 +369,7 @@ async def stream_gemini_response_video(
thinking_config=types.ThinkingConfig(
thinking_level="high", include_thoughts=True
),
+ media_resolution=types.MediaResolution.MEDIA_RESOLUTION_HIGH,
)
elif model == Llm.GEMINI_3_PRO_PREVIEW_LOW:
config = types.GenerateContentConfig(
@@ -377,6 +379,7 @@ async def stream_gemini_response_video(
thinking_config=types.ThinkingConfig(
thinking_level="low", include_thoughts=True
),
+ media_resolution=types.MediaResolution.MEDIA_RESOLUTION_HIGH,
)
else:
# Default config for other models
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py
index 754233bc..f2446278 100644
--- a/backend/routes/generate_code.py
+++ b/backend/routes/generate_code.py
@@ -524,7 +524,7 @@ class VideoGenerationStage:
system_prompt=GEMINI_VIDEO_PROMPT,
api_key=gemini_api_key,
callback=lambda x: process_chunk(x, 0),
- model=Llm.GEMINI_3_FLASH_PREVIEW_MINIMAL,
+ model=Llm.GEMINI_3_PRO_PREVIEW_HIGH,
thinking_callback=lambda x: process_thinking(x, 0),
)
]