- Introduction of dynamic Retrievers & Specialists
- Introduction of dynamic Processors - Introduction of caching system - Introduction of a better template manager - Adaptation of ModelVariables to support dynamic Processors / Retrievers / Specialists - Start adaptation of chat client
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
import gevent
|
||||
import time
|
||||
from flask import current_app
|
||||
@@ -28,3 +30,17 @@ def sync_folder(file_path):
|
||||
dir_fd = os.open(file_path, os.O_RDONLY)
|
||||
os.fsync(dir_fd)
|
||||
os.close(dir_fd)
|
||||
|
||||
|
||||
def get_project_root():
|
||||
"""Get the root directory of the project."""
|
||||
# Use the module that's actually running (not this file)
|
||||
module = sys.modules['__main__']
|
||||
if hasattr(module, '__file__'):
|
||||
# Get the path to the main module
|
||||
main_path = os.path.abspath(module.__file__)
|
||||
# Get the root directory (where the main module is located)
|
||||
return os.path.dirname(main_path)
|
||||
else:
|
||||
# Fallback: use current working directory
|
||||
return os.getcwd()
|
||||
|
||||
Reference in New Issue
Block a user