2024-01-07 23:22:23 +00:00
|
|
|
"""
|
|
|
|
project: lollms_webui
|
|
|
|
file: chat_bar.py
|
|
|
|
author: ParisNeo
|
|
|
|
description:
|
|
|
|
This module contains a set of FastAPI routes that provide information about the Lord of Large Language and Multimodal Systems (LoLLMs) Web UI
|
|
|
|
application. These routes are linked to lollms_webui chatbox
|
|
|
|
|
|
|
|
"""
|
|
|
|
from fastapi import APIRouter, Request
|
|
|
|
from lollms_webui import LOLLMSWebUI
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from starlette.responses import StreamingResponse
|
|
|
|
from lollms.types import MSG_TYPE
|
|
|
|
from lollms.main_config import BaseConfig
|
|
|
|
from lollms.utilities import detect_antiprompt, remove_text_from_string, trace_exception
|
|
|
|
from ascii_colors import ASCIIColors
|
2024-02-26 00:55:44 +00:00
|
|
|
from lollms.databases.discussions_database import DiscussionsDB
|
2024-01-07 23:22:23 +00:00
|
|
|
from pathlib import Path
|
|
|
|
from safe_store.text_vectorizer import TextVectorizer, VectorizationMethod, VisualizationMethod
|
|
|
|
import tqdm
|
|
|
|
from fastapi import FastAPI, UploadFile, File
|
|
|
|
import shutil
|
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
|
|
|
|
from utilities.execution_engines.python_execution_engine import execute_python
|
|
|
|
from utilities.execution_engines.latex_execution_engine import execute_latex
|
|
|
|
from utilities.execution_engines.shell_execution_engine import execute_bash
|
|
|
|
|
2024-01-09 22:26:41 +00:00
|
|
|
# ----------------------- Defining router and main class ------------------------------
|
2024-01-07 23:22:23 +00:00
|
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
lollmsElfServer:LOLLMSWebUI = LOLLMSWebUI.get_instance()
|