9.23测试分段

This commit is contained in:
zy123 2024-09-23 15:58:18 +08:00
parent 60f17e32bf
commit 696319056e

View File

@ -266,7 +266,10 @@ def test_process_and_stream():
# 在结束信号之前发送完整的数据
combined_data = {}
for segment in data_segments:
combined_data.update(segment) # 将所有段落数据合并成一个大字典
for outer_key, inner_dict in segment.items():
# 获取内层字典的第一个(也是唯一的)键值对
inner_key, inner_value = next(iter(inner_dict.items()))
combined_data[inner_key] = inner_value
# 发送完整的大字典
complete_response = {