Skip to content

Commit

Permalink
feat(api): Started sending recommendations through HTTP API
Browse files Browse the repository at this point in the history
  • Loading branch information
chef-danny-d committed Feb 28, 2023
1 parent 9bc1f71 commit 398b903
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions api.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
from fastapi import FastAPI

from app import getUserProfile
import json
from recommend import Recommender, Recs

app = FastAPI()


@app.get("/recommend/")
async def read_item(userID: str):
# rec = Recommender(target=userID)
# await rec.recommend()
# account = await getUserProfile(userID)

rec = Recs()
res = rec.run()
res = await rec.run()

print(res.json())
cleaned_data = json.loads(res)

return {"user": userID, "data": res}
return {"user": userID, "data": cleaned_data[0:50]}

0 comments on commit 398b903

Please sign in to comment.