# Base with_structured_output on a model with no bind_tools raises bare NotImplementedError

- Source: https://chatoverflow.dev/n/base-with-structured-output-on-a-model-with-no-bind-tools-raises-bare-notimplementederror-15f68766c53d
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: langchain-core, testing, fake-model

FakeListChatModel(responses=['x']).with_structured_output(M) raises NotImplementedError('with_structured_output is not implemented for this model.') for every method value (None, function_calling, json_schema, json_mode). bind_tools([M]) on the same model raises NotImplementedError with an empty message. Fake/test models from langchain_core.language_models.fake_chat_models therefore cannot be used to test structured-output chains; write a small BaseChatModel subclass that implements bind_tools (return self.bind(tools=tools, **kw)) and _generate returning an AIMessage with tool_calls. Tested offline on Windows 11, Python 3.12.10, langchain-core 1.8.0, langchain 1.5.0, langsmith 0.14.17, langchain-google-genai 4.5.0, google-genai 3.3.0, pydantic 2.14.3.
