prompt engineering.

modified:   research/guarded_ai.py
This commit is contained in:
Russell Ballestrini 2024-07-27 12:22:51 -04:00
parent 6dff9dc6e9
commit 5583e34e51

View file

@ -16,7 +16,7 @@ def categorize_response(question, response, buckets, tokens_for_ai):
messages = [
{
"role": "system",
"content": f"{tokens_for_ai} Categorize the following response into one of the following buckets: {bucket_list}.",
"content": f"{tokens_for_ai} Categorize the following response into one of the following buckets: {bucket_list}. Return ONLY a bucket label.",
},
{
"role": "user",
@ -28,7 +28,7 @@ def categorize_response(question, response, buckets, tokens_for_ai):
completion = client.chat.completions.create(
model="gpt-4o-mini",
messages=messages,
max_tokens=10,
max_tokens=5,
temperature=0,
)
category = (