mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-08 14:05:16 +00:00
Xata chat memory FIX (#11145)
- **Description:** Changed data type from `text` to `json` in xata for improved performance. Also corrected the `additionalKwargs` key in the `messages()` function to `additional_kwargs` to adhere to `BaseMessage` requirements. - **Issue:** The Chathisroty.messages() will return {} of `additional_kwargs`, as the name is wrong for `additionalKwargs` . - **Dependencies:** N/A - **Tag maintainer:** N/A - **Twitter handle:** N/A My PR is passing linting and testing before submitting.
This commit is contained in:
parent
7bb6d04fc7
commit
53a9d6115e
@ -56,7 +56,7 @@ class XataChatMessageHistory(BaseChatMessageHistory):
|
||||
{"name": "role", "type": "string"},
|
||||
{"name": "content", "type": "text"},
|
||||
{"name": "name", "type": "string"},
|
||||
{"name": "additionalKwargs", "type": "text"},
|
||||
{"name": "additionalKwargs", "type": "json"},
|
||||
]
|
||||
},
|
||||
)
|
||||
@ -101,7 +101,7 @@ class XataChatMessageHistory(BaseChatMessageHistory):
|
||||
"content": m["content"],
|
||||
"role": m.get("role"),
|
||||
"name": m.get("name"),
|
||||
"additionalKwargs": json.loads(m["additionalKwargs"]),
|
||||
"additional_kwargs": json.loads(m["additionalKwargs"]),
|
||||
},
|
||||
}
|
||||
for m in r["records"]
|
||||
|
Loading…
Reference in New Issue
Block a user