(modelId: string)
| 499 | |
| 500 | // Format model ID for display - show just the model name, not the full provider/model path |
| 501 | function formatModelName(modelId: string): string { |
| 502 | // Validate input to ensure we never return undefined |
| 503 | if (typeof modelId !== 'string' || modelId.length === 0) { |
| 504 | return ''; |
| 505 | } |
| 506 | |
| 507 | // Split by / and take the last part if it exists |
| 508 | const parts = modelId.split('/'); |
| 509 | if (parts.length > 1) { |
| 510 | // @ts-expect-error - We know this is valid based on the length check |
| 511 | return parts[parts.length - 1]; |
| 512 | } |
| 513 | |
| 514 | // Return the original value |
| 515 | return modelId; |
| 516 | } |
| 517 | |
| 518 | // Get model display name with helpful context |
| 519 | const getModelDisplayName = (model: OpenRouterModel): string => { |
no outgoing calls
no test coverage detected