refactor: 优化 RetryHandler 装饰器以支持动态 KeyManager 注入

This commit is contained in:
yinpeng
2025-02-12 17:10:02 +08:00
parent 44f956e4e4
commit b3851441f1
3 changed files with 8 additions and 7 deletions
+1 -1
View File
@@ -46,7 +46,7 @@ async def list_models(
@router.post("/v1/chat/completions")
@router.post("/hf/v1/chat/completions")
@RetryHandler(max_retries=3, key_manager=Depends(get_key_manager), key_arg="api_key")
@RetryHandler(max_retries=3, key_arg="api_key")
async def chat_completion(
request: ChatRequest,
_=Depends(security_service.verify_authorization),