chore(core): add test for nested pydantic fields in schemas (#32285)

This commit is contained in:
ccurme 2025-07-28 14:27:24 -03:00 committed by GitHub
parent 7a26c3d233
commit c55294ecb0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2586,6 +2586,18 @@ def test_title_property_preserved() -> None:
}
def test_nested_pydantic_fields() -> None:
class Address(BaseModel):
street: str
class Person(BaseModel):
name: str
address: Address = Field(description="Home address")
result = convert_to_openai_tool(Person)
assert len(result["function"]["parameters"]["properties"]) == 2
async def test_tool_ainvoke_does_not_mutate_inputs() -> None:
"""Verify that the inputs are not mutated when invoking a tool asynchronously."""