Skip to content

Commit

Permalink
fix : minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
sepandhaghighi committed Feb 4, 2025
1 parent 4e6843a commit 1511f53
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions memor/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ def from_json(self, json_doc):
self._message = loaded_obj["message"]
responses = []
for response in loaded_obj["responses"]:
response_obj = Response(message="")
response_obj = Response()
response_obj.from_json(response)
responses.append(response_obj)
self._responses = responses
self._role = Role(loaded_obj["role"])
self._template = PresetPromptTemplate.DEFAULT.value
if "template" in loaded_obj:
template_obj = CustomPromptTemplate(content="")
template_obj = CustomPromptTemplate()
template_obj.from_json(loaded_obj["template"])
self._template = template_obj
self._memor_version = loaded_obj["memor_version"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_date():
def test_json():
response1 = Response(message="I am fine.", model="GPT-4", temperature=0.5, role=Role.USER, score=0.8)
response1_json = response1.to_json()
response2 = Response(message="")
response2 = Response()
response2.from_json(response1_json)
assert response1 == response2

Expand Down

0 comments on commit 1511f53

Please sign in to comment.