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.
This commit is contained in:
James O'Dwyer 2023-06-16 23:36:18 -04:00 committed by GitHub
parent 364f8e7b5d
commit 0475d015fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,6 +48,8 @@ class MotorheadMemory(BaseChatMemory):
headers=self.__get_headers(), headers=self.__get_headers(),
) )
res_data = res.json() res_data = res.json()
res_data = res_data.get("data", res_data) # Handle Managed Version
messages = res_data.get("messages", []) messages = res_data.get("messages", [])
context = res_data.get("context", "NONE") context = res_data.get("context", "NONE")