Skip to content

Commit 78a1c28

Browse files
test: fix flaky openai structured output test by adding Field guidance (#1534)
1 parent f87925b commit 78a1c28

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests_integ/models/test_model_openai.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ def agent(model, tools):
4545
@pytest.fixture
4646
def weather():
4747
class Weather(pydantic.BaseModel):
48-
"""Extracts the time and weather from the user's message with the exact strings."""
48+
"""Extract time and weather values."""
4949

50-
time: str
51-
weather: str
50+
time: str = pydantic.Field(description="The time value only, e.g. '14:30' not 'The time is 14:30'")
51+
weather: str = pydantic.Field(description="The weather condition only, e.g. 'rainy' not 'the weather is rainy'")
5252

5353
return Weather(time="12:00", weather="sunny")
5454

0 commit comments

Comments
 (0)