Skip to content

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

Python

support Gemini 2.0 Pro

Abi Raja8afa39935cf8
diff --git a/backend/evals/core.py b/backend/evals/core.py
index dac30dce..ce5d84de 100644
--- a/backend/evals/core.py
+++ b/backend/evals/core.py
@@ -37,7 +37,7 @@ async def generate_code_core(
callback=lambda x: process_chunk(x),
model=model,
)
- elif model == Llm.GEMINI_2_0_FLASH_EXP:
+ elif model == Llm.GEMINI_2_0_FLASH_EXP or model == Llm.GEMINI_2_0_PRO_EXP:
if not GEMINI_API_KEY:
raise Exception("Gemini API key not found")
diff --git a/backend/llm.py b/backend/llm.py
index 948b4155..c628296e 100644
--- a/backend/llm.py
+++ b/backend/llm.py
@@ -29,6 +29,7 @@ class Llm(Enum):
CLAUDE_3_5_SONNET_2024_10_22 = "claude-3-5-sonnet-20241022"
CLAUDE_3_7_SONNET_2025_02_19 = "claude-3-7-sonnet-20250219"
GEMINI_2_0_FLASH_EXP = "gemini-2.0-flash-exp"
+ GEMINI_2_0_PRO_EXP = "gemini-2.0-pro-exp-02-05"
O1_2024_12_17 = "o1-2024-12-17"
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py
index 2f214ce4..410a1c59 100644
--- a/backend/routes/generate_code.py
+++ b/backend/routes/generate_code.py
@@ -299,13 +299,16 @@ async def stream_code(websocket: WebSocket):
model=model,
)
)
- elif model == Llm.GEMINI_2_0_FLASH_EXP and GEMINI_API_KEY:
+ elif GEMINI_API_KEY and (
+ model == Llm.GEMINI_2_0_PRO_EXP
+ or model == Llm.GEMINI_2_0_FLASH_EXP
+ ):
tasks.append(
stream_gemini_response(
prompt_messages,
api_key=GEMINI_API_KEY,
callback=lambda x, i=index: process_chunk(x, i),
- model=Llm.GEMINI_2_0_FLASH_EXP,
+ model=model,
)
)
elif (