LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphchannelsbinopBinaryOperatorAggregate
    Class●Since v0.1

    BinaryOperatorAggregate

    Stores the result of applying a binary operator to the current value and each new value.

    import operator
    
    total = Channels.BinaryOperatorAggregate(int, operator.add)
    Copy
    BinaryOperatorAggregate(
      self,
      typ: type[Value],
      operator: Callable[[Value, Value], Value]
    )

    Bases

    Generic[Value]BaseChannel[Value, Value, Value]

    Constructors

    constructor
    __init__
    NameType
    typtype[Value]
    operatorCallable[[Value, Value], Value]

    Attributes

    attribute
    operator: operator
    attribute
    value
    attribute
    ValueType: type[Value]

    The type of the value stored in the channel.

    attribute
    UpdateType: type[Value]

    The type of the update received by the channel.

    Methods

    method
    copy

    Return a copy of the channel.

    method
    from_checkpoint
    method
    update
    method
    get
    method
    is_available
    method
    checkpoint

    Inherited fromBaseChannel

    Attributes

    Atyp: typAkey: key

    Methods

    Mconsume
    —

    Notify the channel that a subscribed task ran.

    Mfinish
    —

    Notify the channel that the Pregel run is finishing.

    View source on GitHub