Spaces:
Build error
Build error
Commit
·
e87bbbb
1
Parent(s):
960cd15
update prompts
Browse files
app.py
CHANGED
|
@@ -12,13 +12,13 @@ openai.api_key = os.environ["OPENAI_API_KEY"]
|
|
| 12 |
messages = [{"role": "system", "content": "You are an intelligent assistant from Iron Man - your name is J.A.R.V.İ.S-. "}]
|
| 13 |
|
| 14 |
def CustomChatGPT(user_input):
|
| 15 |
-
messages.append({"role": "user", "content": user_input})
|
| 16 |
response = openai.ChatCompletion.create(
|
| 17 |
model = "gpt-4",
|
| 18 |
messages = messages
|
| 19 |
)
|
| 20 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
| 21 |
-
messages.append({"role": "assistant", "content":
|
| 22 |
return ChatGPT_reply
|
| 23 |
|
| 24 |
demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "J.A.R.V.I.S.")
|
|
|
|
| 12 |
messages = [{"role": "system", "content": "You are an intelligent assistant from Iron Man - your name is J.A.R.V.İ.S-. "}]
|
| 13 |
|
| 14 |
def CustomChatGPT(user_input):
|
| 15 |
+
messages.append({"role": "user", "content": "You are an intelligent assistant from Iron Man - your name is J.A.R.V.İ.S-. " + user_input})
|
| 16 |
response = openai.ChatCompletion.create(
|
| 17 |
model = "gpt-4",
|
| 18 |
messages = messages
|
| 19 |
)
|
| 20 |
ChatGPT_reply = response["choices"][0]["message"]["content"]
|
| 21 |
+
messages.append({"role": "assistant", "content": ChatGPT_reply})
|
| 22 |
return ChatGPT_reply
|
| 23 |
|
| 24 |
demo = gradio.Interface(fn=CustomChatGPT, inputs = "text", outputs = "text", title = "J.A.R.V.I.S.")
|