mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-09 03:17:58 +00:00
fix: add bedrock to ANTHROPIC_STYLE_PROVIDERS for correct token counting
- Added 'bedrock' to ANTHROPIC_STYLE_PROVIDERS array to ensure Bedrock provider uses Anthropic-style API protocol - This fixes incorrect token counting for AWS Bedrock when using Claude models - Resolves issue #6004 where token count was showing unrealistic values
This commit is contained in:
parent
47235e0b00
commit
c962050437
1 changed files with 7 additions and 2 deletions
|
|
@ -301,9 +301,14 @@ export const getModelId = (settings: ProviderSettings): string | undefined => {
|
|||
}
|
||||
|
||||
// Providers that use Anthropic-style API protocol
|
||||
export const ANTHROPIC_STYLE_PROVIDERS: ProviderName[] = ["anthropic", "claude-code"]
|
||||
export const ANTHROPIC_STYLE_PROVIDERS: ProviderName[] = ["anthropic", "claude-code", "bedrock"]
|
||||
|
||||
// Helper function to determine API protocol for a provider
|
||||
export const getApiProtocol = (provider: ProviderName | undefined): "anthropic" | "openai" => {
|
||||
return provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider) ? "anthropic" : "openai"
|
||||
// Check if provider uses Anthropic-style API by default
|
||||
if (provider && ANTHROPIC_STYLE_PROVIDERS.includes(provider)) {
|
||||
return "anthropic"
|
||||
}
|
||||
// Default to OpenAI style
|
||||
return "openai"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue