langgoap.format_goap_result#
- format_goap_result(result)[source]#
Format a
GoapStateresult dict as a compact human-readable report.This text is what a calling agent receives as a tool result, so it must stay small regardless of world-state size (issue #57): history entries render as one line each (never their state snapshots), failed steps show their error, and world-state values are clipped to
_VALUE_CLIPcharacters with at most_KEY_CAPkeys.- Parameters:
result (dict[str, Any]) – The dict returned by
GoapGraph.invoke/ainvoke(orinvoke_nl/ainvoke_nl), or the JSON-native state of a compiled graph.- Returns:
A multi-line string summarising the outcome, executed actions, and final world state.
- Return type:
str