Skip to content

Commit 1ad63ed

Browse files
authored
update
1 parent efbc76a commit 1ad63ed

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

libs/agno/agno/vectordb/surrealdb/surrealdb.py

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,35 @@ def __init__(
123123
self.m = m
124124
self.search_ef = search_ef
125125

126+
@property
127+
def async_client(self) -> Union[AsyncWsSurrealConnection, AsyncHttpSurrealConnection]:
128+
"""Check if the async client is initialized.
129+
130+
Raises:
131+
RuntimeError: If the async client is not initialized.
132+
133+
Returns:
134+
The async client.
135+
136+
"""
137+
if self._async_client is None:
138+
msg = "Async client is not initialized"
139+
raise RuntimeError(msg)
140+
return self._async_client
141+
142+
@property
143+
def client(self) -> Union[BlockingHttpSurrealConnection, BlockingWsSurrealConnection]:
144+
"""Check if the client is initialized.
145+
146+
Returns:
147+
The client.
148+
149+
"""
150+
if self._client is None:
151+
msg = "Client is not initialized"
152+
raise RuntimeError(msg)
153+
return self._client
154+
126155
@staticmethod
127156
def _build_filter_condition(filters: Optional[Dict[str, Any]] = None) -> str:
128157
"""Build filter condition for queries.
@@ -462,32 +491,3 @@ def upsert_available() -> bool:
462491
463492
"""
464493
return True
465-
466-
@property
467-
def async_client(self) -> Union[AsyncWsSurrealConnection, AsyncHttpSurrealConnection]:
468-
"""Check if the async client is initialized.
469-
470-
Raises:
471-
RuntimeError: If the async client is not initialized.
472-
473-
Returns:
474-
The async client.
475-
476-
"""
477-
if self._async_client is None:
478-
msg = "Async client is not initialized"
479-
raise RuntimeError(msg)
480-
return self._async_client
481-
482-
@property
483-
def client(self) -> Union[BlockingHttpSurrealConnection, BlockingWsSurrealConnection]:
484-
"""Check if the client is initialized.
485-
486-
Returns:
487-
The client.
488-
489-
"""
490-
if self._client is None:
491-
msg = "Client is not initialized"
492-
raise RuntimeError(msg)
493-
return self._client

0 commit comments

Comments
 (0)