mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-04-28 19:50:34 +00:00
Add langfuse and update logger (#952)
Co-authored-by: bytecraftii <bytecraftii@users.noreply.github.com> Co-authored-by: Wendong-Fan <w3ndong.fan@gmail.com>
This commit is contained in:
parent
cf571b73a4
commit
49e148a2f9
63 changed files with 3095 additions and 2430 deletions
|
|
@ -19,15 +19,14 @@ from app.component.database import session
|
|||
from app.component.auth import Auth, auth_must
|
||||
from fastapi_babel import _
|
||||
from app.model.config.config import Config, ConfigCreate, ConfigUpdate, ConfigInfo, ConfigOut
|
||||
from utils import traceroot_wrapper as traceroot
|
||||
import logging
|
||||
|
||||
logger = traceroot.get_logger("server_config_controller")
|
||||
logger = logging.getLogger("server_config_controller")
|
||||
|
||||
router = APIRouter(tags=["Config Management"])
|
||||
|
||||
|
||||
@router.get("/configs", name="list configs", response_model=list[ConfigOut])
|
||||
@traceroot.trace()
|
||||
async def list_configs(
|
||||
config_group: Optional[str] = None, session: Session = Depends(session), auth: Auth = Depends(auth_must)
|
||||
):
|
||||
|
|
@ -44,7 +43,6 @@ async def list_configs(
|
|||
|
||||
|
||||
@router.get("/configs/{config_id}", name="get config", response_model=ConfigOut)
|
||||
@traceroot.trace()
|
||||
async def get_config(
|
||||
config_id: int,
|
||||
session: Session = Depends(session),
|
||||
|
|
@ -66,7 +64,6 @@ async def get_config(
|
|||
|
||||
|
||||
@router.post("/configs", name="create config", response_model=ConfigOut)
|
||||
@traceroot.trace()
|
||||
async def create_config(config: ConfigCreate, session: Session = Depends(session), auth: Auth = Depends(auth_must)):
|
||||
"""Create new configuration."""
|
||||
user_id = auth.user.id
|
||||
|
|
@ -103,7 +100,6 @@ async def create_config(config: ConfigCreate, session: Session = Depends(session
|
|||
|
||||
|
||||
@router.put("/configs/{config_id}", name="update config", response_model=ConfigOut)
|
||||
@traceroot.trace()
|
||||
async def update_config(
|
||||
config_id: int, config_update: ConfigUpdate, session: Session = Depends(session), auth: Auth = Depends(auth_must)
|
||||
):
|
||||
|
|
@ -149,7 +145,6 @@ async def update_config(
|
|||
|
||||
|
||||
@router.delete("/configs/{config_id}", name="delete config")
|
||||
@traceroot.trace()
|
||||
async def delete_config(config_id: int, session: Session = Depends(session), auth: Auth = Depends(auth_must)):
|
||||
"""Delete configuration."""
|
||||
user_id = auth.user.id
|
||||
|
|
@ -171,7 +166,6 @@ async def delete_config(config_id: int, session: Session = Depends(session), aut
|
|||
|
||||
|
||||
@router.get("/config/info", name="get config info")
|
||||
@traceroot.trace()
|
||||
async def get_config_info(
|
||||
show_all: bool = Query(False, description="Show all config info, including those with empty env_vars"),
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue