Spaces:
Runtime error
Runtime error
File size: 784 Bytes
b03d3b6 69d06c3 b03d3b6 75b2af7 b03d3b6 8118ddb b03d3b6 f08b9d8 9435ff3 8118ddb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
from fastapi import FastAPI
from pydantic import BaseModel
from typing import Dict
from src.core import *
app = FastAPI(
title="Insight Finder",
description="Find relevant technologies from a problem",
)
class InputData(BaseModel):
problem: str
class InputConstraints(BaseModel):
data: Dict[str, str]
class OutputData(BaseModel):
technologies: list
@app.post("/process", response_model=OutputData)
async def process(data: InputData):
result = process_input(data, global_tech, global_tech_embeddings)
return {"technologies": result}
@app.post("/process", response_model=OutputData)
async def process(constraints: InputConstraints):
result = process_input(constraints, global_tech, global_tech_embeddings)
return {"technologies": result}
|