From 9054cddca2fe885857764a21396846d6036f3708 Mon Sep 17 00:00:00 2001 From: Houyun Sun <18763177732@139.com> Date: Sat, 31 Oct 2026 17:54:57 +0800 Subject: [PATCH] fix(types): mark refusal fields read-only and sync API schema --- litellm/proxy/_lazy_openapi_snapshot.json | 1 - litellm/types/llms/openai.py | 6 +++--- ui/litellm-dashboard/src/lib/http/schema.d.ts | 5 +---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/litellm/proxy/_lazy_openapi_snapshot.json b/litellm/proxy/_lazy_openapi_snapshot.json index 667c8b1e64c..52118880bb7 100644 --- a/litellm/proxy/_lazy_openapi_snapshot.json +++ b/litellm/proxy/_lazy_openapi_snapshot.json @@ -48157,7 +48157,6 @@ "type": "object" }, "ChatCompletionRefusalObject": { - "description": "Assistant content part holding the refusal text of a turn the model declined.", "properties": { "cache_control": { "$ref": "#/components/schemas/ChatCompletionCachedContent" diff --git a/litellm/types/llms/openai.py b/litellm/types/llms/openai.py index 88705b245be..efa6e9fe22a 100644 --- a/litellm/types/llms/openai.py +++ b/litellm/types/llms/openai.py @@ -706,14 +706,14 @@ class ChatCompletionRedactedThinkingBlock(TypedDict, total=False): class OpenAIChatCompletionRefusalObject(TypedDict): """Assistant content part holding the refusal text of a turn the model declined.""" - type: Literal["refusal"] - refusal: str + type: ReadOnly[Literal["refusal"]] + refusal: ReadOnly[str] class ChatCompletionRefusalObject( OpenAIChatCompletionRefusalObject, total=False ): # litellm wrapper on top of openai object for handling cached content - cache_control: ChatCompletionCachedContent + cache_control: ReadOnly[ChatCompletionCachedContent] class ChatCompletionReasoningSummaryTextBlock(TypedDict, total=False): diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts index 6b65dbe3495..78f45c815a4 100644 --- a/ui/litellm-dashboard/src/lib/http/schema.d.ts +++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts @@ -28953,10 +28953,7 @@ export interface components { } & { [key: string]: unknown; }; - /** - * ChatCompletionRefusalObject - * @description Assistant content part holding the refusal text of a turn the model declined. - */ + /** ChatCompletionRefusalObject */ ChatCompletionRefusalObject: { cache_control?: components["schemas"]["ChatCompletionCachedContent"]; /** Refusal */