Skip to content

Commit 01abbbc

Browse files
committed
Fix streaming
1 parent 3cce222 commit 01abbbc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sdk/src/impl/llm.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,6 @@ export async function* promptAiSdkStream(
386386
},
387387
})
388388

389-
const requestMetadata = await response.request
390-
emitCacheDebugProviderRequest({
391-
callback: params.onCacheDebugProviderRequestBuilt,
392-
provider: getModelProvider(aiSDKModel),
393-
rawBody: requestMetadata.body,
394-
})
395-
396389
const stopSequenceHandler = new StopSequenceHandler(params.stopSequences)
397390

398391
// Track if we've yielded any content - if so, we can't safely fall back
@@ -587,6 +580,13 @@ export async function* promptAiSdkStream(
587580
const responseValue = await response.response
588581
const messageId = responseValue.id
589582

583+
const requestMetadata = await response.request
584+
emitCacheDebugProviderRequest({
585+
callback: params.onCacheDebugProviderRequestBuilt,
586+
provider: getModelProvider(aiSDKModel),
587+
rawBody: requestMetadata.body,
588+
})
589+
590590
// Skip cost tracking for Claude OAuth (user is on their own subscription)
591591
if (!isClaudeOAuth) {
592592
const providerMetadataResult = await response.providerMetadata

0 commit comments

Comments
 (0)