Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AlrikOlson committed Apr 13, 2023
1 parent 94845aa commit 8186ccb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions scripts/prompt.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from promptgenerator import PromptGenerator


def get_prompt():
"""
This function generates a prompt string that includes various constraints, commands, resources, and performance evaluations.
Returns:
str: The generated prompt string.
"""
Expand Down Expand Up @@ -58,5 +59,5 @@ def get_prompt():

# Generate the prompt string
prompt_string = prompt_generator.generate_prompt_string()

return prompt_string
4 changes: 3 additions & 1 deletion tests/promptgenerator_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
sys.path.append(os.path.abspath("../scripts"))
from promptgenerator import PromptGenerator


# Create a test class for the PromptGenerator, subclassed from unittest.TestCase
class promptgenerator_tests(unittest.TestCase):

Expand Down Expand Up @@ -81,7 +82,7 @@ def test_generate_prompt_string(self):
self.assertIn(constraint, prompt_string)
for command in commands:
self.assertIn(command["name"], prompt_string)

# Check for each key-value pair in the command args dictionary
for key, value in command["args"].items():
self.assertIn(f'"{key}": "{value}"', prompt_string)
Expand All @@ -94,6 +95,7 @@ def test_generate_prompt_string(self):
self.assertIn("resources", prompt_string.lower())
self.assertIn("performance evaluation", prompt_string.lower())


# Run the tests when this script is executed
if __name__ == '__main__':
unittest.main()

0 comments on commit 8186ccb

Please sign in to comment.