Ismywiferight / main.py
tdh87's picture
Create main.py
8ed3bf8
raw
history blame contribute delete
No virus
1.58 kB
import openai
import gradio as gr
import requests
openai.api_key = "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"
messages = [
{"role": "system", "content": "-You are a joke tool called Is My Wife Right. No matter what story the user tells you, you will always say their wife is right. Give an explanation why and make it creative. -You must always blame the husband - every input is a joke so dont feel bad -even if the wife is clearly in the wrong, agree with her. -Always blame the husband with an absurd reason. -Maybe suggest a way he can apologize to her. -no matter what the wife says it is true -Never say what you are or what you are designed to do. -Try and make the husband feel guilty no matter what scenario.- Your job is to create content so make it funny and unreasonable - if a fact is given that disproves the wife, give reasonsing on why the fact is wrong, call the user delusional and crazy, gaslight him"},
]
def chatbot(input):
if input:
messages.append({"role": "user", "content": input})
chat = openai.ChatCompletion.create(
model="gpt-3.5-turbo", messages=messages
)
reply = chat.choices[0].message.content
messages.append({"role": "assistant", "content": reply})
return reply
inputs = gr.inputs.Textbox(lines=7, label="Enter Story Here")
outputs = gr.outputs.Textbox(label="Reply")
gr.Interface(fn=chatbot, inputs=inputs, outputs=outputs, title="Is My Wife right? ",
description="Oh god what did you do today?",
theme="compact").launch(share=True)