소스 검색

feat: add retry mechanism for zhipuai (#5926)

tags/0.6.13
orangeclk 1 년 전
부모
커밋
f8aaa57f31
No account linked to committer's email address
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3
    0
      api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/core/_http_client.py

+ 3
- 0
api/core/model_runtime/model_providers/zhipuai/zhipuai_sdk/core/_http_client.py 파일 보기

@@ -7,6 +7,8 @@ from typing import Any, Union, cast
import httpx
import pydantic
from httpx import URL, Timeout
from tenacity import retry
from tenacity.stop import stop_after_attempt

from . import _errors
from ._base_type import NOT_GIVEN, Body, Data, Headers, NotGiven, Query, RequestFiles, ResponseT
@@ -221,6 +223,7 @@ class HttpClient:
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()

@retry(stop=stop_after_attempt(ZHIPUAI_DEFAULT_MAX_RETRIES))
def request(
self,
*,

Loading…
취소
저장