[BUG] Native Azure provider ignores timeout and max_retries on the completions path

未关闭
#9,880 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Nezar-Alhammadi 已经在做这个了。

开始于 2026年11月27日。

  • #9881 来自 @Nezar-Alhammadi —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
azure, python
领域
backend

调研方向

Find AzureCompletion._make_client_kwargs() and compare the default completions path with the responses path, which already forwards these settings. Check the sync and async client construction and related tests for retry and timeout configuration. Done when both completions clients receive the expected retry and timeout values; linked pull request #9881 indicates work is already underway.

由索引模型根据 Issue 内容生成。

描述

Description

LLM(model="azure/...", timeout=..., max_retries=...) accepts timeout and max_retries on AzureCompletion (and exports both in to_config_dict() and forwards them when api="responses"), but on the default api="completions" path _make_client_kwargs() never passes either setting to ChatCompletionsClient or AsyncChatCompletionsClient.

As a result:

  • max_retries (including max_retries=0 to disable SDK retries or a higher count like max_retries=5) is ignored, and both sync and async Azure clients always use azure-core's default total_retries=3 (even differing from AzureCompletion's own max_retries: int = 2 field default).
  • timeout is ignored, leaving connection_timeout and read_timeout at the 300s SDK defaults.

Minimal Reproduction

from crewai import LLM

llm = LLM(
    model="azure/gpt-4o",
    api_key="test-key",
    endpoint="https://example.openai.azure.com",
    timeout=15.0,
    max_retries=0,
)

sync_client = llm._get_sync_client()
print("total_retries:", sync_client._config.retry_policy.total_retries)  # 3 instead of 0
print("read_timeout:", sync_client._client._pipeline._transport.connection_config.read_timeout)  # 300 instead of 15.0

Expected Behavior

_make_client_kwargs() passes retry_total=self.max_retries and, when self.timeout is not None, connection_timeout=self.timeout and read_timeout=self.timeout so both the sync and async Azure AI Inference clients honor the configured retry and timeout settings.

主要语言
Python
星标
61.2k
派生
9.2k
平均合并
1 天 14 小时
30 天内合并 PR
180

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

crewAIInc/crewAI 的其他 Issue

查看 crewAIInc/crewAI 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。