Skip to content

Commit 132912c

Browse files
authored
add metadata for handoff back messages (#113)
1 parent 9662dba commit 132912c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

langgraph_supervisor/handoff.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
WHITESPACE_RE = re.compile(r"\s+")
1212
METADATA_KEY_HANDOFF_DESTINATION = "__handoff_destination"
13+
METADATA_KEY_IS_HANDOFF_BACK = "__is_handoff_back"
1314

1415

1516
def _normalize_agent_name(agent_name: str) -> str:
@@ -117,10 +118,12 @@ def create_handoff_back_messages(
117118
content=f"Transferring back to {supervisor_name}",
118119
tool_calls=tool_calls,
119120
name=agent_name,
121+
response_metadata={METADATA_KEY_IS_HANDOFF_BACK: True},
120122
),
121123
ToolMessage(
122124
content=f"Successfully transferred back to {supervisor_name}",
123125
name=tool_name,
124126
tool_call_id=tool_call_id,
127+
response_metadata={METADATA_KEY_IS_HANDOFF_BACK: True},
125128
),
126129
)

0 commit comments

Comments
 (0)