MCPcopy Create free account
hub / github.com/TheSmallHanCat/flow2api / update_call_logic_config

Function update_call_logic_config

src/api/admin.py:1406–1425  ·  view source on GitHub ↗

Update token call logic configuration.

(
    request: CallLogicConfigRequest,
    token: str = Depends(verify_admin_token)
)

Source from the content-addressed store, hash-verified

1404
1405@router.post("/api/call-logic/config")
1406async 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 ==========

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected