Skip to content

Commit 0475d01

Browse files
authored
Handle Managed Motorhead Data Key (#6169)
# Handle Managed Motorhead Data Key Managed motorhead will return a payload with a `data` key. we need to handle this to properly access messages from the server.
1 parent 364f8e7 commit 0475d01

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

langchain/memory/motorhead_memory.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ async def init(self) -> None:
4848
headers=self.__get_headers(),
4949
)
5050
res_data = res.json()
51+
res_data = res_data.get("data", res_data) # Handle Managed Version
52+
5153
messages = res_data.get("messages", [])
5254
context = res_data.get("context", "NONE")
5355

0 commit comments

Comments
 (0)