ParrotFakeChatModel Class — langchain Architecture
Architecture documentation for the ParrotFakeChatModel class in fake_chat_models.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD c95fdd0f_97a9_1be2_e19d_0c8d39881659["ParrotFakeChatModel"] d009a608_c505_bd50_7200_0de8a69ba4b7["BaseChatModel"] c95fdd0f_97a9_1be2_e19d_0c8d39881659 -->|extends| d009a608_c505_bd50_7200_0de8a69ba4b7 625e90ff_0acf_2872_ee23_0e50b0ab92ed["fake_chat_models.py"] c95fdd0f_97a9_1be2_e19d_0c8d39881659 -->|defined in| 625e90ff_0acf_2872_ee23_0e50b0ab92ed 1755c779_1f28_e024_4a31_5a4b1fe8fe4d["_generate()"] c95fdd0f_97a9_1be2_e19d_0c8d39881659 -->|method| 1755c779_1f28_e024_4a31_5a4b1fe8fe4d 69aba29b_1202_0e7e_7be8_d6772abab581["_llm_type()"] c95fdd0f_97a9_1be2_e19d_0c8d39881659 -->|method| 69aba29b_1202_0e7e_7be8_d6772abab581
Relationship Graph
Source Code
libs/core/langchain_core/language_models/fake_chat_models.py lines 374–396
class ParrotFakeChatModel(BaseChatModel):
"""Generic fake chat model that can be used to test the chat model interface.
* Chat model should be usable in both sync and async tests
"""
@override
def _generate(
self,
messages: list[BaseMessage],
stop: list[str] | None = None,
run_manager: CallbackManagerForLLMRun | None = None,
**kwargs: Any,
) -> ChatResult:
if not messages:
msg = "messages list cannot be empty."
raise ValueError(msg)
return ChatResult(generations=[ChatGeneration(message=messages[-1])])
@property
def _llm_type(self) -> str:
return "parrot-fake-chat-model"
Extends
Source
Frequently Asked Questions
What is the ParrotFakeChatModel class?
ParrotFakeChatModel is a class in the langchain codebase, defined in libs/core/langchain_core/language_models/fake_chat_models.py.
Where is ParrotFakeChatModel defined?
ParrotFakeChatModel is defined in libs/core/langchain_core/language_models/fake_chat_models.py at line 374.
What does ParrotFakeChatModel extend?
ParrotFakeChatModel extends BaseChatModel.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free