From 5583e34e519a682c0ce95d5eeb3c25a062dbbfec Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sat, 27 Jul 2024 12:22:51 -0400 Subject: [PATCH] prompt engineering. modified: research/guarded_ai.py --- research/guarded_ai.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/research/guarded_ai.py b/research/guarded_ai.py index 3499cc9..668f450 100644 --- a/research/guarded_ai.py +++ b/research/guarded_ai.py @@ -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 = (