Vitrous commited on
Commit
c6d97b5
·
verified ·
1 Parent(s): a3b42bd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -101,8 +101,9 @@ async def api_home():
101
  @app.post('/start_conversation/')
102
  async def start_conversation(request: Request):
103
  try:
104
- data = await request.json()
105
- prompt = data.get('prompt')
 
106
 
107
  if not prompt:
108
  raise HTTPException(status_code=400, detail="No prompt provided")
 
101
  @app.post('/start_conversation/')
102
  async def start_conversation(request: Request):
103
  try:
104
+ data = await request.body()
105
+ prompt = data.decode('utf-8') # Decode the bytes to text assuming UTF-8 encoding
106
+
107
 
108
  if not prompt:
109
  raise HTTPException(status_code=400, detail="No prompt provided")