# PR #44617 完整报告

- 仓库：`vllm-project/vllm`
- 标题：Fix `LLM.wait_for_completion` output type docstring
- 合并时间：2026-06-05 15:16
- 原文链接：http://prhub.com.cn/vllm-project/vllm/pull/44617

---

# 执行摘要

- 一句话：修复 wait_for_completion 文档字符串
- 推荐动作：可直接合并，无需深入审查。该 PR 展示了社区对文档准确性的关注，值得鼓励。

# 功能与动机

Issue #44616 指出 `LLM.wait_for_completion()` 的文档字符串声明 `output_type` 默认值为 `RequestOutput`，但实际实现在 `output_type` 为 `None` 时接受 `(RequestOutput, PoolingRequestOutput)`。文档与实现的不一致会误导用户。

# 实现拆解

修改 `vllm/entrypoints/llm.py` 中 `wait_for_completion` 方法的文档字符串，将 `output_type` 参数描述从 "defaults to RequestOutput" 改为 "If not provided, accepts both RequestOutput and PoolingRequestOutput"，与第 566 行的 `if output_type is None: output_type = (RequestOutput, PoolingRequestOutput)` 实际行为一致。

关键文件：
- `vllm/entrypoints/llm.py`（模块 前端；类别 source；类型 documentation；符号 wait_for_completion）: 修改了 `wait_for_completion` 方法的文档字符串，是本次变更的唯一文件。

关键符号：wait_for_completion

## 关键源码片段

### `vllm/entrypoints/llm.py`

修改了 `wait_for_completion` 方法的文档字符串，是本次变更的唯一文件。

```python
# vllm/entrypoints/llm.py line 547-568

def wait_for_completion(
    self,
    output_type: type[Any] | tuple[type[Any], ...] | None = None,
    *,
    use_tqdm: bool | Callable[..., tqdm] = True,
) -> list[Any]:
    """Wait for all enqueued requests to complete and return results.

    This method processes all requests currently in the engine queue
    and returns their outputs. Use after enqueue() to get results.

    Args:
        output_type: The expected output type(s). If not provided, accepts
            both RequestOutput and PoolingRequestOutput.
        use_tqdm: If True, shows a tqdm progress bar.

    Returns:
        A list of output objects for all completed requests.
    """
    if output_type is None:
        output_type = (RequestOutput, PoolingRequestOutput)

    return self._run_engine(output_type, use_tqdm=use_tqdm)

```

# 评论区精华

无讨论。审核人 DarkLight1337 快速批准（"Thanks for fixing!"）。

- 暂无高价值评论线程

# 风险与影响

- 风险：仅修改文档字符串，无逻辑变更，风险极低。
- 影响：影响范围小，仅对阅读该 API 文档的用户有帮助，消除文档与实现的不一致。
- 风险标记：暂无

# 关联脉络

- 暂无明显关联 PR