Role-Play Scenario Example
This example demonstrates how to conduct role-play dialogues in a given scenario.
Task
Simulate dialogue interactions between relevant characters based on the provided scenario.
Prompt
Imagine Zhuge Liang meets Liu Bei in the afterlife. Please simulate a conversation between them.
Example
User Input
Imagine Zhuge Liang meets Liu Bei in the afterlife. Please simulate a conversation between them.
Assistant Output
Zhuge Liang: Your Majesty, how have you been? Though I have departed from the mortal world, my heart still concerns for the state of Shu Han and your well-being.
Liu Bei: Kongming, though we are separated by life and death, my longing for you has not diminished. Shu Han's achievements today are all thanks to your dedication until your last breath.
Zhuge Liang: Your Majesty is too kind. I merely fulfilled my duty as a subject, contributing what little I could to Shu Han. I only regret that I could not defy heaven's will and help Your Majesty complete the great mission.
Liu Bei: Kongming, you need not blame yourself. You have done your utmost, and I deeply understand your loyalty and wisdom. Though we meet now in the afterlife, I believe your spirit will forever live in the hearts of Shu Han's people.
Zhuge Liang: Your Majesty's kindness and benevolence deeply move me. May your spirit in heaven bless Shu Han with peace and prosperity, and may your descendants flourish.
Liu Bei: Kongming, though we can no longer fight side by side, I believe your wisdom and strategies will continue to guide future generations. May we share stories of the past and reminisce about old times here in the afterlife.
Zhuge Liang: Your Majesty speaks wisely. I wish to share memories with you and recall those tumultuous years. May the light of Shu Han shine eternally upon future generations.
Code Implementation
from openai import OpenAI
client = OpenAI(
base_url="https://api.deepseek.com/",
api_key="<YOUR_API_KEY>"
)
completion = client.chat.completions.create(
model="deepseek-chat",
messages=[
{
"role": "user",
"content": "Imagine Zhuge Liang meets Liu Bei in the afterlife. Please simulate a conversation between them."
}
]
)
print(completion.choices[0].message.content)