mirror of
https://github.com/kennethreitz/langchain.git
synced 2026-06-05 23:00:18 +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:
@@ -48,6 +48,8 @@ class MotorheadMemory(BaseChatMemory):
|
||||
headers=self.__get_headers(),
|
||||
)
|
||||
res_data = res.json()
|
||||
res_data = res_data.get("data", res_data) # Handle Managed Version
|
||||
|
||||
messages = res_data.get("messages", [])
|
||||
context = res_data.get("context", "NONE")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user