Rauhan commited on
Commit
1a55708
1 Parent(s): df509f8

UPDATE: New Endpoints

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -48,7 +48,7 @@ async def addPDFData(vectorstore: str, pdf: UploadFile = File(...)):
48
  currentCount = df[(df["username"] == username) & (df["chatbotname"] == chatbotname)]["charactercount"][0]
49
  newCount = currentCount + len(text)
50
  if newCount < 400000:
51
- client.table("ConversAI_ChatbotInfo").update({"charactercount": newCount}).eq("username", username).eq("chatbotname", chatbotname).execute()
52
  return addDocuments(text = text, vectorstore = vectorstore)
53
  else:
54
  return {
@@ -63,7 +63,7 @@ async def addText(vectorstore: str, text: str):
63
  currentCount = df[(df["username"] == username) & (df["chatbotname"] == chatbotname)]["charactercount"][0]
64
  newCount = currentCount + len(text)
65
  if newCount < 400000:
66
- client.table("ConversAI_ChatbotInfo").update({"charactercount": newCount}).eq("username", username).eq("chatbotname", chatbotname).execute()
67
  return addDocuments(text = text, vectorstore = vectorstore)
68
  else:
69
  return {
@@ -82,7 +82,7 @@ async def addWebsite(vectorstore: str, websiteUrl: str):
82
  currentCount = df[(df["username"] == username) & (df["chatbotname"] == chatbotname)]["charactercount"][0]
83
  newCount = currentCount + len(text)
84
  if newCount < 400000:
85
- client.table("ConversAI_ChatbotInfo").update({"charactercount": newCount}).eq("username", username).eq("chatbotname", chatbotname).execute()
86
  return addDocuments(text = text, vectorstore = vectorstore)
87
  else:
88
  return {
 
48
  currentCount = df[(df["username"] == username) & (df["chatbotname"] == chatbotname)]["charactercount"][0]
49
  newCount = currentCount + len(text)
50
  if newCount < 400000:
51
+ client.table("ConversAI_ChatbotInfo").update({"charactercount": str(newCount)}).eq("username", username).eq("chatbotname", chatbotname).execute()
52
  return addDocuments(text = text, vectorstore = vectorstore)
53
  else:
54
  return {
 
63
  currentCount = df[(df["username"] == username) & (df["chatbotname"] == chatbotname)]["charactercount"][0]
64
  newCount = currentCount + len(text)
65
  if newCount < 400000:
66
+ client.table("ConversAI_ChatbotInfo").update({"charactercount": str(newCount)}).eq("username", username).eq("chatbotname", chatbotname).execute()
67
  return addDocuments(text = text, vectorstore = vectorstore)
68
  else:
69
  return {
 
82
  currentCount = df[(df["username"] == username) & (df["chatbotname"] == chatbotname)]["charactercount"][0]
83
  newCount = currentCount + len(text)
84
  if newCount < 400000:
85
+ client.table("ConversAI_ChatbotInfo").update({"charactercount": str(newCount)}).eq("username", username).eq("chatbotname", chatbotname).execute()
86
  return addDocuments(text = text, vectorstore = vectorstore)
87
  else:
88
  return {