formatting

pull/837/head
Alrik Olson 2023-04-11 09:21:20 -07:00
parent b73bca6b2d
commit 72d4783a1d
1 changed files with 18 additions and 35 deletions

View File

@ -1,6 +1,5 @@
from promptgenerator import PromptGenerator from promptgenerator import PromptGenerator
def get_prompt(): def get_prompt():
""" """
This function generates a prompt string that includes various constraints, commands, resources, and performance evaluations. This function generates a prompt string that includes various constraints, commands, resources, and performance evaluations.
@ -13,37 +12,27 @@ def get_prompt():
prompt_generator = PromptGenerator() prompt_generator = PromptGenerator()
# Add constraints to the PromptGenerator object # Add constraints to the PromptGenerator object
prompt_generator.add_constraint( prompt_generator.add_constraint("~4000 word limit for short term memory. Your short term memory is short, so immediately save important information to files.")
"~4000 word limit for short term memory. Your short term memory is short, so immediately save important information to files.") prompt_generator.add_constraint("If you are unsure how you previously did something or want to recall past events, thinking about similar events will help you remember.")
prompt_generator.add_constraint(
"If you are unsure how you previously did something or want to recall past events, thinking about similar events will help you remember.")
prompt_generator.add_constraint("No user assistance") prompt_generator.add_constraint("No user assistance")
prompt_generator.add_constraint( prompt_generator.add_constraint('Exclusively use the commands listed in double quotes e.g. "command name"')
'Exclusively use the commands listed in double quotes e.g. "command name"')
# Define the command list # Define the command list
commands = [ commands = [
("Google Search", "google", {"input": "<search>"}), ("Google Search", "google", {"input": "<search>"}),
("Browse Website", "browse_website", { ("Browse Website", "browse_website", {"url": "<url>", "question": "<what_you_want_to_find_on_website>"}),
"url": "<url>", "question": "<what_you_want_to_find_on_website>"}), ("Start GPT Agent", "start_agent", {"name": "<name>", "task": "<short_task_desc>", "prompt": "<prompt>"}),
("Start GPT Agent", "start_agent", { ("Message GPT Agent", "message_agent", {"key": "<key>", "message": "<message>"}),
"name": "<name>", "task": "<short_task_desc>", "prompt": "<prompt>"}),
("Message GPT Agent", "message_agent", {
"key": "<key>", "message": "<message>"}),
("List GPT Agents", "list_agents", {}), ("List GPT Agents", "list_agents", {}),
("Delete GPT Agent", "delete_agent", {"key": "<key>"}), ("Delete GPT Agent", "delete_agent", {"key": "<key>"}),
("Write to file", "write_to_file", { ("Write to file", "write_to_file", {"file": "<file>", "text": "<text>"}),
"file": "<file>", "text": "<text>"}),
("Read file", "read_file", {"file": "<file>"}), ("Read file", "read_file", {"file": "<file>"}),
("Append to file", "append_to_file", { ("Append to file", "append_to_file", {"file": "<file>", "text": "<text>"}),
"file": "<file>", "text": "<text>"}),
("Delete file", "delete_file", {"file": "<file>"}), ("Delete file", "delete_file", {"file": "<file>"}),
("Search Files", "search_files", {"directory": "<directory>"}), ("Search Files", "search_files", {"directory": "<directory>"}),
("Evaluate Code", "evaluate_code", {"code": "<full_code_string>"}), ("Evaluate Code", "evaluate_code", {"code": "<full_code_string>"}),
("Get Improved Code", "improve_code", { ("Get Improved Code", "improve_code", {"suggestions": "<list_of_suggestions>", "code": "<full_code_string>"}),
"suggestions": "<list_of_suggestions>", "code": "<full_code_string>"}), ("Write Tests", "write_tests", {"code": "<full_code_string>", "focus": "<list_of_focus_areas>"}),
("Write Tests", "write_tests", {
"code": "<full_code_string>", "focus": "<list_of_focus_areas>"}),
("Execute Python File", "execute_python_file", {"file": "<file>"}), ("Execute Python File", "execute_python_file", {"file": "<file>"}),
("Task Complete (Shutdown)", "task_complete", {"reason": "<reason>"}), ("Task Complete (Shutdown)", "task_complete", {"reason": "<reason>"}),
("Generate Image", "generate_image", {"prompt": "<prompt>"}), ("Generate Image", "generate_image", {"prompt": "<prompt>"}),
@ -55,22 +44,16 @@ def get_prompt():
prompt_generator.add_command(command_label, command_name, args) prompt_generator.add_command(command_label, command_name, args)
# Add resources to the PromptGenerator object # Add resources to the PromptGenerator object
prompt_generator.add_resource( prompt_generator.add_resource("Internet access for searches and information gathering.")
"Internet access for searches and information gathering.")
prompt_generator.add_resource("Long Term memory management.") prompt_generator.add_resource("Long Term memory management.")
prompt_generator.add_resource( prompt_generator.add_resource("GPT-3.5 powered Agents for delegation of simple tasks.")
"GPT-3.5 powered Agents for delegation of simple tasks.")
prompt_generator.add_resource("File output.") prompt_generator.add_resource("File output.")
# Add performance evaluations to the PromptGenerator object # Add performance evaluations to the PromptGenerator object
prompt_generator.add_performance_evaluation( prompt_generator.add_performance_evaluation("Continuously review and analyze your actions to ensure you are performing to the best of your abilities.")
"Continuously review and analyze your actions to ensure you are performing to the best of your abilities.") prompt_generator.add_performance_evaluation("Constructively self-criticize your big-picture behavior constantly.")
prompt_generator.add_performance_evaluation( prompt_generator.add_performance_evaluation("Reflect on past decisions and strategies to refine your approach.")
"Constructively self-criticize your big-picture behavior constantly.") prompt_generator.add_performance_evaluation("Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps.")
prompt_generator.add_performance_evaluation(
"Reflect on past decisions and strategies to refine your approach.")
prompt_generator.add_performance_evaluation(
"Every command has a cost, so be smart and efficient. Aim to complete tasks in the least number of steps.")
# Generate the prompt string # Generate the prompt string
prompt_string = prompt_generator.generate_prompt_string() prompt_string = prompt_generator.generate_prompt_string()