Home / Function/ _compact_in_params() — langchain Function Reference

_compact_in_params() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  aea38cf0_2da9_3eec_9bfd_04f393036557["_compact_in_params()"]
  a85819c7_917d_4c71_2864_a19e68947340["chat_models.py"]
  aea38cf0_2da9_3eec_9bfd_04f393036557 -->|defined in| a85819c7_917d_4c71_2864_a19e68947340
  d6746b81_ab7c_4b02_8921_f885e52e303e["_stream()"]
  d6746b81_ab7c_4b02_8921_f885e52e303e -->|calls| aea38cf0_2da9_3eec_9bfd_04f393036557
  8028f890_4975_51cc_2409_45db9b39971a["_astream()"]
  8028f890_4975_51cc_2409_45db9b39971a -->|calls| aea38cf0_2da9_3eec_9bfd_04f393036557
  style aea38cf0_2da9_3eec_9bfd_04f393036557 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/partners/anthropic/langchain_anthropic/chat_models.py lines 1877–1880

def _compact_in_params(params: dict) -> bool:
    edits = params.get("context_management", {}).get("edits") or []

    return any("compact" in (edit.get("type") or "") for edit in edits)

Domain

Subdomains

Frequently Asked Questions

What does _compact_in_params() do?
_compact_in_params() is a function in the langchain codebase, defined in libs/partners/anthropic/langchain_anthropic/chat_models.py.
Where is _compact_in_params() defined?
_compact_in_params() is defined in libs/partners/anthropic/langchain_anthropic/chat_models.py at line 1877.
What calls _compact_in_params()?
_compact_in_params() is called by 2 function(s): _astream, _stream.

Analyze Your Own Codebase

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

Try Supermodel Free