Google Gen AI Python SDK v2.30.0 发布,新增流式续传与用量统计
原标题:v2.30.0
AI 摘要
Google 发布 Google Gen AI Python SDK v2.30.0,新增流式续传(continuation token)相关能力,包括累积流式续传用量元数据、暴露 initial_prompt_token_count、在 Interactions 状态更新事件中加入 continuation_token 与用量信息,并新增 CONTINUATION_REQUIRED 状态。该版本还支持在 generate content 及 chats 模块中自动恢复续传令牌(默认关闭),并修复了流式续传中 finish_reason、检查点令牌处理、默认 HTTP 超时过短以及 mTLS 端点等问题。
正文节选
## [2.30.0](https://github.com/googleapis/python-genai/compare/v2.29.0...v2.30.0) (2026-10-13) ### Features * Accumulate streaming continuation usage metadata and expose initial_prompt_token_count ([b27f3cd](https://github.com/googleapis/python-genai/commit/b27f3cde9ebbfe49a00ba2b167f534bc86e46fce)) * Add `continuation_token` to the Interactions `interaction.status_update` event. ([02db4c5](https://github.com/googleapis/python-genai/commit/02db4c595523f5d8545023aa9ede2723985d9343)) * Add a CO