Skip to content

Commit

Permalink
fix: disabled retries in openai client (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
adubovik authored Aug 27, 2024
1 parent 7d3d779 commit 59081e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aidial_adapter_openai/utils/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def get_client(self, params: OpenAIParams) -> AsyncOpenAI:
pass


# Retries are handled on the DIAL Core side
_MAX_RETRIES = 0


class AzureOpenAIEndpoint(BaseModel):
azure_endpoint: str
azure_deployment: str
Expand All @@ -36,6 +40,7 @@ def get_client(self, params: OpenAIParams) -> AsyncAzureOpenAI:
azure_ad_token=params.get("azure_ad_token"),
api_version=params.get("api_version"),
timeout=params.get("timeout"),
max_retries=_MAX_RETRIES,
http_client=get_http_client(),
)

Expand All @@ -48,6 +53,7 @@ def get_client(self, params: OpenAIParams) -> AsyncOpenAI:
base_url=self.base_url,
api_key=params.get("api_key"),
timeout=params.get("timeout"),
max_retries=_MAX_RETRIES,
http_client=get_http_client(),
)

Expand Down

0 comments on commit 59081e1

Please sign in to comment.