mirror of
https://github.com/open-webui/open-webui
synced 2025-03-16 02:17:33 +00:00
refac: folder rename web -> webui
This commit is contained in:
parent
6e89a481be
commit
1fce466253
@ -29,8 +29,8 @@ import time
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from typing import Optional, List, Union
|
from typing import Optional, List, Union
|
||||||
|
|
||||||
from apps.web.models.models import Models
|
from apps.webui.models.models import Models
|
||||||
from apps.web.models.users import Users
|
from apps.webui.models.users import Users
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
||||||
from utils.utils import (
|
from utils.utils import (
|
||||||
decode_token,
|
decode_token,
|
||||||
|
@ -10,8 +10,8 @@ import logging
|
|||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
from apps.web.models.models import Models
|
from apps.webui.models.models import Models
|
||||||
from apps.web.models.users import Users
|
from apps.webui.models.users import Users
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
||||||
from utils.utils import (
|
from utils.utils import (
|
||||||
decode_token,
|
decode_token,
|
||||||
|
@ -14,7 +14,7 @@ You will need to create a migration file to ensure that existing databases are u
|
|||||||
2. Make your changes to the models.
|
2. Make your changes to the models.
|
||||||
3. From the `backend` directory, run the following command:
|
3. From the `backend` directory, run the following command:
|
||||||
```bash
|
```bash
|
||||||
pw_migrate create --auto --auto-source apps.web.models --database sqlite:///${SQLITE_DB} --directory apps/web/internal/migrations ${MIGRATION_NAME}
|
pw_migrate create --auto --auto-source apps.webui.models --database sqlite:///${SQLITE_DB} --directory apps/web/internal/migrations ${MIGRATION_NAME}
|
||||||
```
|
```
|
||||||
- `$SQLITE_DB` should be the path to the database file.
|
- `$SQLITE_DB` should be the path to the database file.
|
||||||
- `$MIGRATION_NAME` should be a descriptive name for the migration.
|
- `$MIGRATION_NAME` should be a descriptive name for the migration.
|
@ -1,7 +1,7 @@
|
|||||||
from fastapi import FastAPI, Depends
|
from fastapi import FastAPI, Depends
|
||||||
from fastapi.routing import APIRoute
|
from fastapi.routing import APIRoute
|
||||||
from fastapi.middleware.cors import CORSMiddleware
|
from fastapi.middleware.cors import CORSMiddleware
|
||||||
from apps.web.routers import (
|
from apps.webui.routers import (
|
||||||
auths,
|
auths,
|
||||||
users,
|
users,
|
||||||
chats,
|
chats,
|
@ -5,10 +5,10 @@ import uuid
|
|||||||
import logging
|
import logging
|
||||||
from peewee import *
|
from peewee import *
|
||||||
|
|
||||||
from apps.web.models.users import UserModel, Users
|
from apps.webui.models.users import UserModel, Users
|
||||||
from utils.utils import verify_password
|
from utils.utils import verify_password
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
|
|
||||||
from config import SRC_LOG_LEVELS
|
from config import SRC_LOG_LEVELS
|
||||||
|
|
@ -7,7 +7,7 @@ import json
|
|||||||
import uuid
|
import uuid
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# Chat DB Schema
|
# Chat DB Schema
|
@ -8,7 +8,7 @@ import logging
|
|||||||
from utils.utils import decode_token
|
from utils.utils import decode_token
|
||||||
from utils.misc import get_gravatar_url
|
from utils.misc import get_gravatar_url
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
@ -3,8 +3,8 @@ from peewee import *
|
|||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
from typing import List, Union, Optional
|
from typing import List, Union, Optional
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
from apps.web.models.chats import Chats
|
from apps.webui.models.chats import Chats
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
@ -8,7 +8,7 @@ from peewee import *
|
|||||||
from playhouse.shortcuts import model_to_dict
|
from playhouse.shortcuts import model_to_dict
|
||||||
from pydantic import BaseModel, ConfigDict
|
from pydantic import BaseModel, ConfigDict
|
||||||
|
|
||||||
from apps.web.internal.db import DB, JSONField
|
from apps.webui.internal.db import DB, JSONField
|
||||||
|
|
||||||
from typing import List, Union, Optional
|
from typing import List, Union, Optional
|
||||||
from config import SRC_LOG_LEVELS
|
from config import SRC_LOG_LEVELS
|
@ -7,7 +7,7 @@ import time
|
|||||||
from utils.utils import decode_token
|
from utils.utils import decode_token
|
||||||
from utils.misc import get_gravatar_url
|
from utils.misc import get_gravatar_url
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
|
@ -8,7 +8,7 @@ import uuid
|
|||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
|
|
||||||
from config import SRC_LOG_LEVELS
|
from config import SRC_LOG_LEVELS
|
||||||
|
|
@ -5,8 +5,8 @@ from typing import List, Union, Optional
|
|||||||
import time
|
import time
|
||||||
from utils.misc import get_gravatar_url
|
from utils.misc import get_gravatar_url
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
from apps.web.models.chats import Chats
|
from apps.webui.models.chats import Chats
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# User DB Schema
|
# User DB Schema
|
@ -10,7 +10,7 @@ import uuid
|
|||||||
import csv
|
import csv
|
||||||
|
|
||||||
|
|
||||||
from apps.web.models.auths import (
|
from apps.webui.models.auths import (
|
||||||
SigninForm,
|
SigninForm,
|
||||||
SignupForm,
|
SignupForm,
|
||||||
AddUserForm,
|
AddUserForm,
|
||||||
@ -21,7 +21,7 @@ from apps.web.models.auths import (
|
|||||||
Auths,
|
Auths,
|
||||||
ApiKey,
|
ApiKey,
|
||||||
)
|
)
|
||||||
from apps.web.models.users import Users
|
from apps.webui.models.users import Users
|
||||||
|
|
||||||
from utils.utils import (
|
from utils.utils import (
|
||||||
get_password_hash,
|
get_password_hash,
|
@ -7,8 +7,8 @@ from pydantic import BaseModel
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from apps.web.models.users import Users
|
from apps.webui.models.users import Users
|
||||||
from apps.web.models.chats import (
|
from apps.webui.models.chats import (
|
||||||
ChatModel,
|
ChatModel,
|
||||||
ChatResponse,
|
ChatResponse,
|
||||||
ChatTitleForm,
|
ChatTitleForm,
|
||||||
@ -18,7 +18,7 @@ from apps.web.models.chats import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
from apps.web.models.tags import (
|
from apps.webui.models.tags import (
|
||||||
TagModel,
|
TagModel,
|
||||||
ChatIdTagModel,
|
ChatIdTagModel,
|
||||||
ChatIdTagForm,
|
ChatIdTagForm,
|
@ -8,7 +8,7 @@ from pydantic import BaseModel
|
|||||||
import time
|
import time
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
from apps.web.models.users import Users
|
from apps.webui.models.users import Users
|
||||||
|
|
||||||
from utils.utils import (
|
from utils.utils import (
|
||||||
get_password_hash,
|
get_password_hash,
|
@ -6,7 +6,7 @@ from fastapi import APIRouter
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from apps.web.models.documents import (
|
from apps.webui.models.documents import (
|
||||||
Documents,
|
Documents,
|
||||||
DocumentForm,
|
DocumentForm,
|
||||||
DocumentUpdateForm,
|
DocumentUpdateForm,
|
@ -7,7 +7,7 @@ from fastapi import APIRouter
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from apps.web.models.memories import Memories, MemoryModel
|
from apps.webui.models.memories import Memories, MemoryModel
|
||||||
|
|
||||||
from utils.utils import get_verified_user
|
from utils.utils import get_verified_user
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
@ -5,7 +5,7 @@ from typing import List, Union, Optional
|
|||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
import json
|
import json
|
||||||
from apps.web.models.models import Models, ModelModel, ModelForm, ModelResponse
|
from apps.webui.models.models import Models, ModelModel, ModelForm, ModelResponse
|
||||||
|
|
||||||
from utils.utils import get_verified_user, get_admin_user
|
from utils.utils import get_verified_user, get_admin_user
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
@ -6,7 +6,7 @@ from fastapi import APIRouter
|
|||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from apps.web.models.prompts import Prompts, PromptForm, PromptModel
|
from apps.webui.models.prompts import Prompts, PromptForm, PromptModel
|
||||||
|
|
||||||
from utils.utils import get_current_user, get_admin_user
|
from utils.utils import get_current_user, get_admin_user
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
@ -9,9 +9,9 @@ import time
|
|||||||
import uuid
|
import uuid
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from apps.web.models.users import UserModel, UserUpdateForm, UserRoleUpdateForm, Users
|
from apps.webui.models.users import UserModel, UserUpdateForm, UserRoleUpdateForm, Users
|
||||||
from apps.web.models.auths import Auths
|
from apps.webui.models.auths import Auths
|
||||||
from apps.web.models.chats import Chats
|
from apps.webui.models.chats import Chats
|
||||||
|
|
||||||
from utils.utils import get_verified_user, get_password_hash, get_admin_user
|
from utils.utils import get_verified_user, get_password_hash, get_admin_user
|
||||||
from constants import ERROR_MESSAGES
|
from constants import ERROR_MESSAGES
|
@ -8,7 +8,7 @@ from pydantic import BaseModel
|
|||||||
from fpdf import FPDF
|
from fpdf import FPDF
|
||||||
import markdown
|
import markdown
|
||||||
|
|
||||||
from apps.web.internal.db import DB
|
from apps.webui.internal.db import DB
|
||||||
from utils.utils import get_admin_user
|
from utils.utils import get_admin_user
|
||||||
from utils.misc import calculate_sha256, get_gravatar_url
|
from utils.misc import calculate_sha256, get_gravatar_url
|
||||||
|
|
@ -25,13 +25,13 @@ from apps.openai.main import app as openai_app, get_all_models as get_openai_mod
|
|||||||
from apps.audio.main import app as audio_app
|
from apps.audio.main import app as audio_app
|
||||||
from apps.images.main import app as images_app
|
from apps.images.main import app as images_app
|
||||||
from apps.rag.main import app as rag_app
|
from apps.rag.main import app as rag_app
|
||||||
from apps.web.main import app as webui_app
|
from apps.webui.main import app as webui_app
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
from apps.web.models.models import Models, ModelModel
|
from apps.webui.models.models import Models, ModelModel
|
||||||
from utils.utils import get_admin_user, get_verified_user
|
from utils.utils import get_admin_user, get_verified_user
|
||||||
from apps.rag.utils import rag_messages
|
from apps.rag.utils import rag_messages
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
from apps.web.models.models import Models, ModelModel, ModelForm, ModelResponse
|
from apps.webui.models.models import Models, ModelModel, ModelForm, ModelResponse
|
||||||
|
|
||||||
|
|
||||||
def get_model_id_from_custom_model_id(id: str):
|
def get_model_id_from_custom_model_id(id: str):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
|
||||||
from fastapi import HTTPException, status, Depends
|
from fastapi import HTTPException, status, Depends
|
||||||
|
|
||||||
from apps.web.models.users import Users
|
from apps.webui.models.users import Users
|
||||||
|
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from typing import Union, Optional
|
from typing import Union, Optional
|
||||||
|
Loading…
Reference in New Issue
Block a user