Skip to content

Commit

Permalink
feat: 카카오 로컬 api 메타 데이터 참조하도록 수정, 멀티스레드로 gemini api 병렬 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
KarmaPol committed Jul 31, 2024
1 parent 10102c7 commit cbe330c
Show file tree
Hide file tree
Showing 25 changed files with 97 additions and 61 deletions.

This file was deleted.

Empty file.
Empty file.
Empty file.
Empty file.

This file was deleted.

36 changes: 15 additions & 21 deletions .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
36 changes: 15 additions & 21 deletions .idea/sonarlint/securityhotspotstore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified app/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified app/__pycache__/main.cpython-311.pyc
Binary file not shown.
Binary file modified app/dto/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified app/dto/__pycache__/get_recommendation_request.cpython-311.pyc
Binary file not shown.
Binary file modified app/dto/__pycache__/get_recommendation_response.cpython-311.pyc
Binary file not shown.
7 changes: 6 additions & 1 deletion app/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from typing import Union

import uvicorn
from dotenv import load_dotenv
from fastapi import FastAPI, Query
from mangum import Mangum
Expand All @@ -24,7 +25,7 @@ def get_recommendation(
latitude: Union[str, None] = Query("37.514322572335935"),
theme: Union[str, None] = Query("한식"),
tag: Union[str, None] = Query(None)
) -> Get_recommendation_response:
) -> list[Get_recommendation_response]:
request = Get_recommendation_request(
longitude=longitude,
latitude=latitude,
Expand All @@ -34,10 +35,14 @@ def get_recommendation(
response = get_restaurant_recommendation(request)
return response


@app.on_event("startup")
def startup_event():
import os
app.state.KAKAO_API_KEY = os.getenv("KAKAO_API_KEY")
app.state.GEMINI_API_KEY = os.getenv("GEMINI_API_KEY")

handler = Mangum(app)

if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
Binary file modified app/service/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified app/service/__pycache__/genAI_service.cpython-311.pyc
Binary file not shown.
Binary file modified app/service/__pycache__/restaurant_service.cpython-311.pyc
Binary file not shown.
Loading

0 comments on commit cbe330c

Please sign in to comment.