Skip to content

Commit 2d56659

Browse files
jekalminjekalmin
jekalmin
authored andcommitted
[#217] fix warning of blocking call
1 parent 399d5a7 commit 2d56659

File tree

1 file changed

+2
-1
lines changed
  • custom_components/extended_openai_conversation

1 file changed

+2
-1
lines changed

custom_components/extended_openai_conversation/helpers.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from abc import ABC, abstractmethod
22
from datetime import timedelta
3+
from functools import partial
34
import logging
45
import os
56
import re
@@ -152,7 +153,7 @@ async def validate_authentication(
152153
http_client=get_async_client(hass),
153154
)
154155

155-
await client.models.list(timeout=10)
156+
await hass.async_add_executor_job(partial(client.models.list, timeout=10))
156157

157158

158159
class FunctionExecutor(ABC):

0 commit comments

Comments
 (0)