fix: add retry logic to SAP AI Core provider (#6453)

* Use retry behavior for SAP AI Core provider

* add changeset
This commit is contained in:
lcs-bdr authored and GitHub committed 2025-09-26 12:47:08 -07:00
1 parent e852c6953b
commit dd055b3327
2 files changed
+7

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
fix: automatically retry on rate limit errors with SAP AI Core provider
+2
View File
@@ -9,6 +9,7 @@ import { ModelInfo, SapAiCoreModelId, sapAiCoreDefaultModelId, sapAiCoreModels }
import axios from "axios"
import OpenAI from "openai"
import { ApiHandler, CommonApiHandlerOptions } from "../"
import { withRetry } from "../retry"
import { convertToOpenAiMessages } from "../transform/openai-format"
import { ApiStream } from "../transform/stream"
@@ -454,6 +455,7 @@ export class SapAiCoreHandler implements ApiHandler {
return this.deployments?.some((d) => d.name.split(":")[0].toLowerCase() === modelId.split(":")[0].toLowerCase()) ?? false
}
@withRetry()
async *createMessage(systemPrompt: string, messages: Anthropic.Messages.MessageParam[]): ApiStream {
if (this.options.sapAiCoreUseOrchestrationMode) {
yield* this.createMessageWithOrchestration(systemPrompt, messages)