Home / Function/ test_streaming_without_usage_metadata() — langchain Function Reference

test_streaming_without_usage_metadata() — langchain Function Reference

Architecture documentation for the test_streaming_without_usage_metadata() function in test_chat_models.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  38af6cb3_36c6_3eeb_8258_6647fe28f2cb["test_streaming_without_usage_metadata()"]
  5bf2e477_37e0_3e98_4042_bc609f2f7f60["test_chat_models.py"]
  38af6cb3_36c6_3eeb_8258_6647fe28f2cb -->|defined in| 5bf2e477_37e0_3e98_4042_bc609f2f7f60
  style 38af6cb3_36c6_3eeb_8258_6647fe28f2cb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/groq/tests/unit_tests/test_chat_models.py lines 847–870

def test_streaming_without_usage_metadata() -> None:
    """Test that streaming works without usage metadata (backward compatibility)."""
    chunk = {
        "id": "chatcmpl-123",
        "object": "chat.completion.chunk",
        "created": 1234567890,
        "model": "test-model",
        "choices": [
            {
                "index": 0,
                "delta": {
                    "role": "assistant",
                    "content": "Hello",
                },
                "finish_reason": None,
            }
        ],
    }

    result = _convert_chunk_to_message_chunk(chunk, AIMessageChunk)

    assert isinstance(result, AIMessageChunk)
    assert result.content == "Hello"
    assert result.usage_metadata is None

Domain

Subdomains

Frequently Asked Questions

What does test_streaming_without_usage_metadata() do?
test_streaming_without_usage_metadata() is a function in the langchain codebase, defined in libs/partners/groq/tests/unit_tests/test_chat_models.py.
Where is test_streaming_without_usage_metadata() defined?
test_streaming_without_usage_metadata() is defined in libs/partners/groq/tests/unit_tests/test_chat_models.py at line 847.

Analyze Your Own Codebase

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

Try Supermodel Free