mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-04 10:42:55 +00:00
chore(core): add test for nested pydantic fields in schemas (#32285)
This commit is contained in:
parent
7a26c3d233
commit
c55294ecb0
@ -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:
|
async def test_tool_ainvoke_does_not_mutate_inputs() -> None:
|
||||||
"""Verify that the inputs are not mutated when invoking a tool asynchronously."""
|
"""Verify that the inputs are not mutated when invoking a tool asynchronously."""
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user