-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
2917120
commit e4fa49d
Showing
12 changed files
with
25 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.env | ||
**/__pycache__/ |
Binary file not shown.
Binary file not shown.
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
|
@@ -6,12 +6,11 @@ | |
from fastapi.responses import FileResponse | ||
|
||
from document_maker.document_maker import DocumentMaker | ||
path_of_template = "../document_maker/legal_notice_template.docx" | ||
path_of_template = "legal_notice_template.docx" | ||
|
||
def get_document_maker(): | ||
return DocumentMaker(path_of_template) | ||
|
||
|
||
app = FastAPI() | ||
|
||
# Allow all origins, methods, and headers. Adjust these settings based on your needs. | ||
|
@@ -32,18 +31,6 @@ def get_document_maker(): | |
async def read_root(): | ||
return {"Hello": "World"} | ||
|
||
# { | ||
# "name_of_company":"amazon", | ||
# "name_of_entity":"Mr. Jeff Bezos", | ||
# "address_of_entity":"6th & 7th Floor, Ambience Corporate Office Tower-II, Ambience Tower, Ambience Island, Sector 24, Gurugram, Haryana 122002", | ||
# "date_of_rec":"16/02/2024", | ||
# "amount_of_rec":"5000", | ||
# "defect_des": "I have taken the cultfit play pass member ship which charged me around 10000 rs for 3 months. In this memebership I was allowed to play in any of their play centers. At the time of memebership I was using their service for sector 23 which have 3 facaliteis of sports (incl. Badminton, Table Tennis and Lawn Tennis) After having there for around 3 weeks they are shutting down this place due to some reason. When I sad them for the refund the remaining amount they said you can use the service that is available in othr centere which is very far from my current residence. They said that the amound is not refundable.", | ||
# "amount_to_get":"5000", | ||
# "contact_of_user":"+91-888-888-xxxx", | ||
# "email_of_user":"[email protected]" | ||
# } | ||
|
||
|
||
#post route for fetching form data | ||
@app.post("/process_json_data") | ||
|
@@ -60,4 +47,12 @@ def process_json_data(json_data: dict = Body(...), document_maker: DocumentMaker | |
document_maker.replace_common("email_of_user",json_data.get("email_of_user")) | ||
|
||
|
||
return FileResponse('./legal_notice.docx', filename='legal_notice.docx') | ||
return FileResponse('./legal_notice_new.docx', filename='legal_notice.docx') | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
1. Check for the supported docx format before running |
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,5 @@ | ||
fastapi | ||
openai | ||
python-dotenv | ||
python-docx | ||
uvicorn[standard] |