Skip to content

Commit e016857

Browse files
committed
fix: simplify getApiProtocol function to remove vertex/bedrock special handling
1 parent 37300ef commit e016857

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

packages/types/src/provider-settings.ts

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -303,23 +303,7 @@ export const getModelId = (settings: ProviderSettings): string | undefined => {
303303
// Providers that use Anthropic-style API protocol
304304
export const ANTHROPIC_STYLE_PROVIDERS: ProviderName[] = ["anthropic", "claude-code"]
305305

306-
// Helper function to determine API protocol for a provider and model
307-
export const getApiProtocol = (provider: ProviderName | undefined, modelId?: string): "anthropic" | "openai" => {
308-
// First check if the provider is an Anthropic-style provider
309-
if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
310-
return "anthropic"
311-
}
312-
313-
// For vertex and bedrock providers, check if the model ID contains "claude" (case-insensitive)
314-
if (
315-
provider &&
316-
(provider === "vertex" || provider === "bedrock") &&
317-
modelId &&
318-
modelId.toLowerCase().includes("claude")
319-
) {
320-
return "anthropic"
321-
}
322-
323-
// Default to OpenAI protocol
324-
return "openai"
306+
// Helper function to determine API protocol for a provider
307+
export const getApiProtocol = (provider: ProviderName | undefined): "anthropic" | "openai" => {
308+
return provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider) ? "anthropic" : "openai"
325309
}

0 commit comments

Comments
 (0)