Home / Function/ send() — langchain Function Reference

send() — langchain Function Reference

Architecture documentation for the send() function in log_stream.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  c5f1fbd2_23b6_75cb_1f29_b9e028c332a0["send()"]
  78fc514f_5439_00c6_7e00_021af9ce4e07["LogStreamCallbackHandler"]
  c5f1fbd2_23b6_75cb_1f29_b9e028c332a0 -->|defined in| 78fc514f_5439_00c6_7e00_021af9ce4e07
  c52d25da_e50c_d411_085c_c87f3733b1c6["tap_output_aiter()"]
  c52d25da_e50c_d411_085c_c87f3733b1c6 -->|calls| c5f1fbd2_23b6_75cb_1f29_b9e028c332a0
  a4facac0_e177_a5c6_18cb_41e1fabc5bc2["tap_output_iter()"]
  a4facac0_e177_a5c6_18cb_41e1fabc5bc2 -->|calls| c5f1fbd2_23b6_75cb_1f29_b9e028c332a0
  79906bae_a315_8c6a_0f74_2bca8c58615c["_on_run_create()"]
  79906bae_a315_8c6a_0f74_2bca8c58615c -->|calls| c5f1fbd2_23b6_75cb_1f29_b9e028c332a0
  dd086141_42ce_3053_f911_051099488c1c["_on_run_update()"]
  dd086141_42ce_3053_f911_051099488c1c -->|calls| c5f1fbd2_23b6_75cb_1f29_b9e028c332a0
  8261c1a6_4dc8_1ce7_5560_5ac4b395ac72["_on_llm_new_token()"]
  8261c1a6_4dc8_1ce7_5560_5ac4b395ac72 -->|calls| c5f1fbd2_23b6_75cb_1f29_b9e028c332a0
  e846502e_046c_1717_efc8_1ac8be32e519["_astream_log_implementation()"]
  e846502e_046c_1717_efc8_1ac8be32e519 -->|calls| c5f1fbd2_23b6_75cb_1f29_b9e028c332a0
  style c5f1fbd2_23b6_75cb_1f29_b9e028c332a0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tracers/log_stream.py lines 309–323

    def send(self, *ops: dict[str, Any]) -> bool:
        """Send a patch to the stream, return `False` if the stream is closed.

        Args:
            *ops: The operations to send to the stream.

        Returns:
            `True` if the patch was sent successfully, `False` if the stream is closed.
        """
        # We will likely want to wrap this in try / except at some point
        # to handle exceptions that might arise at run time.
        # For now we'll let the exception bubble up, and always return
        # True on the happy path.
        self.send_stream.send_nowait(RunLogPatch(*ops))
        return True

Domain

Subdomains

Frequently Asked Questions

What does send() do?
send() is a function in the langchain codebase, defined in libs/core/langchain_core/tracers/log_stream.py.
Where is send() defined?
send() is defined in libs/core/langchain_core/tracers/log_stream.py at line 309.
What calls send()?
send() is called by 6 function(s): _astream_log_implementation, _on_llm_new_token, _on_run_create, _on_run_update, tap_output_aiter, tap_output_iter.

Analyze Your Own Codebase

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

Try Supermodel Free