Skip to content

Commit

Permalink
feat(core): Add API authentication for serve template (#950)
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc authored Dec 19, 2023
1 parent 6739993 commit a10d5f5
Show file tree
Hide file tree
Showing 34 changed files with 1,301 additions and 385 deletions.
3 changes: 0 additions & 3 deletions dbgpt/app/dbgpt_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ def mount_routers(app: FastAPI):
"""Lazy import to avoid high time cost"""
from dbgpt.app.knowledge.api import router as knowledge_router

# from dbgpt.app.prompt.api import router as prompt_router
# prompt has been removed to dbgpt.serve.prompt
from dbgpt.app.llm_manage.api import router as llm_manage_api

from dbgpt.app.openapi.api_v1.api_v1 import router as api_v1
Expand All @@ -93,7 +91,6 @@ def mount_routers(app: FastAPI):
app.include_router(api_fb_v1, prefix="/api", tags=["FeedBack"])

app.include_router(knowledge_router, tags=["Knowledge"])
# app.include_router(prompt_router, tags=["Prompt"])


def mount_static_files(app: FastAPI):
Expand Down
1 change: 0 additions & 1 deletion dbgpt/app/initialization/db_model_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from dbgpt.app.knowledge.space_db import KnowledgeSpaceEntity
from dbgpt.app.openapi.api_v1.feedback.feed_back_db import ChatFeedBackEntity

# from dbgpt.app.prompt.prompt_manage_db import PromptManageEntity
from dbgpt.serve.prompt.models.models import ServeEntity as PromptManageEntity
from dbgpt.datasource.manages.connect_config_db import ConnectConfigEntity
from dbgpt.storage.chat_history.chat_history_db import (
Expand Down
6 changes: 5 additions & 1 deletion dbgpt/app/initialization/serve_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@

def register_serve_apps(system_app: SystemApp):
"""Register serve apps"""
from dbgpt.serve.prompt.serve import Serve as PromptServe
from dbgpt.serve.prompt.serve import Serve as PromptServe, SERVE_CONFIG_KEY_PREFIX

# Replace old prompt serve
# Set config
system_app.config.set(f"{SERVE_CONFIG_KEY_PREFIX}default_user", "dbgpt")
system_app.config.set(f"{SERVE_CONFIG_KEY_PREFIX}default_sys_code", "dbgpt")
# Register serve app
system_app.register(PromptServe, api_prefix="/prompt")
46 changes: 0 additions & 46 deletions dbgpt/app/prompt/api.py

This file was deleted.

89 changes: 0 additions & 89 deletions dbgpt/app/prompt/prompt_manage_db.py

This file was deleted.

44 changes: 0 additions & 44 deletions dbgpt/app/prompt/request/request.py

This file was deleted.

26 changes: 0 additions & 26 deletions dbgpt/app/prompt/request/response.py

This file was deleted.

87 changes: 0 additions & 87 deletions dbgpt/app/prompt/service.py

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions dbgpt/serve/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ def from_app_config(cls, config: AppConfig, config_prefix: str):
config_prefix (str): Configuration prefix
"""
config_dict = config.get_all_by_prefix(config_prefix)
# remove prefix
config_dict = {k[len(config_prefix) :]: v for k, v in config_dict.items()}
return cls(**config_dict)
File renamed without changes.
Loading

0 comments on commit a10d5f5

Please sign in to comment.