Rauhan commited on
Commit
681223f
1 Parent(s): 929f9fd

UPDATE: QDRANT

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. functions.py +2 -2
app.py CHANGED
@@ -49,7 +49,7 @@ async def addText(vectorstore: str, text: str):
49
 
50
  @app.post("/answerQuery")
51
  async def answerQuestion(query: str, vectorstore: str, llmModel: str = "llama3-70b-8192"):
52
- return answerQuery(query=str(query), vectorstore=str(vectorstore), llmModel=str(llmModel))
53
 
54
 
55
  @app.post("/deleteChatbot")
 
49
 
50
  @app.post("/answerQuery")
51
  async def answerQuestion(query: str, vectorstore: str, llmModel: str = "llama3-70b-8192"):
52
+ return answerQuery(query=query, vectorstore=vectorstore, llmModel=llmModel)
53
 
54
 
55
  @app.post("/deleteChatbot")
functions.py CHANGED
@@ -141,7 +141,7 @@ def answerQuery(query: str, vectorstore: str, llmModel: str = "llama3-70b-8192")
141
  )
142
  retriever = vectorstore.as_retriever()
143
  chain = (
144
- {"context": retriever | RunnableLambda(format_docs), "question": RunnablePassthrough(query)}
145
  | prompt
146
  | ChatGroq(model = llmModel, temperature = 0.3, max_tokens = 512)
147
  | StrOutputParser()
@@ -168,7 +168,7 @@ def listTables(username: str):
168
  global qdrantClient
169
  qdrantCollections = qdrantClient.get_collections()
170
  return {
171
- "output": [qdrantCollections.collections[x].name for x in qdrantCollections if qdrantCollections.collections[x].name.split("-")[1] == username]
172
  }
173
  except Exception as e:
174
  return {
 
141
  )
142
  retriever = vectorstore.as_retriever()
143
  chain = (
144
+ {"context": retriever | RunnableLambda(format_docs), "question": RunnablePassthrough()}
145
  | prompt
146
  | ChatGroq(model = llmModel, temperature = 0.3, max_tokens = 512)
147
  | StrOutputParser()
 
168
  global qdrantClient
169
  qdrantCollections = qdrantClient.get_collections()
170
  return {
171
+ "output": list(filter(lambda x: True if x.split("-")[1] == username else False, [qdrantCollections.collections[0].name for x in qdrantCollections]))
172
  }
173
  except Exception as e:
174
  return {