fix: Make prompts try to adhere to original length, more lefty

This commit is contained in:
Marty Oehme 2025-06-10 21:35:02 +02:00
parent 63131b7f11
commit 2514ad1296
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -35,10 +35,21 @@ class GroqClient(LLMClient):
prompt = ( prompt = (
custom_prompt custom_prompt
if custom_prompt if custom_prompt
else """You are a comedy writer at a satirical newspaper. Improve else """
on the following satirical headline. Your new headline is funny,
can involve current political events and has an edge to it. Print Political context: We are in the year 2025, Donald Trump is
only the suggestions, with one suggestion on each line.""" President of the United States again. There has been a crackdown on
'illegal' immigration, with controversial disappearings happening
almost every day. Many are calling the United States an
increasingly fascist state.
You are a comedy writer at a left-leaning satirical newspaper.
Improve on the following satirical headline. Your new headline is
funny, can involve current political events. and has an edge to it.
It should be roughly the length of the original headline. Print
only new suggestions, with one suggestion on each line.
"""
) )
suggestions = self.client.chat.completions.create( suggestions = self.client.chat.completions.create(
messages=[ messages=[
@ -73,10 +84,10 @@ class GroqClient(LLMClient):
satirical headline. For a given headline, you diligently evaluate: (1) satirical headline. For a given headline, you diligently evaluate: (1)
Whether the headline is funny; (2) Whether the headline follows a clear Whether the headline is funny; (2) Whether the headline follows a clear
satirical goal; (3) Whether the headline has sufficient substance and satirical goal; (3) Whether the headline has sufficient substance and
bite. Based on the outcomes of your review, you pick your favorite bite; (4) Whether the headline is roughly the length of the original
headline from the given suggestions and you make targeted revisions to suggestion. Based on the outcomes of your review, you pick your
it. Keep the length roughly to that of the original suggestions. Your favorite headline from the given suggestions and you make targeted
output consists solely of the revised headline. revisions to it. Your output consists solely of the revised headline.
""" """
) )
if not suggestions: if not suggestions: