mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
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:
parent
364f8e7b5d
commit
0475d015fe
@ -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")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user