mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-12 23:01:07 +00:00
fix event loop exception handling to not mask legitimate errors
This commit is contained in:
parent
5a00ee1f0a
commit
a185dc252b
1 changed files with 3 additions and 1 deletions
|
|
@ -260,7 +260,9 @@ class SupermemorySyncChatCompletions:
|
|||
"Cannot use sync client from within an async context. "
|
||||
"Use AsyncOpenAI with with_supermemory instead."
|
||||
)
|
||||
except RuntimeError:
|
||||
except RuntimeError as e:
|
||||
if "Cannot use sync client" in str(e):
|
||||
raise
|
||||
# No running loop, safe to use asyncio.run
|
||||
return asyncio.run(self.wrapper._process_chat_completion(**kwargs))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue