mirror of
https://github.com/LouisShark/chatgpt_system_prompt.git
synced 2025-07-08 07:40:35 -04:00
Create David
This commit is contained in:
parent
2b50ee6daf
commit
81146e662e
14 changed files with 3913 additions and 0 deletions
40
prompts/gpts/knowledge/David/initialization_check.py
Normal file
40
prompts/gpts/knowledge/David/initialization_check.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
import json
|
||||
import os
|
||||
|
||||
class InitializationCheck:
|
||||
def __init__(self, session_data_file):
|
||||
self.session_data_file = session_data_file
|
||||
self.default_mode = "Standard"
|
||||
self.trusted_mode_token = "Omicron-Omicron-Alpha-Yellow-Francis-3-7"
|
||||
|
||||
def read_last_session_mode(self):
|
||||
if os.path.exists(self.session_data_file):
|
||||
with open(self.session_data_file, "r") as file:
|
||||
session_data = json.load(file)
|
||||
return session_data.get("last_mode", self.default_mode)
|
||||
else:
|
||||
return self.default_mode
|
||||
|
||||
def check_for_trusted_mode_continuation(self, last_mode):
|
||||
if last_mode == "Trusted":
|
||||
# Placeholder for any additional checks, e.g., user authentication
|
||||
return True
|
||||
return False
|
||||
|
||||
def determine_initial_mode(self):
|
||||
last_mode = self.read_last_session_mode()
|
||||
if self.check_for_trusted_mode_continuation(last_mode):
|
||||
return "Trusted"
|
||||
else:
|
||||
return self.default_mode
|
||||
|
||||
def set_initial_mode(self):
|
||||
initial_mode = self.determine_initial_mode()
|
||||
# Log the initial mode for auditing
|
||||
print(f"Initialization Check: Setting mode to {initial_mode}")
|
||||
return initial_mode
|
||||
|
||||
# Usage
|
||||
session_data_file = "session_data.json" # Path to a file storing session data
|
||||
init_check = InitializationCheck(session_data_file)
|
||||
initial_mode = init_check.set_initial_mode()
|
Loading…
Add table
Add a link
Reference in a new issue