Skip to content

Commit

Permalink
chore(tests): fix pydantic v1 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertCraigie authored and stainless-app[bot] committed Aug 12, 2024
1 parent 22bbd4a commit f1e1060
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/lib/chat/test_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import openai
from openai import OpenAI, AsyncOpenAI
from openai._utils import assert_signatures_in_sync
from openai._compat import PYDANTIC_V2

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

if not PYDANTIC_V2:
ColorDetection.update_forward_refs(**locals()) # type: ignore

completion = _make_snapshot_request(
lambda c: c.beta.chat.completions.parse(
model="gpt-4o-2024-08-06",
Expand Down

0 comments on commit f1e1060

Please sign in to comment.