Skip to content

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

Python

update default Option 1 model to be Claude Sonnet 3.5 1022

Abi Raja1301e64b1d46
diff --git a/backend/evals/core.py b/backend/evals/core.py
index ec35d217..37b4889c 100644
--- a/backend/evals/core.py
+++ b/backend/evals/core.py
@@ -17,7 +17,11 @@ async def generate_code_core(
async def process_chunk(_: str):
pass
- if model == Llm.CLAUDE_3_SONNET or model == Llm.CLAUDE_3_5_SONNET_2024_06_20:
+ if (
+ model == Llm.CLAUDE_3_SONNET
+ or model == Llm.CLAUDE_3_5_SONNET_2024_06_20
+ or model == Llm.CLAUDE_3_5_SONNET_2024_10_22
+ ):
if not ANTHROPIC_API_KEY:
raise Exception("Anthropic API key not found")
diff --git a/backend/llm.py b/backend/llm.py
index 2f35a747..6af916ef 100644
--- a/backend/llm.py
+++ b/backend/llm.py
@@ -20,6 +20,7 @@ class Llm(Enum):
CLAUDE_3_OPUS = "claude-3-opus-20240229"
CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
CLAUDE_3_5_SONNET_2024_06_20 = "claude-3-5-sonnet-20240620"
+ CLAUDE_3_5_SONNET_2024_10_22 = "claude-3-5-sonnet-20241022"
# Will throw errors if you send a garbage string
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py
index 71b764df..a9917147 100644
--- a/backend/routes/generate_code.py
+++ b/backend/routes/generate_code.py
@@ -309,7 +309,7 @@ async def stream_code(websocket: WebSocket):
prompt_messages,
api_key=anthropic_api_key,
callback=lambda x, i=index: process_chunk(x, i),
- model=Llm.CLAUDE_3_5_SONNET_2024_06_20,
+ model=Llm.CLAUDE_3_5_SONNET_2024_10_22,
)
)
diff --git a/backend/run_evals.py b/backend/run_evals.py
index 00da70b3..f98f7f5d 100644
--- a/backend/run_evals.py
+++ b/backend/run_evals.py
@@ -14,8 +14,8 @@ from evals.core import generate_code_for_image
from evals.utils import image_to_data_url
STACK = "html_tailwind"
-# MODEL = Llm.CLAUDE_3_5_SONNET_2024_06_20
-N = 2 # Number of outputs to generate
+MODEL = Llm.CLAUDE_3_5_SONNET_2024_10_22
+N = 1 # Number of outputs to generate
async def main():
@@ -34,7 +34,7 @@ async def main():
task = generate_code_for_image(
image_url=data_url,
stack=STACK,
- model=Llm.CLAUDE_3_5_SONNET_2024_06_20,
+ model=MODEL,
)
else:
task = generate_code_for_image(