Commit ·
eb58818
1
Parent(s): a817a92
added meta data to fastapi
Browse files
app.py
CHANGED
|
@@ -4,7 +4,16 @@ from haystack import Pipeline
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from classes import CourseOutline
|
| 6 |
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
@app.get("/")
|
|
@@ -20,7 +29,7 @@ async def root():
|
|
| 20 |
<p><a href="https://github.com/Zoqi-Andrew-Senior-Project/ScriboAI-Consumer">Github for customer-serving side of the project.</p>
|
| 21 |
<p><a href="https://martinezjandrew-trainingcoursegen.hf.space/docs">Hugging Face Space hosted Docs.</a></p>
|
| 22 |
<p><a href="http://localhost:8000/docs">Local host hosted docs</a></p>
|
| 23 |
-
|
| 24 |
return HTMLResponse(content=content, status_code=200)
|
| 25 |
|
| 26 |
|
|
@@ -29,7 +38,7 @@ class ScriptRequest(BaseModel):
|
|
| 29 |
time: str
|
| 30 |
|
| 31 |
|
| 32 |
-
@app.post("/generate-outline")
|
| 33 |
async def generate_script(req: ScriptRequest):
|
| 34 |
with open("./pipelines/generate_outline.yml", "r") as file:
|
| 35 |
content = file.read()
|
|
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from classes import CourseOutline
|
| 6 |
|
| 7 |
+
tags_metadata = [
|
| 8 |
+
{
|
| 9 |
+
"name": "course generation",
|
| 10 |
+
"description": "Generate and regenerate course content.",
|
| 11 |
+
}
|
| 12 |
+
]
|
| 13 |
+
app = FastAPI(
|
| 14 |
+
title="TrainingCourseGen",
|
| 15 |
+
openapi_tags=tags_metadata,
|
| 16 |
+
)
|
| 17 |
|
| 18 |
|
| 19 |
@app.get("/")
|
|
|
|
| 29 |
<p><a href="https://github.com/Zoqi-Andrew-Senior-Project/ScriboAI-Consumer">Github for customer-serving side of the project.</p>
|
| 30 |
<p><a href="https://martinezjandrew-trainingcoursegen.hf.space/docs">Hugging Face Space hosted Docs.</a></p>
|
| 31 |
<p><a href="http://localhost:8000/docs">Local host hosted docs</a></p>
|
| 32 |
+
"""
|
| 33 |
return HTMLResponse(content=content, status_code=200)
|
| 34 |
|
| 35 |
|
|
|
|
| 38 |
time: str
|
| 39 |
|
| 40 |
|
| 41 |
+
@app.post("/generate-outline", tags=["course generation"])
|
| 42 |
async def generate_script(req: ScriptRequest):
|
| 43 |
with open("./pipelines/generate_outline.yml", "r") as file:
|
| 44 |
content = file.read()
|