Update token call logic configuration.
(
request: CallLogicConfigRequest,
token: str = Depends(verify_admin_token)
)
| 1404 | |
| 1405 | @router.post("/api/call-logic/config") |
| 1406 | async def update_call_logic_config( |
| 1407 | request: CallLogicConfigRequest, |
| 1408 | token: str = Depends(verify_admin_token) |
| 1409 | ): |
| 1410 | """Update token call logic configuration.""" |
| 1411 | call_mode = request.call_mode if request.call_mode in ("default", "polling") else None |
| 1412 | if call_mode is None: |
| 1413 | raise HTTPException(status_code=400, detail="Invalid call_mode") |
| 1414 | |
| 1415 | await db.update_call_logic_config(call_mode) |
| 1416 | await db.reload_config_to_memory() |
| 1417 | |
| 1418 | return { |
| 1419 | "success": True, |
| 1420 | "message": "Token轮询模式保存成功", |
| 1421 | "config": { |
| 1422 | "call_mode": call_mode, |
| 1423 | "polling_mode_enabled": call_mode == "polling", |
| 1424 | } |
| 1425 | } |
| 1426 | |
| 1427 | |
| 1428 | # ========== System Info ========== |
nothing calls this directly
no test coverage detected