Spaces:
Sleeping
Sleeping
checking something
Browse files
main.py
CHANGED
|
@@ -48,3 +48,27 @@ async def refine(request: Request, idea: str = Form(...)):
|
|
| 48 |
"request": request,
|
| 49 |
"output_html": html_output
|
| 50 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
"request": request,
|
| 49 |
"output_html": html_output
|
| 50 |
})
|
| 51 |
+
|
| 52 |
+
from fastapi.responses import JSONResponse
|
| 53 |
+
|
| 54 |
+
@app.post("/api/refine")
|
| 55 |
+
async def refine_api(idea: str = Form(...)):
|
| 56 |
+
result = run_refiner(idea)
|
| 57 |
+
|
| 58 |
+
markdown_output = f"""
|
| 59 |
+
## 🧠 Refined Idea
|
| 60 |
+
{result['refined_idea']}
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## 📊 Market Info
|
| 65 |
+
{result['market_info']}
|
| 66 |
+
|
| 67 |
+
---
|
| 68 |
+
|
| 69 |
+
## 📽️ Slide Summary
|
| 70 |
+
{result['slide_summary']}
|
| 71 |
+
"""
|
| 72 |
+
|
| 73 |
+
html_output = markdown(markdown_output)
|
| 74 |
+
return JSONResponse(content={"output_html": html_output})
|