diff --git a/flask_testing/app.py b/flask_testing/app.py index 2d9e821..14a086e 100644 --- a/flask_testing/app.py +++ b/flask_testing/app.py @@ -19,10 +19,24 @@ def index(): result = request.args.get("result") return render_template("index.html", result=result) - - -def generate_prompt(task_form): - base_text = "You are a software manager at the company Alphabet. Q: Format a message that specifically delegates the parts of the following task to your team of engineers." +def generate_prompt(task_form): + base_text = "You are a software engineer at a software development company. Your job is to assign tags to tasks based on the software/tools used. Please generate one-word tags representing software/tools/libraries commonly used by developers to build or complete the following task." + return base_text + "TASK: " + task_form + +def generate_technical_tags(task_form): + prompt = generate_prompt(task_form) + + response = openai.Completion.create( + model="text-davinci-003", + prompt=prompt, + temperature=0, + max_tokens=100, + stop=["TASK:"] + ) + + tags = response.choices[0].text.strip().split("\n") + return tags + return base_text + "TASK: " + task_form