feat: add dynamic model fetching from Anthropic API #2

Merged
AlexKucera merged 10 commits from dynamic-models into master 2025-10-24 11:14:13 +02:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit f8427e72a0 - Show all commits

No files matched your search

+2 -2
View File
1
@@ -158,14 +158,14 @@ export class ModelService {
/** /**
* Format ModelInfo array to ModelOption array for dropdown * Format ModelInfo array to ModelOption array for dropdown
* Uses display_name if available, otherwise falls back to id * Uses display_name from API for user-friendly model names
* Sorted by displayName for consistent UX across cache/API ordering * Sorted by displayName for consistent UX across cache/API ordering
*/ */
private formatModels(models: ModelInfo[]): ModelOption[] { private formatModels(models: ModelInfo[]): ModelOption[] {
return models return models
.map(model => ({ .map(model => ({
id: model.id, id: model.id,
displayName: model.display_name || model.id displayName: model.display_name
})) }))
.sort((a, b) => a.displayName.localeCompare(b.displayName)); .sort((a, b) => a.displayName.localeCompare(b.displayName));
} }
+1 -1
View File
@@ -63,7 +63,7 @@ export interface CleanupResult {
export interface ModelInfo { export interface ModelInfo {
id: string; id: string;
display_name?: string; display_name: string;
created_at: string; created_at: string;
type: string; type: string;
} }
1