diff --git a/backend/image_generation.py b/backend/image_generation.py index ad21772..bb272f8 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].url diff --git a/backend/llm.py b/backend/llm.py index fdb1ba0..e2b41c4 100644 --- a/backend/llm.py +++ b/backend/llm.py @@ -30,4 +30,6 @@ async def stream_openai_response( full_response += content await callback(content) + await client.close() + return full_response