test_sequential.py — langchain Source File
Architecture documentation for test_sequential.py, a python file in the langchain codebase. 9 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 0021bb47_51ab_bafd_26b4_c2849000554a["test_sequential.py"] b7996424_637b_0b54_6edf_2e18e9c1a8bf["re"] 0021bb47_51ab_bafd_26b4_c2849000554a --> b7996424_637b_0b54_6edf_2e18e9c1a8bf f69d6389_263d_68a4_7fbf_f14c0602a9ba["pytest"] 0021bb47_51ab_bafd_26b4_c2849000554a --> f69d6389_263d_68a4_7fbf_f14c0602a9ba e61aa479_9dc0_09a0_8864_cbf23b8b506c["langchain_core.callbacks.manager"] 0021bb47_51ab_bafd_26b4_c2849000554a --> e61aa479_9dc0_09a0_8864_cbf23b8b506c f85fae70_1011_eaec_151c_4083140ae9e5["typing_extensions"] 0021bb47_51ab_bafd_26b4_c2849000554a --> f85fae70_1011_eaec_151c_4083140ae9e5 9a0fc770_8c3f_14bc_3c7d_37852927778e["langchain_classic.chains.base"] 0021bb47_51ab_bafd_26b4_c2849000554a --> 9a0fc770_8c3f_14bc_3c7d_37852927778e 0bf16f6b_4f46_fb15_0aff_bf2d4f3c153c["langchain_classic.chains.sequential"] 0021bb47_51ab_bafd_26b4_c2849000554a --> 0bf16f6b_4f46_fb15_0aff_bf2d4f3c153c 5b90a9d7_08ea_fab8_2528_673d880c66bf["langchain_classic.memory"] 0021bb47_51ab_bafd_26b4_c2849000554a --> 5b90a9d7_08ea_fab8_2528_673d880c66bf 7c9cda10_8bc1_c40c_6fef_43a016c13ff3["langchain_classic.memory.simple"] 0021bb47_51ab_bafd_26b4_c2849000554a --> 7c9cda10_8bc1_c40c_6fef_43a016c13ff3 1546e955_88c9_055e_7a67_db109de543dc["tests.unit_tests.callbacks.fake_callback_handler"] 0021bb47_51ab_bafd_26b4_c2849000554a --> 1546e955_88c9_055e_7a67_db109de543dc style 0021bb47_51ab_bafd_26b4_c2849000554a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"""Test pipeline functionality."""
import re
import pytest
from langchain_core.callbacks.manager import (
AsyncCallbackManagerForChainRun,
CallbackManagerForChainRun,
)
from typing_extensions import override
from langchain_classic.chains.base import Chain
from langchain_classic.chains.sequential import SequentialChain, SimpleSequentialChain
from langchain_classic.memory import ConversationBufferMemory
from langchain_classic.memory.simple import SimpleMemory
from tests.unit_tests.callbacks.fake_callback_handler import FakeCallbackHandler
class FakeChain(Chain):
"""Fake Chain for testing purposes."""
input_variables: list[str]
output_variables: list[str]
@property
def input_keys(self) -> list[str]:
"""Input keys this chain returns."""
return self.input_variables
@property
def output_keys(self) -> list[str]:
"""Input keys this chain returns."""
return self.output_variables
@override
def _call(
self,
inputs: dict[str, str],
run_manager: CallbackManagerForChainRun | None = None,
) -> dict[str, str]:
outputs = {}
for var in self.output_variables:
variables = [inputs[k] for k in self.input_variables]
outputs[var] = f"{' '.join(variables)}foo"
return outputs
@override
async def _acall(
self,
inputs: dict[str, str],
run_manager: AsyncCallbackManagerForChainRun | None = None,
) -> dict[str, str]:
outputs = {}
for var in self.output_variables:
variables = [inputs[k] for k in self.input_variables]
outputs[var] = f"{' '.join(variables)}foo"
return outputs
def test_sequential_usage_single_inputs() -> None:
// ... (205 more lines)
Domain
Subdomains
Functions
- test_multi_input_errors()
- test_multi_output_errors()
- test_sequential_bad_outputs()
- test_sequential_internal_chain_use_memory()
- test_sequential_missing_inputs()
- test_sequential_overlapping_inputs()
- test_sequential_usage_memory()
- test_sequential_usage_multiple_inputs()
- test_sequential_usage_multiple_outputs()
- test_sequential_usage_single_inputs()
- test_sequential_valid_outputs()
- test_simple_sequential_functionality()
- test_simple_sequential_functionality_with_callbacks()
Classes
Dependencies
- langchain_classic.chains.base
- langchain_classic.chains.sequential
- langchain_classic.memory
- langchain_classic.memory.simple
- langchain_core.callbacks.manager
- pytest
- re
- tests.unit_tests.callbacks.fake_callback_handler
- typing_extensions
Source
Frequently Asked Questions
What does test_sequential.py do?
test_sequential.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, MessageInterface subdomain.
What functions are defined in test_sequential.py?
test_sequential.py defines 13 function(s): test_multi_input_errors, test_multi_output_errors, test_sequential_bad_outputs, test_sequential_internal_chain_use_memory, test_sequential_missing_inputs, test_sequential_overlapping_inputs, test_sequential_usage_memory, test_sequential_usage_multiple_inputs, test_sequential_usage_multiple_outputs, test_sequential_usage_single_inputs, and 3 more.
What does test_sequential.py depend on?
test_sequential.py imports 9 module(s): langchain_classic.chains.base, langchain_classic.chains.sequential, langchain_classic.memory, langchain_classic.memory.simple, langchain_core.callbacks.manager, pytest, re, tests.unit_tests.callbacks.fake_callback_handler, and 1 more.
Where is test_sequential.py in the architecture?
test_sequential.py is located at libs/langchain/tests/unit_tests/chains/test_sequential.py (domain: LangChainCore, subdomain: MessageInterface, directory: libs/langchain/tests/unit_tests/chains).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free