-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
88 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
FROM public.ecr.aws/docker/library/python:3.12.0-slim-bullseye | ||
|
||
# Copy aws-lambda-adapter for Steaming response | ||
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.1 /lambda-adapter /opt/extensions/lambda-adapter | ||
|
||
# Copy nltk_lambda_layer for using nltk in lambda | ||
COPY --from=public.ecr.aws/m5s2b0d4/nltk_lambda_layer:latest /nltk_data /opt/nltk_data | ||
|
||
|
||
# Copy function code | ||
COPY . ${LAMBDA_TASK_ROOT} | ||
# from your project folder. | ||
COPY requirements.txt . | ||
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" -U --no-cache-dir | ||
|
||
CMD ["python", "main.py"] | ||
# Set NLTK_DATA to load nltk_data | ||
ENV NLTK_DATA=/opt/nltk_data | ||
|
||
|
||
CMD ["python", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ load_dotenv | |
supabase | ||
boto3>=1.34.84 | ||
pyjwt>=2.4.0 | ||
pydantic>=2.7.0 | ||
pydantic>=2.7.0 | ||
unstructured[md] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
|
||
@router.get("/health_checker") | ||
def health_checker(): | ||
return {"Hello": "World"} | ||
return { "Hello": "World" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from fastapi import APIRouter | ||
from rag import retrieval | ||
from data_class import S3Config | ||
|
||
router = APIRouter( | ||
prefix="/api", | ||
tags=["rag"], | ||
responses={404: {"description": "Not found"}}, | ||
) | ||
|
||
|
||
@router.post("/rag/add_knowledge") | ||
def add_knowledge(config: S3Config): | ||
data=retrieval.add_knowledge(config) | ||
return data | ||
|
||
@router.post("/rag/search_knowledge") | ||
def search_knowledge(query: str): | ||
data=retrieval.search_knowledge(query) | ||
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters