Commit ef923d6
committed
fix(providers/openai): emit source parts for Responses API streaming annotations
The Responses API streaming path was missing a handler for
"response.output_text.annotation.added" events. This meant that
url_citation and file_citation annotations—which carry source
URLs and titles for web search results—were silently dropped
during streaming.
The non-streaming Generate path and the Chat Completions API
streaming path both handled annotations correctly; only the
Responses API Stream path was affected.
Add a case for "response.output_text.annotation.added" that
parses the annotation map and yields StreamPartTypeSource parts
for url_citation and file_citation types, matching the behavior
of the existing Generate path and the Anthropic provider.
Update TestResponsesStream_WebSearchResponse to include
annotation.added events in the mock stream and assert that
source parts are emitted with the correct URL, title, and type.1 parent 99e504c commit ef923d6
File tree
2 files changed
+65
-12
lines changed- providers/openai
2 files changed
+65
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4061 | 4061 | | |
4062 | 4062 | | |
4063 | 4063 | | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
4064 | 4068 | | |
4065 | | - | |
| 4069 | + | |
4066 | 4070 | | |
4067 | 4071 | | |
4068 | 4072 | | |
| |||
4090 | 4094 | | |
4091 | 4095 | | |
4092 | 4096 | | |
| 4097 | + | |
4093 | 4098 | | |
4094 | 4099 | | |
4095 | 4100 | | |
| |||
4102 | 4107 | | |
4103 | 4108 | | |
4104 | 4109 | | |
| 4110 | + | |
| 4111 | + | |
4105 | 4112 | | |
4106 | 4113 | | |
4107 | 4114 | | |
| |||
4123 | 4130 | | |
4124 | 4131 | | |
4125 | 4132 | | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
4126 | 4143 | | |
4127 | 4144 | | |
4128 | 4145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1077 | 1077 | | |
1078 | 1078 | | |
1079 | 1079 | | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
1089 | 1126 | | |
1090 | | - | |
1091 | | - | |
| 1127 | + | |
1092 | 1128 | | |
1093 | 1129 | | |
1094 | 1130 | | |
| |||
0 commit comments