Home / Function/ _acreate_chat_stream() — langchain Function Reference

_acreate_chat_stream() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  e9825a4f_e9d8_3008_6f5d_48284410cad7["_acreate_chat_stream()"]
  19e4be00_71fb_5390_6768_f6e6158f49b4["ChatOllama"]
  e9825a4f_e9d8_3008_6f5d_48284410cad7 -->|defined in| 19e4be00_71fb_5390_6768_f6e6158f49b4
  99d71779_02a3_5ac1_9f57_f8b40ddef80e["_aiterate_over_stream()"]
  99d71779_02a3_5ac1_9f57_f8b40ddef80e -->|calls| e9825a4f_e9d8_3008_6f5d_48284410cad7
  b4299926_33ce_4715_e8bf_06ff61a39c14["_chat_params()"]
  e9825a4f_e9d8_3008_6f5d_48284410cad7 -->|calls| b4299926_33ce_4715_e8bf_06ff61a39c14
  style e9825a4f_e9d8_3008_6f5d_48284410cad7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/ollama/langchain_ollama/chat_models.py lines 931–943

    async def _acreate_chat_stream(
        self,
        messages: list[BaseMessage],
        stop: list[str] | None = None,
        **kwargs: Any,
    ) -> AsyncIterator[Mapping[str, Any] | str]:
        chat_params = self._chat_params(messages, stop, **kwargs)

        if chat_params["stream"]:
            async for part in await self._async_client.chat(**chat_params):
                yield part
        else:
            yield await self._async_client.chat(**chat_params)

Domain

Subdomains

Frequently Asked Questions

What does _acreate_chat_stream() do?
_acreate_chat_stream() is a function in the langchain codebase, defined in libs/partners/ollama/langchain_ollama/chat_models.py.
Where is _acreate_chat_stream() defined?
_acreate_chat_stream() is defined in libs/partners/ollama/langchain_ollama/chat_models.py at line 931.
What does _acreate_chat_stream() call?
_acreate_chat_stream() calls 1 function(s): _chat_params.
What calls _acreate_chat_stream()?
_acreate_chat_stream() is called by 1 function(s): _aiterate_over_stream.

Analyze Your Own Codebase

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

Try Supermodel Free