跳到主内容
@wquguru
精选75OpenAI Agents SDK Python(GitHub Releases)AI 编程与模型

OpenAI Agents SDK Python v0.21.0:新增测试工具

v0.21.0

原文
发到 X

Key Changes

主要变更

This minor release does not introduce a known breaking SDK behavior change. The minor version bump is for the new provider-neutral testing APIs and the OpenAI Python v3 compatibility update.

此小版本未引入已知的破坏性 SDK 行为变更。版本号递增是因为新增了与提供商无关的测试 API,以及 OpenAI Python v3 兼容性更新。

Highlights:

亮点:

  • Added agents.testing, agents.realtime.testing, and agents.voice.testing utilities for deterministic Agent, Sandbox, Realtime, and Voice workflow tests without provider requests.
  • Updated OpenAI provider compatibility to openai>=3.0.0,<4, including HTTPX2-aware request, response, transport, and exception handling.
  • Hardened RunState interruption snapshots, recursive agent-tool approvals, max-turn finalization, streaming cleanup, and sensitive-error redaction.
  • Improved MCP lifecycle snapshot isolation and added configurable retry backoff ceilings.
  • Added Sandbox Runloop existing-secret support and tightened view-image path grants.
  • Added stricter Voice validation for invalid channels, frame rates, incomplete multichannel frames, and non-finite audio rates.
  • 新增 agents.testing、agents.realtime.testing 和 agents.voice.testing 工具,用于在无需提供商请求的情况下进行确定性的 Agent、Sandbox、Realtime 和 Voice 工作流测试。
  • 将 OpenAI 提供商兼容性更新为 openai>=3.0.0,<4,包括支持 HTTPX2 的请求、响应、传输和异常处理。
  • 强化了 RunState 中断快照、递归代理工具审批、最大轮次终结、流清理和敏感错误脱敏。
  • 改进了 MCP 生命周期快照隔离,并增加了可配置的重试退避上限。
  • 为 Sandbox Runloop 增加了现有密钥支持,并收紧了视图图像路径授权。
  • 对无效通道、帧率、不完整的多通道帧和非有限音频速率增加了更严格的 Voice 验证。

What's Changed

