InvalidProfileModel Class — langchain Architecture
Architecture documentation for the InvalidProfileModel class in test_summarization.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD ed86ec58_2517_2a2a_511d_dab47fcea863["InvalidProfileModel"] 48aa29b8_65e7_522f_a445_a441eeb6baff["BaseChatModel"] ed86ec58_2517_2a2a_511d_dab47fcea863 -->|extends| 48aa29b8_65e7_522f_a445_a441eeb6baff 1911a463_b67d_0301_5ef1_5c535dafc14a["test_summarization.py"] ed86ec58_2517_2a2a_511d_dab47fcea863 -->|defined in| 1911a463_b67d_0301_5ef1_5c535dafc14a 0490aaa7_6910_c6d6_4de3_54bfab7edf76["_generate()"] ed86ec58_2517_2a2a_511d_dab47fcea863 -->|method| 0490aaa7_6910_c6d6_4de3_54bfab7edf76 a52d74e5_8e6f_58cc_4f2c_1232dcdb2429["_llm_type()"] ed86ec58_2517_2a2a_511d_dab47fcea863 -->|method| a52d74e5_8e6f_58cc_4f2c_1232dcdb2429 1ff3b626_709b_544f_a336_a1f8ca2df10e["__getattribute__()"] ed86ec58_2517_2a2a_511d_dab47fcea863 -->|method| 1ff3b626_709b_544f_a336_a1f8ca2df10e
Relationship Graph
Source Code
libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_summarization.py lines 664–683
class InvalidProfileModel(BaseChatModel):
@override
def _generate(
self,
messages: list[BaseMessage],
stop: list[str] | None = None,
run_manager: CallbackManagerForLLMRun | None = None,
**kwargs: Any,
) -> ChatResult:
return ChatResult(generations=[ChatGeneration(message=AIMessage(content="Summary"))])
@property
def _llm_type(self) -> str:
return "mock"
# NOTE: Using __getattribute__ because @property cannot override Pydantic fields.
def __getattribute__(self, name: str) -> Any:
if name == "profile":
return "invalid_profile_type"
return super().__getattribute__(name)
Defined In
Extends
Source
Frequently Asked Questions
What is the InvalidProfileModel class?
InvalidProfileModel is a class in the langchain codebase, defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_summarization.py.
Where is InvalidProfileModel defined?
InvalidProfileModel is defined in libs/langchain_v1/tests/unit_tests/agents/middleware/implementations/test_summarization.py at line 664.
What does InvalidProfileModel extend?
InvalidProfileModel extends BaseChatModel.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free