Skip to content

Commit

Permalink
Xata chat memory FIX (#11145)
Browse files Browse the repository at this point in the history
- **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.
  • Loading branch information
linancn authored Sep 28, 2023
1 parent 7bb6d04 commit 53a9d61
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _create_table_if_not_exists(self) -> None:
{"name": "role", "type": "string"},
{"name": "content", "type": "text"},
{"name": "name", "type": "string"},
{"name": "additionalKwargs", "type": "text"},
{"name": "additionalKwargs", "type": "json"},
]
},
)
Expand Down Expand Up @@ -101,7 +101,7 @@ def messages(self) -> List[BaseMessage]: # type: ignore
"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"]
Expand Down

0 comments on commit 53a9d61

Please sign in to comment.