From 2ef94658938b719fe499120c78085d843a7c5e61 Mon Sep 17 00:00:00 2001 From: ccurme Date: Mon, 21 Jul 2025 11:49:40 -0300 Subject: [PATCH] fix(anthropic): fix test (#32145) --- .../tests/integration_tests/test_experimental.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libs/partners/anthropic/tests/integration_tests/test_experimental.py b/libs/partners/anthropic/tests/integration_tests/test_experimental.py index beca1150eb4..f12dfdbd002 100644 --- a/libs/partners/anthropic/tests/integration_tests/test_experimental.py +++ b/libs/partners/anthropic/tests/integration_tests/test_experimental.py @@ -2,8 +2,7 @@ from __future__ import annotations -from enum import Enum -from typing import Optional +from typing import Literal, Optional from langchain_core.prompts import ChatPromptTemplate from pydantic import BaseModel, Field @@ -123,10 +122,6 @@ def test_with_structured_output() -> None: def test_anthropic_complex_structured_output() -> None: - class ToneEnum(str, Enum): - positive = "positive" - negative = "negative" - class Email(BaseModel): """Relevant information about an email.""" @@ -150,7 +145,9 @@ def test_anthropic_complex_structured_output() -> None: ..., description="High level description of what the email is about", ) - tone: ToneEnum = Field(..., description="The tone of the email.") + tone: Literal["positive", "negative"] = Field( + ..., description="The tone of the email." + ) prompt = ChatPromptTemplate.from_messages( [