From 387b610185e28b32a400d165b3bb8da381f30b48 Mon Sep 17 00:00:00 2001 From: karpetrosyan Date: Tue, 20 Jan 2026 16:09:12 +0400 Subject: [PATCH 1/3] fix(structured outputs): avoid including beta header if output_format is missing --- src/anthropic/resources/beta/messages/messages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anthropic/resources/beta/messages/messages.py b/src/anthropic/resources/beta/messages/messages.py index 23af32c6..89fbbd6c 100644 --- a/src/anthropic/resources/beta/messages/messages.py +++ b/src/anthropic/resources/beta/messages/messages.py @@ -1113,7 +1113,7 @@ def parse( betas = [beta for beta in betas] if is_given(betas) else [] - if "structured-outputs-2025-11-13" not in betas: + if "structured-outputs-2025-11-13" not in betas and is_given(output_format): # Ensure structured outputs beta is included for parse method betas.append("structured-outputs-2025-11-13") @@ -2789,7 +2789,7 @@ async def parse( ) betas = [beta for beta in betas] if is_given(betas) else [] - if "structured-outputs-2025-11-13" not in betas: + if "structured-outputs-2025-11-13" not in betas and is_given(output_format) and output_format is not None: # Ensure structured outputs beta is included for parse method betas.append("structured-outputs-2025-11-13") From 1fc41838b6624555aaa890e21e6a00ed57949122 Mon Sep 17 00:00:00 2001 From: karpetrosyan Date: Tue, 20 Jan 2026 16:13:52 +0400 Subject: [PATCH 2/3] fix ci --- src/anthropic/types/beta/messages/batch_create_params.py | 4 +--- uv.lock | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/anthropic/types/beta/messages/batch_create_params.py b/src/anthropic/types/beta/messages/batch_create_params.py index c4e6f321..ff506937 100644 --- a/src/anthropic/types/beta/messages/batch_create_params.py +++ b/src/anthropic/types/beta/messages/batch_create_params.py @@ -2,7 +2,7 @@ from __future__ import annotations -from typing import List, Literal, Iterable +from typing import List, Iterable from typing_extensions import Required, Annotated, TypedDict from ...._utils import PropertyInfo @@ -28,8 +28,6 @@ class RequestParamsOutputFormat(TypedDict, total=False): """The JSON schema of the format""" - - class Request(TypedDict, total=False): custom_id: Required[str] """Developer-provided ID created for each request in a Message Batch. diff --git a/uv.lock b/uv.lock index f2064b8c..14f72de9 100644 --- a/uv.lock +++ b/uv.lock @@ -185,7 +185,7 @@ wheels = [ [[package]] name = "anthropic" -version = "0.75.0" +version = "0.76.0" source = { editable = "." } dependencies = [ { name = "anyio" }, From abc9c16d5ac05a38ef56af4048f848d783590490 Mon Sep 17 00:00:00 2001 From: karpetrosyan Date: Tue, 20 Jan 2026 16:19:31 +0400 Subject: [PATCH 3/3] fix condition --- src/anthropic/resources/beta/messages/messages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/anthropic/resources/beta/messages/messages.py b/src/anthropic/resources/beta/messages/messages.py index 89fbbd6c..3b682770 100644 --- a/src/anthropic/resources/beta/messages/messages.py +++ b/src/anthropic/resources/beta/messages/messages.py @@ -2789,7 +2789,7 @@ async def parse( ) betas = [beta for beta in betas] if is_given(betas) else [] - if "structured-outputs-2025-11-13" not in betas and is_given(output_format) and output_format is not None: + if "structured-outputs-2025-11-13" not in betas and is_given(output_format): # Ensure structured outputs beta is included for parse method betas.append("structured-outputs-2025-11-13")