Skip to content

Commit b43b434

Browse files
committed
Enable retries for promptAiSdkStream
1 parent 5e93071 commit b43b434

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

backend/src/llm-apis/vercel-ai-sdk/ai-sdk.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export const promptAiSdkStream = async function* (
108108
const response = streamText({
109109
...options,
110110
model: aiSDKModel,
111-
maxRetries: options.maxRetries,
112111
messages: convertCbToModelMessages(options),
113112
})
114113

@@ -273,6 +272,7 @@ export const promptAiSdk = async function (
273272
agentId?: string
274273
onCostCalculated?: (credits: number) => Promise<void>
275274
includeCacheControl?: boolean
275+
maxRetries?: number
276276
} & Omit<Parameters<typeof generateText>[0], 'model' | 'messages'>,
277277
): Promise<string> {
278278
if (
@@ -347,6 +347,7 @@ export const promptAiSdkStructured = async function <T>(options: {
347347
agentId?: string
348348
onCostCalculated?: (credits: number) => Promise<void>
349349
includeCacheControl?: boolean
350+
maxRetries?: number
350351
}): Promise<T> {
351352
if (
352353
!checkLiveUserInput(

backend/src/prompt-agent-stream.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const getAgentStreamFromTemplate = (params: {
4848
onCostCalculated,
4949
includeCacheControl,
5050
agentId,
51+
maxRetries: 3,
5152
}
5253

5354
// Add Gemini-specific options if needed

0 commit comments

Comments
 (0)