Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)
Python
close OpenAI client
Abi Rajaa98b9d83f017
diff --git a/backend/image_generation.py b/backend/image_generation.pyindex ad217720..bb272f8d 100644--- a/backend/image_generation.py+++ b/backend/image_generation.py@@ -31,6 +31,7 @@ async def generate_image(prompt, api_key, base_url):"prompt": prompt,}res = await client.images.generate(**image_params)+ await client.close()return res.data[0].urldiff --git a/backend/llm.py b/backend/llm.pyindex fdb1ba07..e2b41c4f 100644--- a/backend/llm.py+++ b/backend/llm.py@@ -30,4 +30,6 @@ async def stream_openai_response(full_response += contentawait callback(content)+ await client.close()+return full_response