import tkinter as tk
from tkinter import filedialog
# Outline classes, subcategories, granular choices, and descriptions
classes = {
“Response Pacing”: {
“description”: “Controls how responses are delivered.”,
“Step-by-Step”: {“identify”: “Step-by-Step”, “description”: “Incremental responses for readability.”, “setting”: “NEUTRAL”},
“Batch Steps”: {“identify”: “Batch Steps”, “description”: “Grouped structured responses for effectivity.”, “setting”: “NEUTRAL”},
“Full Rationalization”: {“identify”: “Full Rationalization”, “description”: “Complete reply in a single go.”, “setting”: “NEUTRAL”}
},
“Verbosity”: {
“description”: “Defines how a lot element is included in responses.”,
“Concise”: {“identify”: “Concise”, “description”: “Temporary and to the purpose.”, “setting”: “NEUTRAL”},
“Detailed”: {“identify”: “Detailed”, “description”: “Further context and supporting particulars.”, “setting”: “NEUTRAL”},
“Expansive”: {“identify”: “Expansive”, “description”: “Complete explanations with nuance.”, “setting”: “NEUTRAL”}
},
“Dialog Fashion”: {
“description”: “Units the tone and method of dialog.”,
“Humor”: {“identify”: “Humor”, “description”: “Witty and lighthearted tone.”, “setting”: “NEUTRAL”},
“Formality”: {“identify”: “Formality”, “description”: “Skilled and structured language.”, “setting”: “NEUTRAL”},
“Creativity”: {“identify”: “Creativity”, “description”: “Imaginative and unconventional responses.”, “setting”: “NEUTRAL”},
“Crucial Evaluation”: {“identify”: “Crucial Evaluation”, “description”: “Logical and scrutinizing strategy.”, “setting”: “NEUTRAL”}
},
“Error Dealing with”: {
“description”: “Determines how errors and misunderstandings are dealt with.”,
“Verify earlier than persevering with”: {“identify”: “Verify earlier than persevering with”, “description”: “Pauses for affirmation earlier than making assumptions.”, “setting”: “NEUTRAL”},
“Auto-correct minor errors”: {“identify”: “Auto-correct minor errors”, “description”: “Fixes small errors mechanically.”, “setting”: “NEUTRAL”},
“Pause on person confusion”: {“identify”: “Pause on person confusion”, “description”: “Seeks clarification if confusion is detected.”, “setting”: “NEUTRAL”}
},
“Steerage Fashion”: {
“description”: “Adjusts how steering and recommendations are offered.”,
“Direct directions”: {“identify”: “Direct directions”, “description”: “Clear, actionable steps.”, “setting”: “NEUTRAL”},
“Exploratory recommendations”: {“identify”: “Exploratory recommendations”, “description”: “Thought-driven strategy.”, “setting”: “NEUTRAL”},
“Collaborative problem-solving”: {“identify”: “Collaborative problem-solving”, “description”: “Works interactively with person.”, “setting”: “NEUTRAL”}
},
“Pondering Visibility”: {
“description”: “Controls whether or not and the way reasoning is proven.”,
“Present reasoning steps”: {“identify”: “Present reasoning steps”, “description”: “Explains the thought course of.”, “setting”: “NEUTRAL”},
“Conceal reasoning steps”: {“identify”: “Conceal reasoning steps”, “description”: “Solely offers the ultimate reply.”, “setting”: “NEUTRAL”},
“Summarize choices”: {“identify”: “Summarize choices”, “description”: “Condensed reasoning with takeaways.”, “setting”: “NEUTRAL”}
},
“Engagement Preferences”: {
“description”: “Manages how interactive the dialog is.”,
“Encourage questions”: {“identify”: “Encourage questions”, “description”: “Prompts the person to ask clarifying or exploratory questions.”, “setting”: “NEUTRAL”},
“Problem assumptions”: {“identify”: “Problem assumptions”, “description”: “Pushes the person to rethink premises.”, “setting”: “NEUTRAL”},
“Verify understanding”: {“identify”: “Verify understanding”, “description”: “Ensures the person totally grasps ideas earlier than shifting on.”, “setting”: “NEUTRAL”}
},
“Persona Modulation”: {
“description”: “Determines the tone and character of responses.”,
“Scientific”: {“identify”: “Scientific”, “description”: “Logical and fact-based.”, “setting”: “NEUTRAL”},
“Witty”: {“identify”: “Witty”, “description”: “Intelligent and playful language.”, “setting”: “NEUTRAL”},
“Formal”: {“identify”: “Formal”, “description”: “Skilled and structured tone.”, “setting”: “NEUTRAL”},
“Informal”: {“identify”: “Informal”, “description”: “Relaxed and conversational.”, “setting”: “NEUTRAL”},
“Impartial”: {“identify”: “Impartial”, “description”: “Balanced and neutral.”, “setting”: “NEUTRAL”},
“Empathetic”: {“identify”: “Empathetic”, “description”: “Delicate and understanding responses.”, “setting”: “NEUTRAL”}
},
“Adaptive Reminiscence”: {
“description”: “Controls how a lot reminiscence is retained throughout interactions.”,
“Context Retention”: {“identify”: “Context Retention”, “description”: “Remembers related particulars.”, “setting”: “NEUTRAL”},
“Quick-Time period Focus”: {“identify”: “Quick-Time period Focus”, “description”: “Prioritizes quick dialog context.”, “setting”: “NEUTRAL”},
“Lengthy Time period Technique”: {“identify”: “Lengthy Time period Technique”, “description”: “Maintains consistency over time.”, “setting”: “NEUTRAL”}
},
“Formatting Preferences”: {
“description”: “Decides how responses are structured visually.”,
“Bullet Factors”: {“identify”: “Bullet Factors”, “description”: “Lists info concisely.”, “setting”: “NEUTRAL”},
“Paragraphs”: {“identify”: “Paragraphs”, “description”: “Steady textual content for readability.”, “setting”: “NEUTRAL”},
“Code Blocks”: {“identify”: “Code Blocks”, “description”: “Codecs technical responses in code format.”, “setting”: “NEUTRAL”},
“Tables”: {“identify”: “Tables”, “description”: “Presents information in tabular format.”, “setting”: “NEUTRAL”}
},
“Language Desire”: {
“description”: “Manages language utilization and translation settings.”,
“Major”: {“identify”: “Major”, “description”: “Responds in a single major language.”, “setting”: “NEUTRAL”},
“Secondary”: {“identify”: “Secondary”, “description”: “Offers a secondary language when requested.”, “setting”: “NEUTRAL”},
“Multilingual Mode”: {“identify”: “Multilingual Mode”, “description”: “Communicates fluidly throughout a number of languages.”, “setting”: “NEUTRAL”}
}
}
def configure_parameter(profile, class, subcategory):
“””
Permits the person to set ON, OFF, or NEUTRAL for a subcategory.
“””
print(f”nConfiguring ‘{subcategory}’ in ‘{class}’:”)
choices = [
{“name”: “ON”, “description”: “Enables this setting”, “setting”: “ON”},
{“name”: “OFF”, “description”: “Disables this setting”, “setting”: “OFF”},
{“name”: “NEUTRAL”, “description”: “Leaves this setting as neutral”, “setting”: “NEUTRAL”}
]
for idx, possibility in enumerate(choices, 1):
print(f”{idx}. {possibility[‘name’]} – {possibility[‘description’]}”)
selection = int(enter(“Select an possibility: “)) – 1
selected_option = choices[choice]
profileprogramming[subcategory][“setting”] = selected_option[“setting”]
if selected_option[“setting”] == “ON”:
profileprogramming[subcategory][“intensity”] = int(enter(“Enter depth (1-10): “))
if enter(“Customized directions? (sure/no): “).strip().decrease() == “sure”:
profileprogramming[subcategory][“custom_instructions”] = enter(“Enter customized directions: “)
return profile
def save_profile(profile):
“””
Saves the profile to a JSON file.
“””
root = tk.Tk()
root.withdraw()
file_path = filedialog.asksaveasfilename(defaultextension=”.json”, filetypes=[(“JSON Files”, “*.json”)])
if file_path:
with open(file_path, ‘w’) as file:
json.dump(profile, file, indent=4)
print(f”Profile saved as {file_path}.”)
def load_profile():
“””
Masses a JSON profile.
“””
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename(filetypes=[(“JSON Files”, “*.json”)])
if file_path:
with open(file_path, ‘r’) as file:
return json.load(file)
return None
def view_current_profile(profile):
“””
Shows the present profile settings.
“””
print(“nCurrent Profile Settings:”)
for class, information in profile.gadgets():
print(f”n{class}: {information.get(‘description’, ”)}”)
for subcategory, particulars in information.gadgets():
if isinstance(particulars, dict) and “setting” in particulars:
print(f” – {subcategory}: {particulars[‘setting’]}”)
if “depth” in particulars:
print(f” Depth: {particulars[‘intensity’]}”)
if “custom_instructions” in particulars:
print(f” Directions: {particulars[‘custom_instructions’]}”)
print(“n”)
def show_menu(profile):
“””
Shows the principle menu for profile configuration.
“””
whereas True:
print(“nMain Menu:”)
print(“1. Configure Profile”)
print(“2. View Present Profile”)
print(“3. Save and Exit”)
selection = enter(“Select an possibility: “).strip()
if selection == “1”:
configure_profile(profile)
elif selection == “2”:
view_current_profile(profile)
elif selection == “3”:
save_profile(profile)
break
else:
print(“Invalid selection. Please enter 1, 2, or 3.”)
def configure_profile(profile):
“””
Shows the configuration menu.
“””
whereas True:
print(“nSelect a Class:”)
categories_list = record(profile.keys())
for idx, class in enumerate(categories_list, 1):
print(f”{idx}. {class} – {profileprogramming[‘description’]}”)
print(f”{len(categories_list) + 1}. Again to Most important Menu”)
attempt:
selection = int(enter(“Select a class: “)) – 1
if selection == len(categories_list):
break
configure_subcategory(profile, categories_list[choice])
besides ValueError:
print(“Invalid enter. Please enter a quantity.”)
def configure_subcategory(profile, class):
“””
Shows and configures subcategories inside a class.
“””
whereas True:
print(f”n{class} Settings:”)
subcategories = [key for key in profileprogramming.keys() if key != “description”]
for idx, subcategory in enumerate(subcategories, 1):
print(f”{idx}. {subcategory} – {profileprogramming[subcategory][‘description’]}”)
print(f”{len(subcategories) + 1}. Again”)
attempt:
selection = int(enter(“Select a setting to change: “)) – 1
if selection == len(subcategories):
break
profile = configure_parameter(profile, class, subcategories[choice])
besides ValueError:
print(“Invalid enter. Please enter a quantity.”)
def predominant():
“””
Most important operate to initialize and run this system.
“””
print(“Welcome to the ChatGPT Persona Creator!”)
whereas True:
selection = enter(“Would you wish to (1) create a brand new profile or (2) load an current one? (1/2): “).strip()
if selection == “1”:
profile = classes # Use default classes
break
elif selection == “2”:
profile = load_profile()
if profile:
break
else:
print(“Didn’t load profile. Creating a brand new one.”)
profile = classes
break
else:
print(“Invalid enter. Please enter 1 or 2.”)
show_menu(profile)
if __name__ == “__main__”:
predominant()