Skip to content

Commit

Permalink
fixed syste msg reset
Browse files Browse the repository at this point in the history
  • Loading branch information
kspviswa committed Dec 11, 2024
1 parent e6e05c3 commit 44f5576
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bin/lpw_ollamaClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ def check_system_message(self) -> bool:
return False

def set_system_message(self, system_message:str) -> None:
if self.check_system_message():
self.edit_system_message(system_message)
else:
self.create_system_message(system_message)

def create_system_message(self, system_message:str) -> None:
sMessage = dict({'role' : 'system', 'content' : system_message})
self.messages.append(sMessage)

def edit_system_message(self, system_message:str) -> None:
for m in self.messages:
if m['role'] == 'system':
Expand Down

0 comments on commit 44f5576

Please sign in to comment.