Skip to content

Commit ce964dd

Browse files
Update score.py
Chat_bot api integration
1 parent 58b2509 commit ce964dd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

backend/score.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from src.main import *
77
import asyncio
88
import base64
9+
from src.QA_integration import *
910

1011

1112
def healthy_condition():
@@ -154,11 +155,20 @@ async def update_similarity_graph(uri=Form(None),
154155

155156
result = await asyncio.to_thread(update_graph,uri,userName,password,database)
156157
return result
158+
159+
@app.post("/chat_bot")
160+
async def chat_bot(uri=Form(None),
161+
userName=Form(None),
162+
password=Form(None),
163+
question=Form(None),
164+
model=Form(None)):
165+
result = await asyncio.to_thread(QA_RAG,uri=uri,userName=userName,password=password,model_version=model,question=question)
166+
return result
157167

158168
def decode_password(pwd):
159169
sample_string_bytes = base64.b64decode(pwd)
160170
decoded_password = sample_string_bytes.decode("utf-8")
161171
return decoded_password
162172

163173
if __name__ == "__main__":
164-
uvicorn.run(app)
174+
uvicorn.run(app)

0 commit comments

Comments
 (0)