FakeStructuredOutputModel Class — langchain Architecture
Architecture documentation for the FakeStructuredOutputModel class in test_fallbacks.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 051e834b_8bff_dcab_1e7b_589fc47bacd2["FakeStructuredOutputModel"] 48aa29b8_65e7_522f_a445_a441eeb6baff["BaseChatModel"] 051e834b_8bff_dcab_1e7b_589fc47bacd2 -->|extends| 48aa29b8_65e7_522f_a445_a441eeb6baff 905e276b_98d0_eba1_e23b_8303081c1894["test_fallbacks.py"] 051e834b_8bff_dcab_1e7b_589fc47bacd2 -->|defined in| 905e276b_98d0_eba1_e23b_8303081c1894 e40a4c4e_4d01_6f86_90da_070609508213["_generate()"] 051e834b_8bff_dcab_1e7b_589fc47bacd2 -->|method| e40a4c4e_4d01_6f86_90da_070609508213 5038135d_7d6b_0c01_1dbb_69a9849dcfd9["bind_tools()"] 051e834b_8bff_dcab_1e7b_589fc47bacd2 -->|method| 5038135d_7d6b_0c01_1dbb_69a9849dcfd9 1603dc76_43e6_51c9_6f00_cb794d486c11["with_structured_output()"] 051e834b_8bff_dcab_1e7b_589fc47bacd2 -->|method| 1603dc76_43e6_51c9_6f00_cb794d486c11 6e44e31c_ca30_ce21_8016_106a091c55ea["_llm_type()"] 051e834b_8bff_dcab_1e7b_589fc47bacd2 -->|method| 6e44e31c_ca30_ce21_8016_106a091c55ea
Relationship Graph
Source Code
libs/core/tests/unit_tests/runnables/test_fallbacks.py lines 321–351
class FakeStructuredOutputModel(BaseChatModel):
foo: int
@override
def _generate(
self,
messages: list[BaseMessage],
stop: list[str] | None = None,
run_manager: CallbackManagerForLLMRun | None = None,
**kwargs: Any,
) -> ChatResult:
"""Top Level call."""
return ChatResult(generations=[])
@override
def bind_tools(
self,
tools: Sequence[dict[str, Any] | type[BaseModel] | Callable | BaseTool],
**kwargs: Any,
) -> Runnable[LanguageModelInput, AIMessage]:
return self.bind(tools=tools)
@override
def with_structured_output(
self, schema: dict | type[BaseModel], **kwargs: Any
) -> Runnable[LanguageModelInput, dict[str, int] | BaseModel]:
return RunnableLambda(lambda _: {"foo": self.foo})
@property
def _llm_type(self) -> str:
return "fake1"
Extends
Source
Frequently Asked Questions
What is the FakeStructuredOutputModel class?
FakeStructuredOutputModel is a class in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_fallbacks.py.
Where is FakeStructuredOutputModel defined?
FakeStructuredOutputModel is defined in libs/core/tests/unit_tests/runnables/test_fallbacks.py at line 321.
What does FakeStructuredOutputModel extend?
FakeStructuredOutputModel extends BaseChatModel.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free