Setting up the chat client functionality using SocketIO - Start

This commit is contained in:
Josako
2024-05-15 14:37:21 +02:00
parent 6f13d72261
commit ea23e8d327
10 changed files with 165 additions and 2 deletions

View File

@@ -63,6 +63,9 @@ class Config(object):
Text is delimited between triple backquotes.
```{text}```"""
# SocketIO settings
SOCKETIO_ASYNC_MODE = 'gevent'
class DevConfig(Config):
DEVELOPMENT = True
@@ -92,6 +95,17 @@ class DevConfig(Config):
UNSTRUCTURED_BASE_URL = 'https://flowitbv-16c4us0m.api.unstructuredapp.io'
UNSTRUCTURED_FULL_URL = 'https://flowitbv-16c4us0m.api.unstructuredapp.io/general/v0/general'
# SocketIO settings
SOCKETIO_MESSAGE_QUEUE = 'redis://localhost:6379/1'
SOCKETIO_CORS_ALLOWED_ORIGINS = '*'
SOCKETIO_LOGGER = True
SOCKETIO_ENGINEIO_LOGGER = True
# Google Cloud settings
GC_PROJECT_NAME = 'EveAI'
GC_KEY_RING = 'eveai-chat'
GC_CRYPTO_KEY = 'envelope-encryption-key'
class ProdConfig(Config):
DEVELOPMENT = False

View File

@@ -18,6 +18,14 @@ LOGGING = {
'backupCount': 10,
'formatter': 'standard',
},
'file_chat': {
'level': 'DEBUG',
'class': 'logging.handlers.RotatingFileHandler',
'filename': 'logs/eveai_chat.log',
'maxBytes': 1024*1024*5, # 5MB
'backupCount': 10,
'formatter': 'standard',
},
'console': {
'class': 'logging.StreamHandler',
'level': 'DEBUG',
@@ -40,6 +48,11 @@ LOGGING = {
'level': 'DEBUG',
'propagate': False
},
'eveai_chat': { # logger for the eveai_chat
'handlers': ['file_chat', 'console'],
'level': 'DEBUG',
'propagate': False
},
'': { # root logger
'handlers': ['console'],
'level': 'WARNING', # Set higher level for root to minimize noise