为异常类型添加 ``__reduce__`` 方法

作者: deMarigny-ZEFR创建于 2025年9月12日更新于 2026年9月25日

This is because there is no `__reduce__` method defined on the Python exceptions. See Ray documentation on serialization here: https://docs.ray.io/en/latest/ray-core/objects/serialization.html#customized-serialization, I'm sure this would affect other runtime environments too. Can a `__reduce__` method be added to exceptions so runtimes, like Ray, do not fail when there is no `__reduce__` method defined on the Python exceptions?

内容来源: openai/openai-python