Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
baskaryan committed Aug 5, 2024
1 parent 9777628 commit deaf5b3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/core/langchain_core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ def add(a: int, b: int) -> int:
def tool(
*args: Union[str, Callable, Runnable],
return_direct: bool = False,
args_schema: Optional[Type[BaseModel]] = None,
args_schema: Optional[TypeBaseModel] = None,
infer_schema: bool = True,
response_format: Literal["content", "content_and_artifact"] = "content",
parse_docstring: bool = False,
Expand Down
4 changes: 2 additions & 2 deletions libs/core/tests/unit_tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ class ModelD(ModelC, Generic[D]):


@pytest.mark.skipif(PYDANTIC_MAJOR_VERSION != 2, reason="Testing pydantic v2.")
def test_tool_args_schema_pydantic_v2_with_metadata():
def test_tool_args_schema_pydantic_v2_with_metadata() -> None:
from pydantic import BaseModel as BaseModelV2 # pydantic: ignore
from pydantic import Field as FieldV2 # pydantic: ignore
from pydantic import ValidationError as ValidationErrorV2 # pydantic: ignore
Expand All @@ -1877,7 +1877,7 @@ class Foo(BaseModelV2):
)

@tool(args_schema=Foo)
def foo(x):
def foo(x): # type: ignore[no-untyped-def]
"""foo"""
return x

Expand Down
2 changes: 1 addition & 1 deletion libs/core/tests/unit_tests/utils/test_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Bar(BaseModelV1):
def test_with_field_metadata() -> None:
"""Test pydantic with field metadata"""
from pydantic import BaseModel as BaseModelV2 # pydantic: ignore
from pydantic import Field as FieldV2
from pydantic import Field as FieldV2 # pydantic: ignore

class Foo(BaseModelV2):
x: List[int] = FieldV2(
Expand Down

0 comments on commit deaf5b3

Please sign in to comment.