Skip to content

Commit

Permalink
feat: add retry mechanism for zhipuai (#5926)
Browse files Browse the repository at this point in the history
  • Loading branch information
orangeclk authored Jul 5, 2024
1 parent cabcf94 commit f8aaa57
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
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
Expand Down Expand Up @@ -221,6 +223,7 @@ def __enter__(self):
def __exit__(self, exc_type, exc_val, exc_tb):
self.close()

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

0 comments on commit f8aaa57

Please sign in to comment.