Spaces:
Sleeping
Sleeping
UPDATE: trainChatbot
Browse files
app.py
CHANGED
@@ -8,13 +8,17 @@ from jwt import ExpiredSignatureError, InvalidTokenError
|
|
8 |
from starlette import status
|
9 |
from functions import *
|
10 |
import pandas as pd
|
11 |
-
from fastapi import FastAPI, File, UploadFile, HTTPException
|
12 |
from pydantic import BaseModel
|
13 |
from fastapi.middleware.cors import CORSMiddleware
|
14 |
from src.api.speech_api import speech_translator_router
|
15 |
from functions import client as supabase
|
16 |
from urllib.parse import urlparse
|
17 |
import nltk
|
|
|
|
|
|
|
|
|
18 |
|
19 |
|
20 |
nltk.download('punkt_tab')
|
@@ -182,9 +186,7 @@ async def login_with_token(access_token: str, refresh_token: str):
|
|
182 |
|
183 |
|
184 |
@app.post("/user_name")
|
185 |
-
async def user_name_(username: str, user_id: str):
|
186 |
-
user_data = supabase.table("Stores").select("*").filter("StoreID", "eq", user_id).execute()
|
187 |
-
email = user_data.data[0].get("email")
|
188 |
r_ = createUser(user_id=user_id, username=username, email=email)
|
189 |
return r_
|
190 |
|
|
|
8 |
from starlette import status
|
9 |
from functions import *
|
10 |
import pandas as pd
|
11 |
+
from fastapi import FastAPI, File, UploadFile, HTTPException,Request
|
12 |
from pydantic import BaseModel
|
13 |
from fastapi.middleware.cors import CORSMiddleware
|
14 |
from src.api.speech_api import speech_translator_router
|
15 |
from functions import client as supabase
|
16 |
from urllib.parse import urlparse
|
17 |
import nltk
|
18 |
+
from collections import Counter, defaultdict
|
19 |
+
from datetime import datetime, timedelta
|
20 |
+
from dateutil.parser import isoparse
|
21 |
+
|
22 |
|
23 |
|
24 |
nltk.download('punkt_tab')
|
|
|
186 |
|
187 |
|
188 |
@app.post("/user_name")
|
189 |
+
async def user_name_(username: str, user_id: str, email: str):
|
|
|
|
|
190 |
r_ = createUser(user_id=user_id, username=username, email=email)
|
191 |
return r_
|
192 |
|