close OpenAI client
This commit is contained in:
parent
0cc2c78f55
commit
a98b9d83f0
@ -31,6 +31,7 @@ async def generate_image(prompt, api_key, base_url):
|
|||||||
"prompt": prompt,
|
"prompt": prompt,
|
||||||
}
|
}
|
||||||
res = await client.images.generate(**image_params)
|
res = await client.images.generate(**image_params)
|
||||||
|
await client.close()
|
||||||
return res.data[0].url
|
return res.data[0].url
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,4 +30,6 @@ async def stream_openai_response(
|
|||||||
full_response += content
|
full_response += content
|
||||||
await callback(content)
|
await callback(content)
|
||||||
|
|
||||||
|
await client.close()
|
||||||
|
|
||||||
return full_response
|
return full_response
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user