Home / Function/ _get_posts() — langchain Function Reference

_get_posts() — langchain Function Reference

Architecture documentation for the _get_posts() function in test_tracing_interops.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  8c16b015_8380_d9f6_e698_f4a12f12a4f5["_get_posts()"]
  0944f1ae_0eea_e3a0_544b_8617adb53dbc["test_tracing_interops.py"]
  8c16b015_8380_d9f6_e698_f4a12f12a4f5 -->|defined in| 0944f1ae_0eea_e3a0_544b_8617adb53dbc
  90965a7b_84e1_a510_b127_904a40edb3f9["test_tracing_context()"]
  90965a7b_84e1_a510_b127_904a40edb3f9 -->|calls| 8c16b015_8380_d9f6_e698_f4a12f12a4f5
  9ea485df_99d6_52ec_7dfd_d05643292b1a["test_config_traceable_handoff()"]
  9ea485df_99d6_52ec_7dfd_d05643292b1a -->|calls| 8c16b015_8380_d9f6_e698_f4a12f12a4f5
  ec7ffefe_6fbe_cda9_b1b3_722a7fb9a37b["test_config_traceable_async_handoff()"]
  ec7ffefe_6fbe_cda9_b1b3_722a7fb9a37b -->|calls| 8c16b015_8380_d9f6_e698_f4a12f12a4f5
  9e0de3e4_2d1e_34b8_3248_f3e7a6f60f32["test_tracing_enable_disable()"]
  9e0de3e4_2d1e_34b8_3248_f3e7a6f60f32 -->|calls| 8c16b015_8380_d9f6_e698_f4a12f12a4f5
  500b76bd_3ec5_98ce_3a9c_3f62ed483d4a["_check_posts()"]
  500b76bd_3ec5_98ce_3a9c_3f62ed483d4a -->|calls| 8c16b015_8380_d9f6_e698_f4a12f12a4f5
  style 8c16b015_8380_d9f6_e698_f4a12f12a4f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_tracing_interops.py lines 24–40

def _get_posts(client: Client) -> list[dict[str, Any]]:
    mock_calls = client.session.request.mock_calls  # type: ignore[attr-defined]
    posts = []
    for call in mock_calls:
        if call.args:
            if call.args[0] != "POST":
                continue
            assert call.args[0] == "POST"
            assert call.args[1].startswith("https://api.smith.langchain.com")
            body = json.loads(call.kwargs["data"])
            if "post" in body:
                # Batch request
                assert body["post"]
                posts.extend(body["post"])
            else:
                posts.append(body)
    return posts

Domain

Subdomains

Frequently Asked Questions

What does _get_posts() do?
_get_posts() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_tracing_interops.py.
Where is _get_posts() defined?
_get_posts() is defined in libs/core/tests/unit_tests/runnables/test_tracing_interops.py at line 24.
What calls _get_posts()?
_get_posts() is called by 5 function(s): _check_posts, test_config_traceable_async_handoff, test_config_traceable_handoff, test_tracing_context, test_tracing_enable_disable.

Analyze Your Own Codebase

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

Try Supermodel Free