Update app.py
Browse files
app.py
CHANGED
|
@@ -11,6 +11,9 @@ app = FastAPI(
|
|
| 11 |
class InputData(BaseModel):
|
| 12 |
problem: str
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
class OutputData(BaseModel):
|
| 15 |
technologies: list
|
| 16 |
|
|
@@ -18,3 +21,9 @@ class OutputData(BaseModel):
|
|
| 18 |
async def process(data: InputData):
|
| 19 |
result = process_input(data, global_tech, global_tech_embeddings)
|
| 20 |
return {"technologies": result}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
class InputData(BaseModel):
|
| 12 |
problem: str
|
| 13 |
|
| 14 |
+
class InputConstraints(BaseModel):
|
| 15 |
+
data: Dict[str, str]
|
| 16 |
+
|
| 17 |
class OutputData(BaseModel):
|
| 18 |
technologies: list
|
| 19 |
|
|
|
|
| 21 |
async def process(data: InputData):
|
| 22 |
result = process_input(data, global_tech, global_tech_embeddings)
|
| 23 |
return {"technologies": result}
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
@app.post("/process", response_model=OutputData)
|
| 27 |
+
async def process(constraints: InputConstraints):
|
| 28 |
+
result = process_input(constraints, global_tech, global_tech_embeddings)
|
| 29 |
+
return {"technologies": result}
|