From d8a3d7050d4faf434e5ee2a3dbd72d6efe687b7e Mon Sep 17 00:00:00 2001 From: sachith-m <83933539+sachith-m@users.noreply.github.com> Date: Thu, 27 Jul 2023 20:01:10 -0400 Subject: [PATCH] Update app.py --- flask_testing/app.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) 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