langgoap.MaxCostPolicy#
- class MaxCostPolicy(usd, name='MaxCostPolicy')[source]#
Terminate when
world_state['total_cost_usd']exceedsusd.Users supply the bookkeeping — typically by emitting
total_cost_usdfrom their action’sexecute/aexecutereturn value, or by wiring a LangChainBaseCallbackHandlerthat accumulates per-call cost into the world state.- Parameters:
usd (float)
name (str)
- __init__(usd, name='MaxCostPolicy')#
- Parameters:
usd (float)
name (str)
- Return type:
None
Methods
__init__(usd[, name])should_terminate(state)Attributes
usdname