变更内容

  • feat: support OpenAI Python 3 and HTTPX2 by @seratch in #4380
  • feat: add scripted model test utilities by @seratch in #4362
  • fix: freeze public testing module contracts by @seratch in #4386
  • fix: freeze public testing API state contracts by @seratch in #4404
  • fix(core): preserve scripted annotation streaming across Python SDK releases by @apcha-oai in #4422
  • fix(core): isolate interruption results by @hsusul in #4384
  • fix(core): close the model stream when a streamed turn ends in a terminal failure by @Luccacvb in #4366
  • fix(core): redact tool output value from output-type validation errors by @hsusul in #4396
  • fix(core): align Responses parallel tool calls with converted tools by @seratch in #4405
  • fix(core): max-turn handler session semantics by @seratch in #4412
  • fix(core): detach RunState interruption snapshots by @seratch in #4409
  • fix(core): isolate RunState checkpoint tool decisions by @seratch in #4413
  • fix(core): resume recursive agent tool approvals by @seratch in #4414
  • fix(mcp): stop handing the tools cache to callers by @chinmayv095 in #4424
  • fix(mcp): protect manager lifecycle state snapshots by @seratch in #4407
  • fix(mcp): isolate manager lifecycle results by @hsusul in #4368
  • fix(mcp): add configurable retry backoff ceiling by @seratch in #4379
  • fix(realtime): handle non-finite audio rates by @hsusul in #4419
  • fix(sandbox): expose the scripted sandbox session type by @seratch in #4406
  • fix(sandbox): apply stacked anchors sequentially by @seratch in #4369
  • fix(sandbox): snapshot HTTP proxy headers by @hsusul in #4397
  • fix(sandbox): snapshot per-op audit policies by @hsusul in #4398
  • fix(sandbox): honor view_image extra path grants by @sylvesterkaczmarek in #4417
  • fix(sessions): handle zero conversation history limits by @hsusul in #4365
  • fix(voice): honor WAV sample width by @FU-max-boop in #4361
  • fix(voice): reject incomplete multichannel audio frames by @seratch in #4370
  • fix(voice): reject non-positive audio channels by @hansu650 in #4372
  • fix(voice): reject non-positive audio frame rates by @hsusul in #4382
  • fix(voice): stop buffering audio when audio tracing is disabled by @rxits in #4411
  • fix(extensions): gate AnyLLM parallel tool calls on converted tools by @weivwang in #4363
  • fix(extensions): preserve resume argument ordering by @viyatb-oai in #4400
  • fix(extensions): let managed_secrets reference existing Runloop secrets by @xumaple in #4378
  • feat: 支持 OpenAI Python 3 和 HTTPX2,由 @seratch 在 #4380 中提交
  • feat: 添加脚本化模型测试工具,由 @seratch 在 #4362 中提交
  • fix: 冻结公共测试模块契约,由 @seratch 在 #4386 中提交
  • fix: 冻结公共测试 API 状态契约,由 @seratch 在 #4404 中提交
  • fix(core): 在 Python SDK 版本中保留脚本化注释流,由 @apcha-oai 在 #4422 中提交
  • fix(core): 隔离中断结果,由 @hsusul 在 #4384 中提交
  • fix(core): 当流式回合以终端失败结束时关闭模型流,由 @Luccacvb 在 #4366 中提交
  • fix(core): 从输出类型验证错误中编辑工具输出值,由 @hsusul 在 #4396 中提交
  • fix(core): 将 Responses 并行工具调用与转换后的工具对齐,由 @seratch 在 #4405 中提交
  • fix(core): 最大轮次处理器的会话语义,由 @seratch 在 #4412 中提交
  • fix(core): 分离 RunState 中断快照,由 @seratch 在 #4409 中提交
  • fix(core): 隔离 RunState 检查点工具决策,由 @seratch 在 #4413 中提交
  • fix(core): 恢复递归代理工具审批,由 @seratch 在 #4414 中提交
  • fix(mcp): 停止将工具缓存传递给调用者,由 @chinmayv095 在 #4424 中提交
  • 修复(mcp):由 @seratch 在 #4407 中保护管理器生命周期状态快照
  • 修复(mcp):由 @hsusul 在 #4368 中隔离管理器生命周期结果
  • 修复(mcp):由 @seratch 在 #4379 中添加可配置的重试退避上限
  • 修复(realtime):由 @hsusul 在 #4419 中处理非有限音频速率
  • 修复(sandbox):由 @seratch 在 #4406 中暴露脚本化沙箱会话类型
  • 修复(sandbox):由 @seratch 在 #4369 中顺序应用堆叠锚点
  • 修复(sandbox):由 @hsusul 在 #4397 中快照 HTTP 代理头
  • 修复(sandbox):由 @hsusul 在 #4398 中快照每个操作的审计策略
  • 修复(sandbox):由 @sylvesterkaczmarek 在 #4417 中尊重 view_image 额外路径授权
  • 修复(sessions):由 @hsusul 在 #4365 中处理零对话历史限制
  • 修复(voice):由 @FU-max-boop 在 #4361 中尊重 WAV 样本宽度
  • 修复(voice):由 @seratch 在 #4370 中拒绝不完整的多声道音频帧
  • 修复(voice):由 @hansu650 在 #4372 中拒绝非正音频声道数
  • 修复(voice):由 @hsusul 在 #4382 中拒绝非正音频帧率
  • 修复(voice):由 @rxits 在 #4411 中在音频追踪禁用时停止缓冲音频
  • 修复(extensions):由 @weivwang 在 #4363 中在转换工具上限制 AnyLLM 并行工具调用
  • 修复(extensions):由 @viyatb-oai 在 #4400 中保留恢复参数顺序
  • 修复(extensions):由 @xumaple 在 #4378 中让 managed_secrets 引用现有的 Runloop 密钥

Documentation & Other Changes

文档和其他更改

  • docs: synchronize v0.20.0 features by @seratch in #4280
  • docs: clarify PGP key location by @jaideeppyne in #4371
  • test: order test spans by start sequence, not by started_at alone by @ErenAta16 in #4392
  • release: 0.21.0 by @seratch in #4387
  • 文档:由 @seratch 在 #4280 中同步 v0.20.0 功能
  • 文档:由 @jaideeppyne 在 #4371 中澄清 PGP 密钥位置
  • 测试:由 @ErenAta16 在 #4392 中按开始序列而非仅按 started_at 排序测试跨度
  • 发布:由 @seratch 在 #4387 中发布 0.21.0

New Contributors

新贡献者

  • @FU-max-boop made their first contribution in #4361
  • @weivwang made their first contribution in #4363
  • @jaideeppyne made their first contribution in #4371
  • @hansu650 made their first contribution in #4372
  • @xumaple made their first contribution in #4378
  • @viyatb-oai made their first contribution in #4400
  • @ErenAta16 made their first contribution in #4392
  • @apcha-oai made their first contribution in #4422
  • @sylvesterkaczmarek made their first contribution in #4417
  • @FU-max-boop 在 #4361 中做出了首次贡献
  • @weivwang 在 #4363 中做出了首次贡献
  • @jaideeppyne 在 #4371 中做出了首次贡献
  • @hansu650 在 #4372 中做出了首次贡献
  • @xumaple 在 #4378 中做出了首次贡献
  • @viyatb-oai 在 #4400 中做出了首次贡献
  • @ErenAta16 在 #4392 中做出了首次贡献
  • @apcha-oai 在 #4422 中做出了首次贡献
  • @sylvesterkaczmarek 在 #4417 中做出了首次贡献

Full Changelog: v0.20.0...v0.21.0

完整变更日志:v0.20.0...v0.21.0

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

另一事件,读法相近