Google GenAI SDK Python v3.4.0:弃用非交互命名空间
v3.4.0
推荐理由
本次更新明确弃用了 google.genai.interactions 的非交互命名空间,依赖该旧接口的代码必须尽快迁移,否则将面临兼容性问题。
3.4.0 (2026-11-16)
Features
功能特性
- Add tool search types to the Interactions SDKs (ce09088)
- Deprecate non-interactions names in google.genai.interactions. (f551f8f)
- interactions: Expose static file processing options (36c3c5f)
- Support batch inputs and usage metadata for Gemini embedding models on Gemini Enterprise API (a5f860d)
- 向 Interactions SDKs 添加工具搜索类型 (ce09088)
- 弃用 google.genai.interactions 中非交互相关的名称。(f551f8f)
- interactions:暴露静态文件处理选项 (36c3c5f)
- 在 Gemini Enterprise API 上为 Gemini 嵌入模型支持批量输入和使用元数据 (a5f860d)
Bug Fixes
错误修复
- Await asyncio.sleep in async HTTPX upload retry backoff (f0504ad), refs #2938
- Escape backslashes and delimiter-breaking quotes in generated Python docstrings (e2f8345)
- Ignore braces inside JSON strings when buffering raw stream lines (74ff9fe), refs #2042
- Keep one httpx connection pool per event loop in AsyncHttpxClient and AsyncHttpx2Client (411bb6f), refs #3157
- Merge case variants of User-Agent and x-goog-api-client headers (e7f9ad3), refs #2309
- Remove the per-line length cap when reading aiohttp SSE streams (a3d04bd), refs #3244
- Resolve $defs references per path in process_schema for recursive union schemas (8a9c9fd)
- Resolve Vertex Live connect auth off the event loop and cache ADC credentials (b027a42)
- Split SSE stream lines on CR, LF and CRLF only (6ae3ad1), refs #3243
- Stop the async client finalizer from scheduling an unawaited aclose task (5c20251), refs #1709
- 在异步 HTTPX 上传重试退避中等待 asyncio.sleep (f0504ad),引用 #2938
- 转义生成的 Python docstrings 中的反斜杠和破坏分隔符的引号 (e2f8345)
- 在缓冲原始流行时忽略 JSON 字符串内的花括号 (74ff9fe),引用 #2042
- 在 AsyncHttpxClient 和 AsyncHttpx2Client 中每个事件循环保持一个 httpx 连接池 (411bb6f),引用 #3157
- 合并 User-Agent 和 x-goog-api-client 标头的大小写变体 (e7f9ad3),引用 #2309
- 读取 aiohttp SSE 流时移除每行长度限制 (a3d04bd),引用 #3244
- 在处理递归联合模式的 process_schema 中按路径解析 $defs 引用 (8a9c9fd)
- 从事件循环外解析 Vertex Live 连接认证并缓存 ADC 凭据 (b027a42)
- 仅在 CR、LF 和 CRLF 处分割 SSE 流行 (6ae3ad1),引用 #3243
- 阻止异步客户端终结器调度未等待的 aclose 任务 (5c20251),引用 #1709
Documentation
文档
- Note that some models are not available on v1 (190d701)
- 注明部分模型在 v1 中不可用 (190d701)
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力