[Bugfix][Responses API] Reuse streamed item ids in final harmony response (#59859)
Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com> Signed-off-by: sfeng33 <4florafeng@gmail.com> Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
@@ -656,6 +656,11 @@ class HarmonyContext(ConversationContext):
|
||||
|
||||
self.last_append_segments: list[Segment] = []
|
||||
self.last_append_flush_status: bool = False
|
||||
# Each completed message with the items sent for it in
|
||||
# output_item.done events, so the final response can reuse their ids.
|
||||
self.streamed_items_by_message: list[
|
||||
tuple[Message, list[ResponseOutputItem]]
|
||||
] = []
|
||||
|
||||
# Turn tracking - replaces multiple individual tracking variables
|
||||
self.current_turn_metrics = TurnMetrics()
|
||||
|
||||
Reference in New Issue
Block a user