Home / Class/ FakeStructuredChatModel Class — langchain Architecture

FakeStructuredChatModel Class — langchain Architecture

Architecture documentation for the FakeStructuredChatModel class in test_structured.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  30400c4a_4ec5_724d_ecb3_8bc1dc8bb306["FakeStructuredChatModel"]
  f42d1c33_e2a0_9925_258c_0236630deeb3["FakeListChatModel"]
  30400c4a_4ec5_724d_ecb3_8bc1dc8bb306 -->|extends| f42d1c33_e2a0_9925_258c_0236630deeb3
  3513030b_4904_ecfd_7a0d_cc92be4dda69["test_structured.py"]
  30400c4a_4ec5_724d_ecb3_8bc1dc8bb306 -->|defined in| 3513030b_4904_ecfd_7a0d_cc92be4dda69
  14fe1942_54c3_c926_66e4_5555a511e1af["with_structured_output()"]
  30400c4a_4ec5_724d_ecb3_8bc1dc8bb306 -->|method| 14fe1942_54c3_c926_66e4_5555a511e1af
  df08a092_5c18_740f_22d8_2bb6bf7e0aa7["_llm_type()"]
  30400c4a_4ec5_724d_ecb3_8bc1dc8bb306 -->|method| df08a092_5c18_740f_22d8_2bb6bf7e0aa7

Relationship Graph

Source Code

libs/core/tests/unit_tests/prompts/test_structured.py lines 27–38

class FakeStructuredChatModel(FakeListChatModel):
    """Fake chat model for testing purposes."""

    @override
    def with_structured_output(
        self, schema: dict | type[BaseModel], **kwargs: Any
    ) -> Runnable:
        return RunnableLambda(partial(_fake_runnable, schema=schema, **kwargs))

    @property
    def _llm_type(self) -> str:
        return "fake-messages-list-chat-model"

Frequently Asked Questions

What is the FakeStructuredChatModel class?
FakeStructuredChatModel is a class in the langchain codebase, defined in libs/core/tests/unit_tests/prompts/test_structured.py.
Where is FakeStructuredChatModel defined?
FakeStructuredChatModel is defined in libs/core/tests/unit_tests/prompts/test_structured.py at line 27.
What does FakeStructuredChatModel extend?
FakeStructuredChatModel extends FakeListChatModel.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free