Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ from fastapi import FastAPI, Request
|
|
| 4 |
import uvicorn
|
| 5 |
import json
|
| 6 |
|
| 7 |
-
openai.api_key = "
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
conversation_history = []
|
|
@@ -24,7 +24,7 @@ async def chat(request: Request):
|
|
| 24 |
messages.insert(0, {"role": "system", "content": "You are a story writer. What ever the prompt you always write a story"})
|
| 25 |
|
| 26 |
completion = openai.ChatCompletion.create(
|
| 27 |
-
model="gpt-
|
| 28 |
messages=messages
|
| 29 |
)
|
| 30 |
reply = completion.choices[0].message.content
|
|
|
|
| 4 |
import uvicorn
|
| 5 |
import json
|
| 6 |
|
| 7 |
+
openai.api_key = "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"
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
conversation_history = []
|
|
|
|
| 24 |
messages.insert(0, {"role": "system", "content": "You are a story writer. What ever the prompt you always write a story"})
|
| 25 |
|
| 26 |
completion = openai.ChatCompletion.create(
|
| 27 |
+
model="gpt-4",
|
| 28 |
messages=messages
|
| 29 |
)
|
| 30 |
reply = completion.choices[0].message.content
|