mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-27 22:37:46 +00:00
standard-tests[patch]: resolve pydantic warnings (#26190)
This commit is contained in:
@@ -79,7 +79,8 @@ def my_adder(a: int, b: int) -> int:
|
||||
class ChatModelTests(BaseStandardTests):
|
||||
@property
|
||||
@abstractmethod
|
||||
def chat_model_class(self) -> Type[BaseChatModel]: ...
|
||||
def chat_model_class(self) -> Type[BaseChatModel]:
|
||||
...
|
||||
|
||||
@property
|
||||
def chat_model_params(self) -> dict:
|
||||
@@ -187,7 +188,12 @@ class ChatModelUnitTests(ChatModelTests):
|
||||
tools = [my_adder_tool, my_adder]
|
||||
|
||||
for pydantic_model in TEST_PYDANTIC_MODELS:
|
||||
tools.extend([pydantic_model, pydantic_model.schema()])
|
||||
model_schema = (
|
||||
pydantic_model.model_json_schema()
|
||||
if hasattr(pydantic_model, "model_json_schema")
|
||||
else pydantic_model.schema()
|
||||
)
|
||||
tools.extend([pydantic_model, model_schema])
|
||||
|
||||
# Doing a mypy ignore here since some of the tools are from pydantic
|
||||
# BaseModel 2 which isn't typed properly yet. This will need to be fixed
|
||||
|
@@ -82,3 +82,4 @@ markers = [
|
||||
"compile: mark placeholder test used to compile integration tests without running them",
|
||||
]
|
||||
asyncio_mode = "auto"
|
||||
|
||||
|
Reference in New Issue
Block a user