Skip to content

Commit 2623630

Browse files
committed
chore(tests): fix pydantic v1 tests
1 parent 22bbd4a commit 2623630

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/lib/chat/test_completions.py

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import openai
1616
from openai import OpenAI, AsyncOpenAI
1717
from openai._utils import assert_signatures_in_sync
18+
from openai._compat import PYDANTIC_V2
1819

1920
from ._utils import print_obj
2021
from ...conftest import base_url
@@ -147,6 +148,9 @@ class ColorDetection(BaseModel):
147148
color: Color
148149
hex_color_code: str = Field(description="The hex color code of the detected color")
149150

151+
if not PYDANTIC_V2:
152+
ColorDetection.update_forward_refs(**locals()) # type: ignore
153+
150154
completion = _make_snapshot_request(
151155
lambda c: c.beta.chat.completions.parse(
152156
model="gpt-4o-2024-08-06",

0 commit comments

Comments
 (0)