Home / Function/ _astream() — langchain Function Reference

_astream() — langchain Function Reference

Architecture documentation for the _astream() function in azure.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  1c7bcc9c_dbf9_c448_17ef_0c22ccedf3b7["_astream()"]
  4b940a4c_8618_3ca0_9fa5_c378f5b8f6ac["AzureChatOpenAI"]
  1c7bcc9c_dbf9_c448_17ef_0c22ccedf3b7 -->|defined in| 4b940a4c_8618_3ca0_9fa5_c378f5b8f6ac
  style 1c7bcc9c_dbf9_c448_17ef_0c22ccedf3b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/openai/langchain_openai/chat_models/azure.py lines 822–831

    async def _astream(
        self, *args: Any, **kwargs: Any
    ) -> AsyncIterator[ChatGenerationChunk]:
        """Route to Chat Completions or Responses API."""
        if self._use_responses_api({**kwargs, **self.model_kwargs}):
            async for chunk in super()._astream_responses(*args, **kwargs):
                yield chunk
        else:
            async for chunk in super()._astream(*args, **kwargs):
                yield chunk

Domain

Subdomains

Frequently Asked Questions

What does _astream() do?
_astream() is a function in the langchain codebase, defined in libs/partners/openai/langchain_openai/chat_models/azure.py.
Where is _astream() defined?
_astream() is defined in libs/partners/openai/langchain_openai/chat_models/azure.py at line 822.

Analyze Your Own Codebase

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

Try Supermodel Free