Home / Function/ test_stream_time() — langchain Function Reference

test_stream_time() — langchain Function Reference

Architecture documentation for the test_stream_time() function in chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  250e63ce_95db_ab0e_a3bd_247bdbb9d7ec["test_stream_time()"]
  971e928f_9c9b_ce7a_b93d_e762f2f5aa54["ChatModelIntegrationTests"]
  250e63ce_95db_ab0e_a3bd_247bdbb9d7ec -->|defined in| 971e928f_9c9b_ce7a_b93d_e762f2f5aa54
  style 250e63ce_95db_ab0e_a3bd_247bdbb9d7ec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/chat_models.py lines 3304–3340

    def test_stream_time(
        self, model: BaseChatModel, benchmark: BenchmarkFixture, vcr: Cassette
    ) -> None:
        """Test that streaming does not introduce undue overhead.

        See `enable_vcr_tests` dropdown `above <ChatModelIntegrationTests>`
        for more information.

        ??? note "Configuration"

            This test can be enabled or disabled using the `enable_vcr_tests`
            property. For example, to disable the test, set this property to `False`:

            ```python
            @property
            def enable_vcr_tests(self) -> bool:
                return False
            ```

            !!! warning
                VCR will by default record authentication headers and other sensitive
                information in cassettes. See `enable_vcr_tests` dropdown
                `above <ChatModelIntegrationTests>` for how to configure what
                information is recorded in cassettes.

        """
        if not self.enable_vcr_tests:
            pytest.skip("VCR not set up.")

        def _run() -> None:
            for _ in model.stream("Write a story about a cat."):
                pass

        if not vcr.responses:
            _run()
        else:
            benchmark(_run)

Domain

Subdomains

Frequently Asked Questions

What does test_stream_time() do?
test_stream_time() is a function in the langchain codebase, defined in libs/standard-tests/langchain_tests/integration_tests/chat_models.py.
Where is test_stream_time() defined?
test_stream_time() is defined in libs/standard-tests/langchain_tests/integration_tests/chat_models.py at line 3304.

Analyze Your Own Codebase

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

Try Supermodel Free