@@ -39,19 +39,33 @@ export const aiSDKConfigs: InstrumentationConfig[] = [
3939 } ,
4040 } ,
4141
42- // streamText - function returning stream
42+ // streamText - async function (v3 only, before the sync refactor in v4)
4343 {
4444 channelName : aiSDKChannels . streamText . channelName ,
4545 module : {
4646 name : "ai" ,
47- versionRange : ">=3.0.0" ,
47+ versionRange : ">=3.0.0 <4.0.0 " ,
4848 filePath : "dist/index.mjs" ,
4949 } ,
5050 functionQuery : {
5151 functionName : "streamText" ,
5252 kind : "Async" ,
5353 } ,
5454 } ,
55+
56+ // streamText - sync function returning stream (v4+)
57+ {
58+ channelName : aiSDKChannels . streamTextSync . channelName ,
59+ module : {
60+ name : "ai" ,
61+ versionRange : ">=4.0.0" ,
62+ filePath : "dist/index.mjs" ,
63+ } ,
64+ functionQuery : {
65+ functionName : "streamText" ,
66+ kind : "Sync" ,
67+ } ,
68+ } ,
5569 {
5670 channelName : aiSDKChannels . streamText . channelName ,
5771 module : {
@@ -143,19 +157,33 @@ export const aiSDKConfigs: InstrumentationConfig[] = [
143157 } ,
144158 } ,
145159
146- // streamObject - function returning stream
160+ // streamObject - async function (v3 only, before the sync refactor in v4)
147161 {
148162 channelName : aiSDKChannels . streamObject . channelName ,
149163 module : {
150164 name : "ai" ,
151- versionRange : ">=3.0.0" ,
165+ versionRange : ">=3.0.0 <4.0.0 " ,
152166 filePath : "dist/index.mjs" ,
153167 } ,
154168 functionQuery : {
155169 functionName : "streamObject" ,
156170 kind : "Async" ,
157171 } ,
158172 } ,
173+
174+ // streamObject - sync function returning stream (v4+)
175+ {
176+ channelName : aiSDKChannels . streamObjectSync . channelName ,
177+ module : {
178+ name : "ai" ,
179+ versionRange : ">=4.0.0" ,
180+ filePath : "dist/index.mjs" ,
181+ } ,
182+ functionQuery : {
183+ functionName : "streamObject" ,
184+ kind : "Sync" ,
185+ } ,
186+ } ,
159187 {
160188 channelName : aiSDKChannels . streamObject . channelName ,
161189 module : {
@@ -199,32 +227,32 @@ export const aiSDKConfigs: InstrumentationConfig[] = [
199227 } ,
200228 } ,
201229
202- // Agent.stream - async method (v5 only)
230+ // Agent.stream - sync method (v5 only)
203231 // The compiled AI SDK bundle emits this as an anonymous class method, so we
204- // target the first async `stream` method in the file instead of a class name.
232+ // target the first sync `stream` method in the file instead of a class name.
205233 {
206- channelName : aiSDKChannels . agentStream . channelName ,
234+ channelName : aiSDKChannels . agentStreamSync . channelName ,
207235 module : {
208236 name : "ai" ,
209237 versionRange : ">=5.0.0 <6.0.0" ,
210238 filePath : "dist/index.mjs" ,
211239 } ,
212240 functionQuery : {
213241 methodName : "stream" ,
214- kind : "Async " ,
242+ kind : "Sync " ,
215243 index : 0 ,
216244 } ,
217245 } ,
218246 {
219- channelName : aiSDKChannels . agentStream . channelName ,
247+ channelName : aiSDKChannels . agentStreamSync . channelName ,
220248 module : {
221249 name : "ai" ,
222250 versionRange : ">=5.0.0 <6.0.0" ,
223251 filePath : "dist/index.js" ,
224252 } ,
225253 functionQuery : {
226254 methodName : "stream" ,
227- kind : "Async " ,
255+ kind : "Sync " ,
228256 index : 0 ,
229257 } ,
230258 } ,
0 commit comments