Skip to content

上下文组织、压缩与版本演进:练习答案 ​

参考实现 ​

追加:

python
try:
    select_history(history, 8, 5, 4)
except ValueError as e:
    assert str(e) == 'fixed context exceeds window'
else:
    raise AssertionError('over-budget request accepted')

把配对消息预先包装为一个组,组成本等于所有消息及协议标签的token之和,再按组选择。不能只删调用保留结果,因为模型将看见没有来源的工具输出。

返回题目。

用心记录每一步成长