Update app.py

This commit is contained in:
sachith-m 2023-07-27 20:01:10 -04:00 committed by GitHub
parent 44a5802caa
commit d8a3d7050d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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