Skip to content

Commit c5febf5

Browse files
authored
load conversation from json (openai format)
1 parent 3d11805 commit c5febf5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llm_dialog_manager/agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,9 @@ def save_conversation(self):
264264
with open(filename, 'w', encoding='utf-8') as file:
265265
json.dump(self.history.messages, file, ensure_ascii=False, indent=4)
266266

267-
def load_conversation(self):
268-
filename = f"{self.id}.json"
267+
def load_conversation(self, filename=None):
268+
if filename is None:
269+
filename = f"{self.id}.json"
269270
with open(filename, 'r', encoding='utf-8') as file:
270271
messages = json.load(file)
271272
self.history = ChatHistory(messages)

0 commit comments

Comments
 (0)