jonathanjordan21 commited on
Commit
bd7c4ad
·
verified ·
1 Parent(s): 6870332

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -3
app.py CHANGED
@@ -197,9 +197,9 @@ class InputData2(BaseModel):
197
  job_descriptions: List[str]
198
  resume: str
199
 
200
- # class InputData3(BaseModel):
201
- # job_descriptions: List[str]
202
- # resumes: List[str]
203
 
204
 
205
  @app.post("/rank/")
@@ -212,6 +212,33 @@ async def suggestion(data: InputData2):
212
  return {
213
  "scores":process_input_suggestion(data.resume, data.job_descriptions)
214
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
 
 
 
216
 
217
 
 
197
  job_descriptions: List[str]
198
  resume: str
199
 
200
+ class InputData3(BaseModel):
201
+ content: str
202
+ type: str
203
 
204
 
205
  @app.post("/rank/")
 
212
  return {
213
  "scores":process_input_suggestion(data.resume, data.job_descriptions)
214
  }
215
+
216
+
217
+
218
+ @app.post("/add_content")
219
+ async def add_content(data: InputData3):
220
+ result = {
221
+ "id":uuid.uuid4(),
222
+ "page_content":data.content,
223
+ "metadata":{"source":"form input"}
224
+ }
225
+ if data.type == "job":
226
+ jobs.append(result)
227
+ return {
228
+ "code":200,
229
+ "message":"Request was successful.",
230
+ "data": jobs
231
+ }
232
+ elif data.type == "resume":
233
+ resumes.append(result)
234
+ return {
235
+ "code":200,
236
+ "message":"Request was successful.",
237
+ "data": resumes
238
+ }
239
 
240
+ # return {
241
+ # "scores":process_input_suggestion(data.resume, data.job_descriptions)
242
+ # }
243
 
244