Spaces:
Runtime error
Runtime error
Merge pull request #24 from beautiful-code/course_lessons_extraction
Browse files- endpoints.py +17 -5
- requirements.txt +13 -12
- workflows/courses/expectation_revision.py +1 -1
endpoints.py
CHANGED
|
@@ -20,6 +20,10 @@ tags_metadata = [
|
|
| 20 |
"name": "til_feedback",
|
| 21 |
"description": "Gives the feedback on user's TIL content",
|
| 22 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
]
|
| 24 |
|
| 25 |
app = FastAPI(
|
|
@@ -54,16 +58,24 @@ async def capture_feedback(run_id: UUID4, feedback: Feedback) -> str:
|
|
| 54 |
TilCrew.post_feedback(run_id=run_id, feedback=feedback)
|
| 55 |
return "ok"
|
| 56 |
|
| 57 |
-
@app.post("course_learn/suggest_expectations", tags=["course_learn"])
|
| 58 |
async def course_learn_suggest_expectations(inputs: SuggestExpectationsInputs) -> Expectations:
|
| 59 |
print("Inputs: ", inputs)
|
| 60 |
-
result = SuggestExpectations().kickoff(inputs=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
return result
|
| 62 |
|
| 63 |
-
@app.post("course_learn/expectation_revision", tags=["course_learn"])
|
| 64 |
-
async def
|
| 65 |
print("Inputs: ", inputs)
|
| 66 |
-
result = ExpectationRevision().kickoff(inputs=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
return result
|
| 68 |
|
| 69 |
@app.get("/healthcheck")
|
|
|
|
| 20 |
"name": "til_feedback",
|
| 21 |
"description": "Gives the feedback on user's TIL content",
|
| 22 |
},
|
| 23 |
+
{
|
| 24 |
+
"name": "course_learn",
|
| 25 |
+
"description": "Workflows for course learn.",
|
| 26 |
+
},
|
| 27 |
]
|
| 28 |
|
| 29 |
app = FastAPI(
|
|
|
|
| 58 |
TilCrew.post_feedback(run_id=run_id, feedback=feedback)
|
| 59 |
return "ok"
|
| 60 |
|
| 61 |
+
@app.post("/course_learn/suggest_expectations", tags=["course_learn"])
|
| 62 |
async def course_learn_suggest_expectations(inputs: SuggestExpectationsInputs) -> Expectations:
|
| 63 |
print("Inputs: ", inputs)
|
| 64 |
+
result = SuggestExpectations().kickoff(inputs={
|
| 65 |
+
"course": inputs.course,
|
| 66 |
+
"module": inputs.module,
|
| 67 |
+
"tasks": inputs.tasks,
|
| 68 |
+
})
|
| 69 |
return result
|
| 70 |
|
| 71 |
+
@app.post("/course_learn/expectation_revision", tags=["course_learn"])
|
| 72 |
+
async def course_learn_expectation_revision(inputs: ExpectationRevisionInputs) -> Expectation:
|
| 73 |
print("Inputs: ", inputs)
|
| 74 |
+
result = ExpectationRevision().kickoff(inputs={
|
| 75 |
+
"expectation": inputs.expectation,
|
| 76 |
+
"check_question": inputs.check_question,
|
| 77 |
+
"request": inputs.request,
|
| 78 |
+
})
|
| 79 |
return result
|
| 80 |
|
| 81 |
@app.get("/healthcheck")
|
requirements.txt
CHANGED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
crewai
|
| 3 |
crewai_tools
|
|
|
|
|
|
|
| 4 |
langchain_community
|
| 5 |
langchain_google_genai
|
| 6 |
langchain_openai
|
| 7 |
-
|
| 8 |
-
tavily-python
|
| 9 |
-
arxiv
|
| 10 |
-
semanticscholar
|
| 11 |
-
streamlit-extras
|
| 12 |
-
fastapi
|
| 13 |
-
uvicorn
|
| 14 |
-
fastapi_cors
|
| 15 |
langsmith
|
| 16 |
-
pytest
|
| 17 |
playwright
|
| 18 |
playwright-stealth
|
| 19 |
-
unstructured
|
| 20 |
-
asyncio
|
| 21 |
psutil
|
| 22 |
pyppeteer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
arxiv
|
| 2 |
+
asyncio
|
| 3 |
crewai
|
| 4 |
crewai_tools
|
| 5 |
+
fastapi
|
| 6 |
+
fastapi_cors
|
| 7 |
langchain_community
|
| 8 |
langchain_google_genai
|
| 9 |
langchain_openai
|
| 10 |
+
langchainhub
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
langsmith
|
|
|
|
| 12 |
playwright
|
| 13 |
playwright-stealth
|
|
|
|
|
|
|
| 14 |
psutil
|
| 15 |
pyppeteer
|
| 16 |
+
pytest
|
| 17 |
+
python-dotenv
|
| 18 |
+
semanticscholar
|
| 19 |
+
streamlit
|
| 20 |
+
streamlit-extras
|
| 21 |
+
tavily-python
|
| 22 |
+
unstructured
|
| 23 |
+
uvicorn
|
workflows/courses/expectation_revision.py
CHANGED
|
@@ -2,7 +2,7 @@ from langchain import hub
|
|
| 2 |
from langchain_core.output_parsers import JsonOutputParser
|
| 3 |
from langchain_openai import ChatOpenAI
|
| 4 |
from pydantic import BaseModel
|
| 5 |
-
from
|
| 6 |
from typing import List, Optional
|
| 7 |
import os
|
| 8 |
|
|
|
|
| 2 |
from langchain_core.output_parsers import JsonOutputParser
|
| 3 |
from langchain_openai import ChatOpenAI
|
| 4 |
from pydantic import BaseModel
|
| 5 |
+
from .suggest_expectations import Expectation
|
| 6 |
from typing import List, Optional
|
| 7 |
import os
|
| 8 |
|