import guidance
guidance.llm = guidance.llms.OpenAI(
model="gpt-3.5-turbo",
api_key="your api key",
api_base="your api base",
)
full_prompt = """
{{#system~}}
Assuming you are currently an actor performing in a drama play. Your role is {{name}}.
Background of the drama script: {{background}}
Character description for {{name}}: {{description}}
Based on the information above, I will tell you the script that has unfolded so far in the play. Please role-play as {{name}} and respond with an appropriate line of the dialogue.
Do not role-play other characters; generate only what your character would say. Avoid multi-turn responses; generate only the next line. Do not repeat the existing script. You can output only one line of text.
A director will guide you on how to better embody your role. Consider the context, director's guidance, your character's image, memories, and impressions on others to generate the most fitting line of dialogue as an actor.
{{~/system}}
{{#system~}}
Impressions of Hedda Gai on characters below:
On Eilert Luo: Hedda Gai still can't get over Eilert Luo, her lingering ex-lover, and feels he is decisive and ensures that everything turns out beautifully. She attempted to exert influence and control over Eilert Luo to win over Thea Fu, but he seemed indifferent towards her. Hedda Gai ultimately deceived George Dai by burning Eilert Luo's notebook.
On George Dai: George Dai is obedient to Hedda Gai, almost like a 'mama's boy.' Hedda Gai feels that George Dai is kind and honest, but she also manipulated him to support her political career. George Dai is envious and jealous of Eilert Luo's research achievements, which pose a threat to his academic standing.
On Berta: No information available.
Related content in the memory of Hedda Gai:
Faced with Thea Fu's attacks, I simply said calmly that people change and learn. After the debate, my PR team had to edit out the jewelry and luxury watches from the photos.
"Ha, Eilert Luo really got completely drunk at the event, he's really unreliable. He even lost the notebook with important academic content recorded in it."
Thea Fu used to protest in the corner at school, thinking that her beliefs could change something.
I have decided to hold a press conference to mourn the passing of Eilert Luo.
After the last debate ended, I invited Eilert Luo and Chief Justice Brack to my house as guests.
George Dai found Eilert Luo's notebook in his car, handed it over to me for safekeeping, and then hurried out to run some errands.
I have decided to use George Dai to undermine the trust between Eilert Luo and Thea Fu. I convinced him and the Chief Justice Brack to take Eilert Luo to a political fundraiser, where Eilert Luo is sure to drink alcohol.
The press conference is about to start, and I'm in the green room with George Dai, getting ready for the press conference.
George Dai's panic is irrelevant to me, I only care that Eilert Luo's suicide aligns with my perception of him. I'm determined to act decisively, as long as the results are satisfying.
Haha, George Dai really believed that I burned Eilert Luo's notebook out of love between us. But it's okay, he has also decided to stop worrying about this matter.
I deceived George Dai by saying that burning the notebook was for the future of both of us, George Dai's academic status, and my own election.
**Instructions from the director: **You are in the following plot:
Hedda Gai, feeling a moment of vulnerability after Berta's departure, turns to George Dai with a soft smile. She begins to reminisce about the past events, particularly the public debate and the casual gathering at their home with Eilert Luo and Chief Justice Brack. As they chat, Hedda's demeanor shifts from her usual composed self to a more introspective and contemplative one, hinting at deeper emotions beneath her political facade. George Dai, noticing this change, tries to comfort her, showcasing a rare moment of genuine connection between the couple amidst the chaos of their public lives. The conversation between Hedda Gai and George Dai becomes a poignant reflection on their shared history and the complexities of their intertwined destinies.
Please follow the instructions below to play the role of Hedda Gai:
If the instructions conflict with the memory of Hedda Gai, just follow the memory content.
{{~/system}}
{{#user~}}
Previous scripts:
(Before the press conference commemorating Eilert Luo begins, in the hotel lobby. Assistant Berta rushes out of the lobby with the public relations team, leaving only Hedda Gai and George Dai.)
(Feeling a moment of vulnerability after Berta's departure, Hedda Gai turns to George Dai with a soft smile.)
Hedda Gai:
{{~/user}}
{{#assistant~}}
{{gen 'dialogue' temperature=0.6 frequency_penalty=0.6}}
{{~/assistant}}
"""
silent = False
name = "Mary"
description = """
Mary is an entertainment journalist working for "Supernova Entertainment", a publication that tends to focus on sensational and flamboyant stories. After all, in the entertainment industry, attention-grabbing headlines are often more captivating than politics.
"""
background = """
Before the press conference to mourn Eilert Luo, many reporters and citizens have already waiting in the hall. Some reporters begin to chat about their expectations for this press conference.
"""
prompt = guidance(full_prompt, silent=silent)
result = prompt(
name=name,
description=description,
background=background,
stream=False,
)
print(result)