Skip to content

Commit 1df2568

Browse files
committed
fix
1 parent 4b6a63c commit 1df2568

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

libs/standard-tests/langchain_tests/integration_tests/chat_models.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import base64
22
import json
3-
<<<<<<< HEAD
4-
from typing import Any, List, Optional, cast
5-
from unittest.mock import MagicMock
6-
=======
73
from typing import Any, List, Literal, Optional, cast
8-
>>>>>>> master
4+
from unittest.mock import MagicMock
95

106
import httpx
117
import pytest
@@ -1229,7 +1225,7 @@ def has_tool_calling(self) -> bool:
12291225
if not self.has_tool_calling:
12301226
pytest.skip("Test requires tool calling.")
12311227

1232-
schema, validation_function = _get_joke_class(schema_type) # type: ignore[arg-type]
1228+
schema, validation_function = _get_joke_class(schema_type) # type: ignore[arg-type]
12331229
chat = model.with_structured_output(schema, **self.structured_output_kwargs)
12341230
mock_callback = MagicMock()
12351231
mock_callback.on_chat_model_start = MagicMock()
@@ -1308,7 +1304,9 @@ def has_tool_calling(self) -> bool:
13081304
}
13091305

13101306
@pytest.mark.parametrize("schema_type", ["pydantic", "typeddict", "json_schema"])
1311-
async def test_structured_output_async(self, model: BaseChatModel, schema_type: str) -> None:
1307+
async def test_structured_output_async(
1308+
self, model: BaseChatModel, schema_type: str
1309+
) -> None:
13121310
"""Test to verify structured output is generated both on invoke and stream.
13131311
13141312
This test is optional and should be skipped if the model does not support
@@ -1338,9 +1336,8 @@ def has_tool_calling(self) -> bool:
13381336
if not self.has_tool_calling:
13391337
pytest.skip("Test requires tool calling.")
13401338

1341-
schema, validation_function = _get_joke_class(schema_type) # type: ignore[arg-type]
1339+
schema, validation_function = _get_joke_class(schema_type) # type: ignore[arg-type]
13421340

1343-
# Pydantic class
13441341
chat = model.with_structured_output(schema, **self.structured_output_kwargs)
13451342
ainvoke_callback = _TestCallbackHandler()
13461343

0 commit comments

Comments
 (0)