fix(anthropic): fix test (#32145)

This commit is contained in:
ccurme
2025-07-21 11:49:40 -03:00
committed by GitHub
parent 0355da3159
commit 2ef9465893

View File

@@ -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(
[