OpenAI Codex Python SDK 0.154.0 发布
英文标题:OpenAI Codex Python SDK 0.154.0
OpenAI 发布了 openai-codex Python SDK 0.154.0,要求 Python 3.10 或更高版本,并配套提供 openai-codex-cli-bin 0.154.0 运行时。该版本新增 `max` 和 `ultra` 推理强度选项,并让同步和异步的 `run()`、`turn()` 调用支持 `ExternalMessage`。更新还加入了恢复或分叉线程时的历史选择、单轮服务层级及来源元数据等能力。开发者升级时需调整 `HookMetadata` 访问方式、通知负载读取逻辑,以及对回合句柄事件历史的处理。
打开原文相关 11 · 机会 2
3.6 KB
63.9 KB
中文
使用 pip install --upgrade openai-codex==0.154.0 安装(要求 Python 3.10 或更高版本)。此版本包含配套的 openai-codex-cli-bin==0.154.0 运行时。
- 新增
max和ultra推理强度值。#39662 - 为同步和异步
run()及turn()调用新增ExternalMessage。外部内容可以启动一个回合,或以工具级权限加入一个正在进行的常规回合;它不会授予用户授权。消费者会收到彼此独立的事件流。#44086 - 在恢复/分叉操作中新增
include_turns,为一个新启动的回合新增turn_service_tier,并新增source元数据。历史记录选择会改变返回的响应,而不会改变模型上下文。省略这些选项时,将保留现有默认行为。#44084 - 更新自动生成的协议模型和通知,并保留在回合启动响应之前到达的完成事件。#44032、#44400
升级时请检查以下迁移事项:
HookMetadata现在将其处理器封装在.root中。将诸如hook.command的访问方式替换为hook.root.command,并在读取特定于处理器的字段前检查hook.root.handler_type。- 此前一些未知通知现在具有类型化负载。请读取具名字段,而非
.params;未知或无效的负载仍使用UnknownNotification。 - 手动构造或中途加入的回合句柄,会从其附加点开始接收事件。此前输出不会被重放,因此收集到的结果可能不完整;在完成后附加可能引发
TransportClosedError。如需读取已保存的历史记录,请使用thread.read(include_turns=True)。由thread.turn(...)直接返回的句柄会保留从其请求发送时开始的事件。
自定义 codex_bin 覆盖配置如需使用 ExternalMessage 以及新的历史记录/单回合选项,要求 CLI 版本为 0.151.0 或更高。
English / 原文
Install with pip install --upgrade openai-codex==0.154.0 (Python 3.10 or later). This release includes the matching openai-codex-cli-bin==0.154.0 runtime.
- Add
maxandultrareasoning-effort values. #39662 - Add
ExternalMessageto synchronous and asynchronousrun()andturn()calls. External content can start a turn or join an active regular turn with tool-level authority; it does not grant user authorization. Consumers receive independent event streams. #44086 - Add
include_turnson resume/fork,turn_service_tierfor one newly started turn, andsourcemetadata. History selection changes the returned response, not model context. Existing defaults are preserved when these options are omitted. #44084 - Refresh generated protocol models and notifications, and preserve completion events that arrive before a turn-start response. #44032, #44400
Check these migrations when upgrading:
HookMetadatawraps its handler in.root. Replace accesses such ashook.commandwithhook.root.command, checkinghook.root.handler_typebefore reading handler-specific fields.- Some previously unknown notifications now have typed payloads. Read named fields instead of
.params; unknown or invalid payloads still useUnknownNotification. - Manually constructed or late-joining turn handles receive events from their attachment point. Earlier output is not replayed, so collected results can be partial; attaching after completion can raise
TransportClosedError. Usethread.read(include_turns=True)for saved history. Handles returned directly bythread.turn(...)retain events from when their request is sent.
Custom codex_bin overrides require CLI 0.151.0 or newer for ExternalMessage and the new history/per-turn options.