You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update AsOpenAIResponseItems to roundtrip User AIContent ResponseItems (#6931)
* Update AsOpenAIResponseItems to roundtrip User AIContent ResponseItems
For Assistant and Tool messages we're directly roundtripping RawRepresentations that are ResponseItems, but not for User messages. Fix that.
* Ensure ordering of AIContent-to-ResponseItem mapping
Previously a ResponseItem between two TextContents, for example, would end up being yielded before the text content that came before it. Instead, yield a response item for each group between directly-mapped items.
Also fix missing RawRepresentation on McpServerToolApprovalResponseContent.
boolhandleEmptyMessage=true;// MCP approval responses (and future cases) yield an item rather than adding a part and we don't want to return an empty user message in that case.
667
-
List<ResponseContentPart>parts=[];
666
+
// Some AIContent items may map to ResponseItems directly. Others map to ResponseContentParts that need to be grouped together.
667
+
// In order to preserve ordering, we yield ResponseItems as we find them, grouping ResponseContentParts between those yielded
0 commit comments