Skip to content

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

Python

update default openai model to GPT_4O_2024_11_20

Abi Rajad4967ead498d
diff --git a/backend/llm.py b/backend/llm.py
index 46ae0c14..4149af87 100644
--- a/backend/llm.py
+++ b/backend/llm.py
@@ -62,6 +62,9 @@ async def stream_openai_response(
):
params["max_tokens"] = 4096
+ if model == Llm.GPT_4O_2024_11_20:
+ params["max_tokens"] = 16384
+
stream = await client.chat.completions.create(**params) # type: ignore
full_response = ""
async for chunk in stream: # type: ignore
diff --git a/backend/routes/generate_code.py b/backend/routes/generate_code.py
index 97c3da9b..d57d7795 100644
--- a/backend/routes/generate_code.py
+++ b/backend/routes/generate_code.py
@@ -296,7 +296,7 @@ async def stream_code(websocket: WebSocket):
api_key=openai_api_key,
base_url=openai_base_url,
callback=lambda x, i=index: process_chunk(x, i),
- model=Llm.GPT_4O_2024_05_13,
+ model=Llm.GPT_4O_2024_11_20,
)
)
elif model == "gemini" and GEMINI_API_KEY: