From 58abaf7e9136177bc472e286456e0a41bf1f4909 Mon Sep 17 00:00:00 2001 From: Alexander Kucera Date: Fri, 24 Oct 2025 15:25:18 +0200 Subject: [PATCH] Updates ModelsListResponse types to handle empty lists Allows first_id and last_id to be null when no models are present Improves type safety by explicitly handling edge cases in model list responses, preventing potential null reference issues --- types.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types.ts b/types.ts index 4393187..0d784cb 100644 --- a/types.ts +++ b/types.ts @@ -154,12 +154,12 @@ export interface ModelInfo { export interface ModelsListResponse { /** Array of model information */ data: ModelInfo[]; - /** ID of first model in list */ - first_id: string; + /** ID of first model in list (null when data is empty) */ + first_id: string | null; /** Whether more models are available */ has_more: boolean; - /** ID of last model in list */ - last_id: string; + /** ID of last model in list (null when data is empty) */ + last_id: string | null; } /**