mirror of
https://github.com/hwchase17/langchain.git
synced 2026-06-09 18:50:33 +00:00
In rare cases (difficult to reproduce), Mistral's API fails to return valid bodies, leading to failures from `PydanticToolsParser`
28 lines
896 B
Python
28 lines
896 B
Python
"""Standard LangChain interface tests."""
|
|
|
|
import pytest
|
|
from langchain_core.language_models import BaseChatModel
|
|
from langchain_tests.integration_tests import ( # type: ignore[import-not-found]
|
|
ChatModelIntegrationTests, # type: ignore[import-not-found]
|
|
)
|
|
|
|
from langchain_mistralai import ChatMistralAI
|
|
|
|
|
|
class TestMistralStandard(ChatModelIntegrationTests):
|
|
@property
|
|
def chat_model_class(self) -> type[BaseChatModel]:
|
|
return ChatMistralAI
|
|
|
|
@property
|
|
def chat_model_params(self) -> dict:
|
|
return {"model": "mistral-large-latest", "temperature": 0}
|
|
|
|
@property
|
|
def supports_json_mode(self) -> bool:
|
|
return True
|
|
|
|
@pytest.mark.xfail(reason=("MistralAI inconsistently fails to return valid fields"))
|
|
def test_structured_output_pydantic_2_v1(self, model: BaseChatModel) -> None:
|
|
super().test_structured_output_pydantic_2_v1(model)
|