Home / Function/ test_openai_astream() — langchain Function Reference

test_openai_astream() — langchain Function Reference

Architecture documentation for the test_openai_astream() function in test_azure.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  ae090bb8_8c16_9637_9943_fbee69fc5207["test_openai_astream()"]
  c413d48d_e43d_eae6_47cb_3eea9394c77c["test_azure.py"]
  ae090bb8_8c16_9637_9943_fbee69fc5207 -->|defined in| c413d48d_e43d_eae6_47cb_3eea9394c77c
  style ae090bb8_8c16_9637_9943_fbee69fc5207 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/tests/integration_tests/chat_models/test_azure.py lines 176–184

async def test_openai_astream(llm: AzureChatOpenAI) -> None:
    """Test streaming tokens from OpenAI."""

    full: BaseMessageChunk | None = None
    async for chunk in llm.astream("I'm Pickle Rick"):
        assert isinstance(chunk.content, str)
        full = chunk if full is None else full + chunk
    assert isinstance(full, AIMessageChunk)
    assert full.response_metadata.get("model_name") is not None

Domain

Subdomains

Frequently Asked Questions

What does test_openai_astream() do?
test_openai_astream() is a function in the langchain codebase, defined in libs/partners/openai/tests/integration_tests/chat_models/test_azure.py.
Where is test_openai_astream() defined?
test_openai_astream() is defined in libs/partners/openai/tests/integration_tests/chat_models/test_azure.py at line 176.

Analyze Your Own Codebase

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

Try Supermodel Free