File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change
1
+ import json
2
+ import os
1
3
from flask import Flask , request , jsonify
2
4
from pymongo import MongoClient
3
5
from bson .objectid import ObjectId
4
- from configuration .config import Config
5
6
from modules .upload import upload_parse_resume
6
7
7
8
app = Flask (__name__ )
8
9
9
- app .config .from_object (Config )
10
+ config_path = os .path .join ('configs' , 'config.json' )
11
+ with open (config_path , 'r' ) as file :
12
+ config = json .load (file )
10
13
11
14
# MongoDB
12
- client = MongoClient (app . config ['MONGO_URI' ])
15
+ client = MongoClient (config ['MONGO_URI' ])
13
16
14
17
db = client ['resume_db' ]
15
18
resume_collection = db ['resumes' ]
@@ -20,9 +23,11 @@ def upload_resume():
20
23
user_id = request .form .get ('user_id' )
21
24
if not user_id :
22
25
return jsonify ({"error" : "No user ID provided." }), 400
23
-
26
+ # vector the resume text
24
27
return upload_parse_resume (request , resume_collection )
25
28
29
+ # def evaluation():
30
+
26
31
27
32
if __name__ == '__main__' :
28
33
app .run (debug = True )
Original file line number Diff line number Diff line change
1
+ {
2
+ "MONGO_URI" : " Your-MongoDB-URI" ,
3
+ "MAX_CONTENT_LENGTH" : 16777216 ,
4
+ "CHATGPT_API_KEY" : " Your-OpenAI-API-Key"
5
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments