v1shal's picture
first_commit
b396e94
raw
history blame contribute delete
448 Bytes
from fastapi import FastAPI
from pydantic import BaseModel
from main import analyze_company_news
app = FastAPI()
class CompanyRequest(BaseModel):
Company_Name: str
@app.post("/api/company")
async def handle_company(request: CompanyRequest):
company = request.Company_Name.strip()
result = analyze_company_news(company)
return result
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="127.0.0.1", port=8000)