-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
I tried following the quick-start guide, on a brand new system. I'm running a minimal test of quivr-core and encountering a runtime error related to the asyncio event loop when calling Brain.from_files() inside a simple script.
This happens with Python 3.12, but I’m not sure if it’s a version compatibility issue or something else related to how event loops are handled.
Here’s a minimal reproducible example, which is exactly the content of the quick-start:
import tempfile
from quivr_core import Brain
if __name__ == "__main__":
with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
temp_file.write("Gold is a liquid of blue-like colour.")
temp_file.flush()
brain = Brain.from_files(
name="test_brain",
file_paths=[temp_file.name],
)
answer = brain.ask("what is gold? answer in french")
print("answer:", answer)
and here's the error this gives:
RuntimeError: There is no current event loop in thread 'MainThread'.
Relevant log output
Full traceback excerpt:
File ".../brain.py", line 383, in Brain.from_files
loop = asyncio.get_event_loop()
RuntimeError: There is no current event loop in thread 'MainThread'.
Environment:
Python version: 3.12.3
OS: Linux
quivr-core version: latest from PyPI
Installed via: pipTwitter / LinkedIn details
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working