()
| 242 | return properties; |
| 243 | } |
| 244 | export function buildAPIProviderProperties(): Property[] { |
| 245 | const apiProvider = getAPIProvider(); |
| 246 | const activeProvider = getActiveProviderConfig(); |
| 247 | const providerDisplayName = getProviderDisplayName(); |
| 248 | const configuredAnthropicBaseUrl = getConfiguredAnthropicBaseUrl(); |
| 249 | const properties: Property[] = []; |
| 250 | if (apiProvider !== 'firstParty') { |
| 251 | const providerLabel = { |
| 252 | bedrock: 'AWS Bedrock', |
| 253 | vertex: 'Google Vertex AI', |
| 254 | foundry: 'Microsoft Foundry' |
| 255 | }[apiProvider]; |
| 256 | properties.push({ |
| 257 | label: 'API provider', |
| 258 | value: providerDisplayName || providerLabel |
| 259 | }); |
| 260 | } else if (providerDisplayName && providerDisplayName !== 'Anthropic') { |
| 261 | properties.push({ |
| 262 | label: 'API provider', |
| 263 | value: providerDisplayName |
| 264 | }); |
| 265 | } |
| 266 | if (apiProvider === 'firstParty') { |
| 267 | const anthropicBaseUrl = configuredAnthropicBaseUrl ?? (providerDisplayName !== 'Anthropic' ? activeProvider.baseURL : undefined); |
| 268 | if (anthropicBaseUrl) { |
| 269 | properties.push({ |
| 270 | label: providerDisplayName !== 'Anthropic' ? 'Provider base URL' : 'Anthropic base URL', |
| 271 | value: anthropicBaseUrl |
| 272 | }); |
| 273 | } |
| 274 | } else if (apiProvider === 'bedrock') { |
| 275 | const bedrockBaseUrl = activeProvider.baseURL ?? process.env.ANTHROPIC_BEDROCK_BASE_URL ?? process.env.BEDROCK_BASE_URL; |
| 276 | if (bedrockBaseUrl) { |
| 277 | properties.push({ |
| 278 | label: 'Bedrock base URL', |
| 279 | value: bedrockBaseUrl |
| 280 | }); |
| 281 | } |
| 282 | properties.push({ |
| 283 | label: 'AWS region', |
| 284 | value: activeProvider.region ?? getAWSRegion() |
| 285 | }); |
| 286 | if (isEnvTruthy(process.env.CLAUDE_CODE_SKIP_BEDROCK_AUTH)) { |
| 287 | properties.push({ |
| 288 | value: 'AWS auth skipped' |
| 289 | }); |
| 290 | } |
| 291 | } else if (apiProvider === 'vertex') { |
| 292 | const vertexBaseUrl = activeProvider.baseURL ?? process.env.ANTHROPIC_VERTEX_BASE_URL ?? process.env.VERTEX_BASE_URL; |
| 293 | if (vertexBaseUrl) { |
| 294 | properties.push({ |
| 295 | label: 'Vertex base URL', |
| 296 | value: vertexBaseUrl |
| 297 | }); |
| 298 | } |
| 299 | const gcpProject = activeProvider.projectId ?? process.env.ANTHROPIC_VERTEX_PROJECT_ID; |
| 300 | if (gcpProject) { |
| 301 | properties.push({ |
no test coverage detected