Haystack 发布 v3.2.0-rc1:新增 Agent 压缩与 token 预算钩子
原标题:v3.2.0-rc1
AI 摘要
Haystack 发布 v3.2.0-rc1,引入多项 Agent 与 Pipeline 相关更新。新功能包括实验性的 SummarizationCompactor(配合 CompactionHook 渐进式压缩对话以适配 token 预算)、TokenBudgetHook(限制 Agent 运行 token 消耗)、stop_run 控制标志,以及 Pipeline.add_components()、connect_many() 等便捷方法。升级注意事项涉及 OutputAdapter/ConditionalRouter 序列化需 unsafe=True 加载、Toolset 的 + 运算符被移除、tool_result_offloaded 元键改为列表等破坏性变更。
正文节选
# Release Notes ## v3.2.0-rc1 ### Upgrade Notes - Serialized `OutputAdapter` and `ConditionalRouter` components containing Jinja `custom_filters` must now be loaded with `Pipeline.load(..., unsafe=True)` (or the equivalent `Pipeline.loads` / `Pipeline.from_dict` option). - The `tool_result_offloaded` meta key that the hook sets on an offloaded message now always holds a list of store references rather than a single reference string, since a result can span several entries. Code reading that