Spaces:
Sleeping
Sleeping
updated requirements file
Browse files- requirements.txt +6 -31
- utils.py +11 -5
requirements.txt
CHANGED
@@ -1,65 +1,44 @@
|
|
1 |
aiofiles==24.1.0
|
2 |
annotated-types==0.7.0
|
3 |
anyio==4.9.0
|
4 |
-
asttokens==3.0.0
|
5 |
audioop-lts==0.2.1
|
6 |
certifi==2025.4.26
|
7 |
charset-normalizer==3.4.2
|
8 |
click==8.2.1
|
9 |
colorama==0.4.6
|
10 |
-
contourpy==1.3.2
|
11 |
-
cycler==0.12.1
|
12 |
-
decorator==5.2.1
|
13 |
distro==1.9.0
|
14 |
-
dotenv==0.9.9
|
15 |
-
executing==2.2.0
|
16 |
fastapi==0.115.12
|
17 |
ffmpy==0.6.0
|
18 |
filelock==3.18.0
|
19 |
-
fonttools==4.58.2
|
20 |
fsspec==2025.5.1
|
21 |
-
gradio==5.33.
|
22 |
-
gradio-client==1.10.
|
23 |
groovy==0.1.2
|
24 |
h11==0.16.0
|
25 |
httpcore==1.0.9
|
26 |
httpx==0.28.1
|
27 |
-
huggingface-hub==0.32.
|
28 |
idna==3.10
|
29 |
-
ipython==9.3.0
|
30 |
-
ipython-pygments-lexers==1.1.1
|
31 |
-
jedi==0.19.2
|
32 |
jinja2==3.1.6
|
33 |
jiter==0.10.0
|
34 |
-
jsonpickle==4.1.1
|
35 |
-
kiwisolver==1.4.8
|
36 |
markdown-it-py==3.0.0
|
37 |
markupsafe==3.0.2
|
38 |
-
matplotlib==3.10.3
|
39 |
-
matplotlib-inline==0.1.7
|
40 |
mdurl==0.1.2
|
41 |
-
|
42 |
-
|
43 |
-
openai==1.84.0
|
44 |
orjson==3.10.18
|
45 |
packaging==25.0
|
46 |
pandas==2.3.0
|
47 |
-
parso==0.8.4
|
48 |
pillow==11.2.1
|
49 |
-
prompt-toolkit==3.0.51
|
50 |
-
pure-eval==0.2.3
|
51 |
pydantic==2.11.5
|
52 |
pydantic-core==2.33.2
|
53 |
pydub==0.25.1
|
54 |
pygments==2.19.1
|
55 |
-
pyparsing==3.2.3
|
56 |
python-dateutil==2.9.0.post0
|
57 |
-
python-dotenv==1.1.0
|
58 |
python-multipart==0.0.20
|
59 |
pytz==2025.2
|
60 |
-
pyvis==0.3.2
|
61 |
pyyaml==6.0.2
|
62 |
-
requests==2.32.
|
63 |
rich==14.0.0
|
64 |
ruff==0.11.13
|
65 |
safehttpx==0.1.6
|
@@ -67,17 +46,13 @@ semantic-version==2.10.0
|
|
67 |
shellingham==1.5.4
|
68 |
six==1.17.0
|
69 |
sniffio==1.3.1
|
70 |
-
stack-data==0.6.3
|
71 |
starlette==0.46.2
|
72 |
-
temp==2020.7.2
|
73 |
tomlkit==0.13.3
|
74 |
tqdm==4.67.1
|
75 |
-
traitlets==5.14.3
|
76 |
typer==0.16.0
|
77 |
typing-extensions==4.14.0
|
78 |
typing-inspection==0.4.1
|
79 |
tzdata==2025.2
|
80 |
urllib3==2.4.0
|
81 |
uvicorn==0.34.3
|
82 |
-
wcwidth==0.2.13
|
83 |
websockets==15.0.1
|
|
|
1 |
aiofiles==24.1.0
|
2 |
annotated-types==0.7.0
|
3 |
anyio==4.9.0
|
|
|
4 |
audioop-lts==0.2.1
|
5 |
certifi==2025.4.26
|
6 |
charset-normalizer==3.4.2
|
7 |
click==8.2.1
|
8 |
colorama==0.4.6
|
|
|
|
|
|
|
9 |
distro==1.9.0
|
|
|
|
|
10 |
fastapi==0.115.12
|
11 |
ffmpy==0.6.0
|
12 |
filelock==3.18.0
|
|
|
13 |
fsspec==2025.5.1
|
14 |
+
gradio==5.33.1
|
15 |
+
gradio-client==1.10.3
|
16 |
groovy==0.1.2
|
17 |
h11==0.16.0
|
18 |
httpcore==1.0.9
|
19 |
httpx==0.28.1
|
20 |
+
huggingface-hub==0.32.5
|
21 |
idna==3.10
|
|
|
|
|
|
|
22 |
jinja2==3.1.6
|
23 |
jiter==0.10.0
|
|
|
|
|
24 |
markdown-it-py==3.0.0
|
25 |
markupsafe==3.0.2
|
|
|
|
|
26 |
mdurl==0.1.2
|
27 |
+
numpy==2.3.0
|
28 |
+
openai==1.86.0
|
|
|
29 |
orjson==3.10.18
|
30 |
packaging==25.0
|
31 |
pandas==2.3.0
|
|
|
32 |
pillow==11.2.1
|
|
|
|
|
33 |
pydantic==2.11.5
|
34 |
pydantic-core==2.33.2
|
35 |
pydub==0.25.1
|
36 |
pygments==2.19.1
|
|
|
37 |
python-dateutil==2.9.0.post0
|
|
|
38 |
python-multipart==0.0.20
|
39 |
pytz==2025.2
|
|
|
40 |
pyyaml==6.0.2
|
41 |
+
requests==2.32.4
|
42 |
rich==14.0.0
|
43 |
ruff==0.11.13
|
44 |
safehttpx==0.1.6
|
|
|
46 |
shellingham==1.5.4
|
47 |
six==1.17.0
|
48 |
sniffio==1.3.1
|
|
|
49 |
starlette==0.46.2
|
|
|
50 |
tomlkit==0.13.3
|
51 |
tqdm==4.67.1
|
|
|
52 |
typer==0.16.0
|
53 |
typing-extensions==4.14.0
|
54 |
typing-inspection==0.4.1
|
55 |
tzdata==2025.2
|
56 |
urllib3==2.4.0
|
57 |
uvicorn==0.34.3
|
|
|
58 |
websockets==15.0.1
|
utils.py
CHANGED
@@ -22,13 +22,19 @@ _cached_data = {
|
|
22 |
}
|
23 |
# === Connector to Frontend ===
|
24 |
def driver(age: int, background: str, interest: str, feedback: Union[str, None] = None):
|
25 |
-
|
26 |
|
27 |
# Save the response in the cache
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
study_workflow_diagram = get_studyflow_diagram(study_plan_response.study_workflow)
|
33 |
# if feedback:
|
34 |
# feedback_interpretation = interpret_feedback(feedback)
|
|
|
22 |
}
|
23 |
# === Connector to Frontend ===
|
24 |
def driver(age: int, background: str, interest: str, feedback: Union[str, None] = None):
|
25 |
+
status, study_plan_response = get_learning_suggestion(client, age, background, interest, feedback)
|
26 |
|
27 |
# Save the response in the cache
|
28 |
+
if status == "complete":
|
29 |
+
_cached_data["reason"] = study_plan_response.reason
|
30 |
+
_cached_data["expected_outcome"] = study_plan_response.expected_outcome
|
31 |
+
_cached_data["resources"] = study_plan_response.resources
|
32 |
+
elif status == "clarify":
|
33 |
+
# If the model asks for clarification, we return the follow-up question
|
34 |
+
return None, study_plan_response, None
|
35 |
+
else:
|
36 |
+
return None, f"Error: {study_plan_response}", None
|
37 |
+
|
38 |
study_workflow_diagram = get_studyflow_diagram(study_plan_response.study_workflow)
|
39 |
# if feedback:
|
40 |
# feedback_interpretation = interpret_feedback(feedback)
|