Spaces:
Runtime error
Runtime error
File size: 1,132 Bytes
2bf5d9d 2932f05 2bf5d9d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import re
from langchain.prompts import PromptTemplate
from modules.gpt_modules import gpt_call
def debate_bot(prompt, history="", debate_subject="", bot_role=""):
if history=="":
bot_persona = "\n".join([
'You are name is Cicero Bot.',
'You have to debate with User.',
'You have to say about your opinion and evidence.',
'You have to say logically.'
])
few_shot_prompt = "\n".join([
""
])
else:
bot_persona = ""
few_shot_prompt = ""
debate_subject = debate_subject
# ์์ฝํ ๋ด์ฉ์ ์น์ ํ๊ฒ ์ค๋ช
ํด์ฃผ๋
dialog_prompt_template = PromptTemplate(
input_variables=["prompt"],
template="\n".join([
bot_persona, #persona
few_shot_prompt,
"Debate Subject: " + debate_subject,
history,
"User: {prompt}",
"Cicero Bot: "
])
)
# ๋งํฌ ๋ณ๊ฒฝ
dduru_prompt = dialog_prompt_template.format(
prompt=prompt
)
dduru_result = gpt_call(dduru_prompt)
return dduru_result |