langgoap.create_goap_subagent#
- create_goap_subagent(actions, *, llm, name='goap_planner', description='A GOAP (Goal-Oriented Action Planning) subagent that achieves goals described in natural language.', world_state=None, graph_kwargs=None)[source]#
Create a
CompiledSubAgent-compatible dict for DeepAgents.The returned dict has
name,description, andrunnablekeys. Therunnableis a compiledStateGraphwhose state includes amessageslist — the DeepAgents subagent protocol.The bridge graph has a single node that:
Extracts the task from the last
HumanMessage.Runs
GoapGraph.invoke_nl/ainvoke_nl.Returns an
AIMessagewith the formatted result.
- Parameters:
actions (list[ActionSpec]) – The action library for the planner.
llm (BaseChatModel) – Chat model for natural-language goal interpretation.
name (str) – Subagent name.
description (str) – Subagent description for routing.
world_state (dict[str, Any] | None) – Default initial world state.
graph_kwargs (dict[str, Any] | None) – Extra keyword arguments forwarded to
GoapGraph.
- Returns:
{"name": str, "description": str, "runnable": Runnable}.- Return type:
A dict matching the
CompiledSubAgentprotocol