From fdcee4834f811d318013b2f070696d97f039a9c1 Mon Sep 17 00:00:00 2001 From: GERA Date: Sun, 29 Sep 2024 23:53:41 +0530 Subject: [PATCH] rounak gera --- README.md | 61 ++--- build_files.sh | 0 db.sqlite3 | Bin 0 -> 131072 bytes manage.py | 22 ++ myapp/__init__.py | 0 myapp/__pycache__/__init__.cpython-312.pyc | Bin 0 -> 157 bytes myapp/__pycache__/admin.cpython-312.pyc | Bin 0 -> 201 bytes myapp/__pycache__/apps.cpython-312.pyc | Bin 0 -> 461 bytes .../__pycache__/helping_utils.cpython-312.pyc | Bin 0 -> 1050 bytes myapp/__pycache__/models.cpython-312.pyc | Bin 0 -> 198 bytes myapp/__pycache__/urls.cpython-312.pyc | Bin 0 -> 563 bytes myapp/__pycache__/views.cpython-312.pyc | Bin 0 -> 9976 bytes myapp/admin.py | 3 + myapp/apps.py | 6 + myapp/helping_utils.py | 43 ++++ myapp/migrations/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 168 bytes myapp/models.py | 3 + myapp/templates/home.html | 142 +++++++++++ myapp/templates/ques.html | 126 ++++++++++ myapp/templates/quiz.html | 145 +++++++++++ myapp/templates/response.html | 154 ++++++++++++ myapp/templates/roadmap.html | 143 +++++++++++ myapp/templates/test.html | 157 ++++++++++++ myapp/tests.py | 3 + myapp/urls.py | 11 + myapp/views.py | 228 ++++++++++++++++++ mysite/__init__.py | 0 mysite/__pycache__/__init__.cpython-312.pyc | Bin 0 -> 158 bytes mysite/__pycache__/settings.cpython-312.pyc | Bin 0 -> 2724 bytes mysite/__pycache__/urls.cpython-312.pyc | Bin 0 -> 1099 bytes mysite/__pycache__/wsgi.cpython-312.pyc | Bin 0 -> 406 bytes mysite/asgi.py | 16 ++ mysite/settings.py | 130 ++++++++++ mysite/urls.py | 24 ++ mysite/wsgi.py | 7 + poetry.lock | 66 +++++ pyproject.toml | 15 ++ requirements.txt | 6 + vercel.json | 12 + 40 files changed, 1495 insertions(+), 28 deletions(-) create mode 100644 build_files.sh create mode 100644 db.sqlite3 create mode 100644 manage.py create mode 100644 myapp/__init__.py create mode 100644 myapp/__pycache__/__init__.cpython-312.pyc create mode 100644 myapp/__pycache__/admin.cpython-312.pyc create mode 100644 myapp/__pycache__/apps.cpython-312.pyc create mode 100644 myapp/__pycache__/helping_utils.cpython-312.pyc create mode 100644 myapp/__pycache__/models.cpython-312.pyc create mode 100644 myapp/__pycache__/urls.cpython-312.pyc create mode 100644 myapp/__pycache__/views.cpython-312.pyc create mode 100644 myapp/admin.py create mode 100644 myapp/apps.py create mode 100644 myapp/helping_utils.py create mode 100644 myapp/migrations/__init__.py create mode 100644 myapp/migrations/__pycache__/__init__.cpython-312.pyc create mode 100644 myapp/models.py create mode 100644 myapp/templates/home.html create mode 100644 myapp/templates/ques.html create mode 100644 myapp/templates/quiz.html create mode 100644 myapp/templates/response.html create mode 100644 myapp/templates/roadmap.html create mode 100644 myapp/templates/test.html create mode 100644 myapp/tests.py create mode 100644 myapp/urls.py create mode 100644 myapp/views.py create mode 100644 mysite/__init__.py create mode 100644 mysite/__pycache__/__init__.cpython-312.pyc create mode 100644 mysite/__pycache__/settings.cpython-312.pyc create mode 100644 mysite/__pycache__/urls.cpython-312.pyc create mode 100644 mysite/__pycache__/wsgi.cpython-312.pyc create mode 100644 mysite/asgi.py create mode 100644 mysite/settings.py create mode 100644 mysite/urls.py create mode 100644 mysite/wsgi.py create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 requirements.txt create mode 100644 vercel.json diff --git a/README.md b/README.md index 407e925..8425082 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,43 @@ -AI Student Hackathon - Project Submission +# LearnallAI : A step toward Customised AI -Welcome to the submission day of our AI Student Hackathon! 🚀 +This is my submission for @buildfastwithai[https://buildfastwithai.com/] hackathon +Provides:- +- Customised explanation +- Roadmap for future growth +- Quiz to test level of knowledge -We’re thrilled to have you participate and can't wait to see your innovative AI apps. Please follow the instructions below to submit your project for evaluation. +## Description +A app to help students learn new concepts according to their level of understanding and also to help student understand notes with the help of AI according to their level of understanding and comprehension. +- Educhain for Quiz generation +- Django for website making +- Gemini API for integration with AI +- Render for deploying -Submission Details +Right now i have not integrated many featuress but will do it shortly like: +-Good formatting +-user authentication +-chat storage system +-postgres database +-also i will make a custom finetuned model for this task -Submit the following information via the provided Google Form for us to access your AI applications: -Team Name: Your team's unique name. +##STEPS TO USE +1. Go to website + ![image](https://github.com/user-attachments/assets/e2b1bd2e-3bf3-42e5-ad25-bc11161a4c87) -App Name: The name of your AI application. +2. Enter the topicyou want to learn like deep learning and SUBMIT + - if you are complete beginner then mark the checkbox + ![image](https://github.com/user-attachments/assets/4febbaba-debb-4f89-9e90-8e588ea4ef61) -App Description: A brief overview of what your app does and its core features. +4. Answer the questions upto your knowledge and click NEXT + ![image](https://github.com/user-attachments/assets/24a77bad-e4fd-4377-906a-ccaafdbfd233) -GitHub PR Link: The link to your Pull Request (PR) in the project repository. +5. Here you have your custom explanation + - SORRY RIGHT NOW THE FORMATTING IS A LITTLE UGLY BUT WILL IMPROVE + ![image](https://github.com/user-attachments/assets/85304bfb-1809-44ee-9ec1-6513a4501c9b) -App Link: A link to the deployed version of your app. +You can use it for explaining documents in a similar way -Loom Video: A demo video link showing your app in action. - - -For detailed submission guidelines, please refer to the last doubt session recording: https://www.buildfastwithai.com/hackathon. - -Important Links: - -Google Form for Submission :- https://forms.gle/JVXGjYhxtdAhTGgm6 - -GitHub Project Submission Link :- https://shorturl.at/zgs3m - -Deadline -⏰ Submission Deadline: Tonight, 11:59 PM. Make sure all components are submitted on time to ensure your project is evaluated. - -Good luck, and we look forward to reviewing your amazing projects! ---- -Hackathon Organizers -Build Fast with AI +Thank you and i welcome any sort of suggestions +and also i thank to build fast with ai for making me do such a thing +VISIT THEIR WEBSITE :- https://buildfastwithai.com/ diff --git a/build_files.sh b/build_files.sh new file mode 100644 index 0000000..e69de29 diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..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z6=w6G!f=n&Wz<|+Q%iBn3T$V&e`w%hIDHOM03#1czcWKiZi6er-qN7jZG~6jDK%5b zBopRC2KVhO&IzM9F3%gT_TBMwpQ}AcL8-slJW_BgE}Ks0 z(y5f$l5~sX{c5P61E*fyjV00ck)1V8`;KmY_l00ck)1VG?1B7pb*$EY$O1q46<1V8`;KmY_l00ck) z1V8`;9uWb&|34zIa0>z;00JNY0w4eaAOHd&00JNY0*?^^y#GH&l>sRr00JNY0w4ea zAOHd&00JNY0wC~+2!zP5UwqFaep~zp@h`m}#sl@w(r6)^)9tYr8MQuoW!*(xTqIJKxaCdfU;CAB!a zB)=dgF+DLePaz{QIXkf=BR?-Dx3W01Bo#;{762td#_APR{^GF7%}*)KNwq8D0Gh-I U#Kj=S2WCb_#(NA3MQlJ00EkXBBLDyZ literal 0 HcmV?d00001 diff --git a/myapp/__pycache__/apps.cpython-312.pyc b/myapp/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..298142cc655746f997498282917642f320f0d641 GIT binary patch literal 461 zcmXv~J4*vW5T3n<#3UyYMX(UG5w5v9hzK#kRHhJYj)P^*?p@B@%X<`OC*%iMi1`iT zPqDEK2Ub>gLSmE3-Mh=c&U~}qH?uqQp=nLv_NuMy7aqSwvN5#=%To^KK!G9;d}Ja7 z5)6S#GoUg@7?-Zo%hK@5Wgab5UuZ|VS~M^Yh|e%Cniz9w<_X-! z_#q=+&2%WUN#>=P@CMi}J1ByCgQfV`y4ydqZW9(K*3HlwuwEZpwJzFI)U1MwG{5S*24rNHp$dusG~~DhG>J=V=g&o01>ta?z@X62-AtUsc`~ ns1)vSv~HYNV_d|$JQbTu#MXXggwPk9thOYy_pJW`4`tOqKn!+W literal 0 HcmV?d00001 diff --git a/myapp/__pycache__/helping_utils.cpython-312.pyc b/myapp/__pycache__/helping_utils.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..213a1b0a83c0128f719f4a7d3dbe903dfd385dfc GIT binary patch literal 1050 zcmah|-)qxQ6uvh}vovY?gH47`VH2lz50m|1Lm7qAIdQ^3od{YPbvJc!Z5on0*41Pb z@u6`8)2DSl^;LZF|L|$sOUP5fr@cs_KFILFd$ZQT7l03OBblnOdN3B6UnF zkIBHnF?|OWW^8!*1ddlib9V@cq+TS&P1*EWL(zRMuWHEWNI2<3mDHNp6o|lZ*G^_K_p;AS#W1r^9%Sbga~+rTY(dH8 z3@ukEq#tIBTRC0Nt|sx*lD`mWrFB!!g#)@GK5K`K{d4=>}1uapo z&U<2{n(@Rq*`zp0r3Bf8a5e3T((bBzV@GX_IK@M8$dh6&bY|V<#z-T#KU#lzAPqN{ z52a))5_6}WN41RCKUkY@MPxVOEY#AiE`If6Y9D#=es{ATby;uls>^xtg!{P8*I`Re zxFgPU7dO&PxPQO??m)iYM2GSi<(zUBYnj%y;pW2USM^)pc#@oQJL$Fn;FoOOL94z*{15Z;}t;hnqhZBLMD*iAc|PPE4U;(-*a;ZNJnb|Zfj8$A+l zRx>RrT3zgr5rL&74CeI(7?((D^povGm@AghMnOp#gCwONfk}VxHVYx_a7h>ouzvw& C*aWNq literal 0 HcmV?d00001 diff --git a/myapp/__pycache__/models.cpython-312.pyc b/myapp/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0a324361b4d02fe2c75c8a030fe43c0911c7af57 GIT binary patch literal 198 zcmX@j%ge<81k-rGq}c%J#~=<2FhLog1%Qm{3@HpLj5!Rsj8Tk?43$ip%r8OGnvA#D za`RJCbBg^mnQn2WWF_XM=j){;6)^)PS2BDCsrhB)Y!wq)oLW>I6XYJ_l3JWyl3x&$ zn4XxKr;w4DoSj&bk)IcnTUnf0k_w~}3kqT&M(Pz*{^GC!vP*MP?TR>nMlk|$F^KVj PnURt49)nB~8;}D4!Id)M literal 0 HcmV?d00001 diff --git a/myapp/__pycache__/urls.cpython-312.pyc b/myapp/__pycache__/urls.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c975ca4bcfed41ce68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F9tXh5iy6@k3oq`il^~aV~%+Kt8|oKoBzwe1IX<6n%!H%yD|g4E?p?p?_+`h(!Cd#j zeD}-Q?w3C$v)xBmT|izs{Q362YE|cK7GIhqB#6zwbV{2F|GMMMu=m&sz3@+h^M$aQoB^fZM0lw`zLi z+m`qBXMOz}D>>gwtG0(a%>!OHIEjq#l<^!!2VOTKyL-cUi-tZsx(j3w3Wkm&-yAob z!sxi+Rg7LWgfLn%#4!pPE@O1ra6%I_p$VEauF{XXcI3N;vRy-&Lra;koDZ*L!z-Dk zBvgKz3?ex_C?Ka~LR7}l@z7DXdMeYkH{Ugw?HbH<4rS_JeBe0vs2==ozw-Ukm#g2K zJ_ZZc*0tHub#L;{AEGx-q>ruE zZF*bMW9bEO@9}>(2}Tp|&c_~P`>k!8ZQFHr?<%l+@Y&?tgBf~IXZPptp96b~dpJW6 zf5#g@W4}iAe)`=c3C=%AqX!UAtpC{6Gu27`7tu4-OZ~RfG_}j}+g{Vukj3Amdbki9 z4aEAv>L$ty30W%m%I(GMApE9DG=d1VArOlN!hCi7lK3RdAoA&?Mx)jd)8 zl?8M;g%0+DMQ#v86g+49Fog%!hlFP1(9W@^^ayz46JdT-WT6P|c|y7X!DEUf$uEfQ zUl2PW{G70UPPo1x4t_!S!OCJEe8;j$xZg3o>;8p%&HEYA{Uz;7oAR_TOZzgN{W*H? fJEm`pyU5;e&XHDf_?wn~a`?$5GD4CgTG#&vv;P>} literal 0 HcmV?d00001 diff --git a/myapp/admin.py b/myapp/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/myapp/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/myapp/apps.py b/myapp/apps.py new file mode 100644 index 0000000..af1106d --- /dev/null +++ b/myapp/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class MyappConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'myapp' diff --git a/myapp/helping_utils.py b/myapp/helping_utils.py new file mode 100644 index 0000000..6cf7b60 --- /dev/null +++ b/myapp/helping_utils.py @@ -0,0 +1,43 @@ + +def text_formatter(txt): + # txt = txt.replace('\n', '
') + temp =txt + new = '' + rep = '

' + find = False + rep2 = '

' + i = 0 + while i < len(temp) - 2: + if temp[i] + temp[i + 1] == '* ': + # Add the current header tag (

or

) + new += rep2 + find = True + # Skip the next character because we've processed both '*' + i += 2 + + if temp[i] == '.' and find: + new += '' + find = False + i += 1 + + elif temp[i] + temp[i + 1] == '**': + # Add the current header tag (

or

) + new += rep + # Alternate between opening and closing tags + rep = '' if rep == '

' else '

' + # Skip the next character because we've processed both '*' + i += 2 + + else: + # Add the current character if it's not part of '**' + new += temp[i] + i += 1 + + # Add the last character if it was skipped by the loop + if i < len(temp): + new += temp[i] + + # temp = new.replace('##', '

') + lst = list(temp.partition('
')) + + return lst \ No newline at end of file diff --git a/myapp/migrations/__init__.py b/myapp/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/myapp/migrations/__pycache__/__init__.cpython-312.pyc b/myapp/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fd097d4da91cfa343d26e30e468110f3f0d2068f GIT binary patch literal 168 zcmX@j%ge<81k-rGq=D$iAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxd + + + + + Home Page + + + + {% if popup %} + + {% endif %} + + + + + + +
+

Enter the topic name :

+ + + + + + +

+ + + + + +
+ + + diff --git a/myapp/templates/ques.html b/myapp/templates/ques.html new file mode 100644 index 0000000..26137f8 --- /dev/null +++ b/myapp/templates/ques.html @@ -0,0 +1,126 @@ + + + + + + Questionnaire Page + + + + + + +
+

Please answer the following questions:

+
+ {% csrf_token %} +
+ {% for num, qus in questions.items %} +
+ + +
+
+ {% endfor %} +
+ + + {% if query %} + + {% endif %} + + {% if file_path %} + + + {% endif %} + +
+
+ + + diff --git a/myapp/templates/quiz.html b/myapp/templates/quiz.html new file mode 100644 index 0000000..67ff1f6 --- /dev/null +++ b/myapp/templates/quiz.html @@ -0,0 +1,145 @@ + + + + + Search Results + + + + + + + + Home + +
+

Quiz

+ +
    + {% for result in results %} +
  • {{result | safe}}
  • + {% empty %} +
  • No results found.
  • + {% endfor %} +
+ + +
+ + + diff --git a/myapp/templates/response.html b/myapp/templates/response.html new file mode 100644 index 0000000..456a769 --- /dev/null +++ b/myapp/templates/response.html @@ -0,0 +1,154 @@ + + + + + Search Results + + + + + + + + Home + +
+ {% if query %} +

Search Results for "{{ query }}"

+ {% else %} +

Search Results

+ {% endif %} + +
    + {% for result in results %} +
  • {{result | safe}}
  • + {% empty %} +
  • No results found.
  • + {% endfor %} +
+ +
+ {% csrf_token %} + + +
+ +
+ + + diff --git a/myapp/templates/roadmap.html b/myapp/templates/roadmap.html new file mode 100644 index 0000000..8605c1d --- /dev/null +++ b/myapp/templates/roadmap.html @@ -0,0 +1,143 @@ + + + + + Search Results + + + + + + + + Home + +
+
    + {% for result in roadmap %} +
  • {{result | safe}}
  • + {% empty %} +
  • No results found.
  • + {% endfor %} +
+ + +
+ + + diff --git a/myapp/templates/test.html b/myapp/templates/test.html new file mode 100644 index 0000000..ff19411 --- /dev/null +++ b/myapp/templates/test.html @@ -0,0 +1,157 @@ + + + + + + Home Page + + + + {% if popup %} + + {% endif %} + + + + + Home + + +
+

Enter the topic name to test knowledge:

+ + + +
+ + + + + +
+ + + diff --git a/myapp/tests.py b/myapp/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/myapp/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/myapp/urls.py b/myapp/urls.py new file mode 100644 index 0000000..7f5cd7e --- /dev/null +++ b/myapp/urls.py @@ -0,0 +1,11 @@ +from django.urls import path +from . import views + +urlpatterns = [ + path('', views.home, name='home'), + path('response/', views.response, name='response'), + path('roadmap/', views.roadmap, name='roadmap'), + path('test/', views.test, name='test'), + + +] diff --git a/myapp/views.py b/myapp/views.py new file mode 100644 index 0000000..12ca1bb --- /dev/null +++ b/myapp/views.py @@ -0,0 +1,228 @@ +from django.shortcuts import render +from django.http import HttpResponse +import google.generativeai as genai +import os +import pathlib +from django.core.files.storage import FileSystemStorage +from .helping_utils import text_formatter + +# response = model.generate_content("Ask 5 question abt deep learning to test my knowledge so you can hekp me accordingly give ques seprated by - nothin else.") + + +API_KEY = 'AIzaSyDhfavnFBGdFw_p-GEsEmYYMZbovlV1WH4' +genai.configure(api_key= API_KEY) + +model = genai.GenerativeModel("gemini-1.5-pro") + +def test(request): + if request.method == 'POST': + query = request.POST.get('search') # Get the search term from the HTML form + uploaded_file = request.FILES.get('file') # i have used get as file upload is optional + + if (not uploaded_file) and (not query): + context = { + 'popup' : True + } + return render(request, 'home.html', context) + + + # complete beginner section + if uploaded_file: + # Get the root directory of the project + root_directory = pathlib.Path(__file__).parents[1] # Root directory of your Django project + + # Save the file in the root directory + filename = uploaded_file.name + file_path = os.path.join(root_directory, filename) + + # Save file using FileSystemStorage + with open(file_path, 'wb+') as destination: + for chunk in uploaded_file.chunks(): + destination.write(chunk) + + query = None + + sample_pdf = genai.upload_file(file_path) #media / file_url) + response = model.generate_content(["read this pdf file and generate a quiz of upto 7-9 mcqs display your output on my html page after each quiz question put a small button clicking which its answer should be shown", sample_pdf]) + + else: + response = model.generate_content(f"generate a quiz of upto 7-9 mcqs on topic {query} respond using html tags so i can display your output on my html page after each quiz question put a small button clicking which its answer should be shown") + + txt = response.text + lst = list(txt.rpartition('```')) + txt = lst[0] + return render(request, 'quiz.html', {'results':[txt]}) + + else: + return render(request,'test.html') + +def roadmap(request): + if request.method == 'POST': + roadmap_text = request.POST.get('roadmap_text') + print(roadmap_text) + roadmap_lst = text_formatter(roadmap_text) + print(roadmap_lst) + + return render(request, 'roadmap.html', {'roadmap' : [''.join(roadmap_lst)]}) + else: + return render(request, 'home.html',{'popup':None}) + +# Create your views here. +def response(request): + if request.method == 'POST': + query = request.POST.get('query') # Get the search term from the HTML form + dictt = request.POST.get('questions') + uploaded_file_path = request.POST.get('file') + + # print(f"DICTIONARY : {type(dictt)}") + dictt = eval(dictt) + questions = dictt.values() + answers = [] + for i in dictt: + answers.append(request.POST.get(f'question{i}')) + + + # print(f"QUESTIONS : {questions}") + # print(f'ANSWERS : {answers}') + # print(f'QUERY : {query}') + + # for i in dictt: + print(f'UPLOADED IN REPONSE : {uploaded_file_path}') + + if uploaded_file_path: + + sample_pdf = genai.upload_file(uploaded_file_path) #media / file_url) + # response = model.generate_content([f"You are a teacher and this is a pdf file that a student is not able to understand , so you asked the student some questions : {questions} and here's how he/she responded : {answers} now just explain the pdf Dont talk anything about how to explain or how student responded.", sample_pdf]) + response = model.generate_content([f"I will provide you with a set of questions, their corresponding answers, and a PDF document related to the topic. Your task is to understand the students knowledge based on their answers, then explain the content of the PDF in a way the student can understand, Questions: {questions} Answers: {answers} respond using html tags so i can display your output on my html page", sample_pdf]) + else: + # response = model.generate_content(f"These are the questions i asked user : {questions} and these are answers givenby user: {answers} now judge the knowledge of user and accordingly explain about {query} this response will be given to user so write accordingly") + response = model.generate_content(f"You are a teacher and These are the questions you asked your student to test their knowledge so you can accordingly explain them about {query} : {questions} and these are answers given by student: {answers} now according to knowledge of your student explain about {query} respond using html tags so i can display your output on my html page") + + roadmap_response = model.generate_content(f"this is the response you gave to me for learning : {response.text}, also generate a roadmap for me and use html tags in your response so i can show the results on my html page") + print(f"ROADMAP : {roadmap_response.text}") + + txt = response.text + # print(txt) + lst = text_formatter(txt) + # lst[1] = '

' + + # You can now process the query (e.g., search in the database) + context = { + 'query': query, + 'results': [' '.join(lst)], # Dummy results for now + 'roadmap_text' : roadmap_response.text + } + return render(request, 'response.html', context) + else: + return render(request, 'home.html',{'popup':None}) + +def home(request): + if request.method == 'POST': + # HANDLING THE SEARCH + query = request.POST.get('search') # Get the search term from the HTML form + beginner = request.POST.get('beginner') + print(f"BEGIN : {beginner}") + uploaded_file = request.FILES.get('file') # i have used get as file upload is optional + + + if (not uploaded_file) and (not query): + context = { + 'popup' : True + } + return render(request, 'home.html', context) + + + if beginner: + # complete beginner section + if uploaded_file: + # Get the root directory of the project + root_directory = pathlib.Path(__file__).parents[1] # Root directory of your Django project + + # Save the file in the root directory + filename = uploaded_file.name + file_path = os.path.join(root_directory, filename) + + # Save file using FileSystemStorage + with open(file_path, 'wb+') as destination: + for chunk in uploaded_file.chunks(): + destination.write(chunk) + + query = None + + sample_pdf = genai.upload_file(file_path) #media / file_url) + response = model.generate_content(["You are a teacher and this is a pdf file that a student is not able to understand as he i a complete beginner so read the pdf and explain him respond using html tags so i can display your output on my html page", sample_pdf]) + + else: + response = model.generate_content(f"You are a teacher and your student is a complete beginner and dont know about {query} now accordingly explain about {query} to your student respond using html tags so i can display your output on my html page") + + roadmap_response = model.generate_content(f"this is the response you gave to me for learning : {response.text}, also generate a roadmap for me and use html tags in your response so i can show the results on my html page") + print(f"ROADMAP : {roadmap_response.text}") + + lst = text_formatter(response.text) + + context = { + 'query': query, + 'results': [' '.join(lst)], # Dummy results for now + 'roadmap_text' : roadmap_response.text, + } + + return render(request, 'response.html', context) + + ## HANDLING THE FILES + # Save file using FileSystemStorage + if uploaded_file: + # Get the root directory of the project + root_directory = pathlib.Path(__file__).parents[1] # Root directory of your Django project + + # Save the file in the root directory + filename = uploaded_file.name + file_path = os.path.join(root_directory, filename) + + # Save file using FileSystemStorage + with open(file_path, 'wb+') as destination: + for chunk in uploaded_file.chunks(): + destination.write(chunk) + + query = None + + print(f'file_path : {file_path}') + # print(f'UPLOADED FILES : {uploaded_file}') + # media = pathlib.Path(__file__).parents[1] / "third_party" + + sample_pdf = genai.upload_file(file_path) #media / file_url) + response = model.generate_content(["You are a teacher and this is a pdf file that a student is not able to understand , read the pdf and ask the student 4 to 5 questions to know if the student have prerequisite knowledge to understand pdf and give ques seprated by <==> and give only ques not any other text and dont give numbering of questions.", sample_pdf]) + # print(f'Final PDf response : {response.text}') + + else: + file_path = None + + response = model.generate_content(f"Ask 5 question abt {query} to test my knowledge so you can help me accordingly give ques seprated by <==> nothin else and don't give numbering of questions.") + + # common preprcoessing for both rfile upload and topic asked + txt = response.text + txt = txt.replace('\n','') + lst = txt.split('<==>') + new_list = [] + for i in lst: + if not (i == '' or i == ' '): + new_list.append(i) + + lst = new_list + d = {} + for num, i in enumerate(lst): + d[num+1] = i + # d.pop(0) + + # You can now process the query (e.g., search in the database) + + + context = { + 'query': query, + 'questions': d, # Dummy results for now + 'file_path' : file_path + } + + + return render(request, 'ques.html', context) + else: + return render(request, 'home.html', {'popup':None}) diff --git a/mysite/__init__.py b/mysite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/mysite/__pycache__/__init__.cpython-312.pyc b/mysite/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..230f7864ccf6aef65dbb50bf9e1db257b89d57e0 GIT binary patch literal 158 zcmX@j%ge<81YW#f(m?cM5P=Rpvj9b=GgLBYGWxA#C}INgK7-W!vURqK2`x@7Dvk+q zk8w#Y&MwI>h)GOO%*<2BNKDR7EXl~vi^;7l&MZlVQStGad6^~g@p=W7zc_4i^HWN5 ZQtgUZfu=D6aWRPTk(rT^v4|PS0ss)SCwu?^ literal 0 HcmV?d00001 diff --git a/mysite/__pycache__/settings.cpython-312.pyc b/mysite/__pycache__/settings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b1b9fef7977ce2f26ae1f268e88e235c5e3c4607 GIT binary patch literal 2724 zcmb7G&u`OK9Jlj3c9MpW(jS0ig!s`y9ZLDpAqI03w?w2#m!z;+9hRH-nmTpt;O9{4 zQ?6(Sb{hu{({2-g$}UtKsC=rn({2GYY2q;LYbS*)MH;i?_v8Efect!`UVe?o848}; z>|Yyy$0_P}cXIHA`h$0uXo~ugLX<=y8u>K3>63gk<)g3<`(FUheHzhTKiIzLPa2+& zK@P}&f+mHKUkamu6sc1v_%kg3Tp)qA}?R8kbVw^C*02Sl@&;DvhE^ z=@=eu@c)k4oi%0;)4=2L7rq`{nm{L{$(@O*lgb5vhRHP)y>4&>Tb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ue@m7-@wZGQ-T|P#G9-PPQD(TlzWrW_zB-jYP@@v zIx^mg@5hdGqWkPfC$bMghu)ll`6n1h+@0xNgVq!EPbd6LJ6{!PJp+bd1CB#rsA)QXTx{2>D*Eo)BA8-{6 zY-MYw{sz>a!q|x{3`}gT3QH%RbBTIFLIMxY^UL%1zVEaBrP*{4jI-v?-gXV4?|M;< zdKp~2hu|1RsEr~cG82QDZPUFZ)2+DqSg`i?Nbl7X`^O2dM2(Y63x_VD8< z!X(8p%eYVh#y!Cq=;@LyE0YtNMg9G|C`^wZMx z0ayNP7RF$p0>`6k>7t8!rIo?NuE}wD+VF~GS-Vu2^3QB{6W;g1z^YSACkot_>pDO5 z#dM9_CJ~EM*UT;LcwR57_h*W{pQC+;jkRr>&`WnVuXnp}ZMxljzGMmlm56r*JU5ij zP0<$?WQ48LmcG)tr7`lkse}HEF5ox1e6SvLwj~v^v-Pa=gvvd*dmYjzaf$~d+yiDj z?Mxm<_0d>fHok1EG9HZ*`bb;{B>mpxDokfJ!!XXx1;hG0dqh|QUCw| literal 0 HcmV?d00001 diff --git a/mysite/__pycache__/wsgi.cpython-312.pyc b/mysite/__pycache__/wsgi.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9fc829ebdc5e3938f3c7de147b2fc9fbe4760c67 GIT binary patch literal 406 zcmX@j%ge<81e5=LPumBiAA>kBzyf7_P69HfGo&!2Fy=5sfoP^2#$2W-CPs!-hAcLi zas-{liD1K6DatC=7?Mg}H^RHoHXsVLS|)+n}0More2AQ3-J##ILVaAT_;V|ZGfPtSic?EUGV{`l zHQ8@5I3~zF#wE2lyClCL24WwK0vWAWQ2C3)CO1E&G$+-rh!3cf z5r~WRfW!x8Mn=Zl44iiv3?DEswR1IcU1t!z$RK(_Oz(n$;}r&{hkQzx`BWOXZ?FkA KG8gdxwEzHAaB6n| literal 0 HcmV?d00001 diff --git a/mysite/asgi.py b/mysite/asgi.py new file mode 100644 index 0000000..cd43f95 --- /dev/null +++ b/mysite/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for mysite project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_asgi_application() diff --git a/mysite/settings.py b/mysite/settings.py new file mode 100644 index 0000000..8052340 --- /dev/null +++ b/mysite/settings.py @@ -0,0 +1,130 @@ +""" +Django settings for mysite project. + +Generated by 'django-admin startproject' using Django 5.1.1. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-ke2^(3o_gxu34#w0rn5(15kh8je%-3sg&s^**%6=uwo%8(9^xd' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = ['.vercel.app', '127.0.0.1','learnallai.onrender.com',' 0.0.0.0 '] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'myapp', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware' +] + +ROOT_URLCONF = 'mysite.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'mysite.wsgi.application' +# WSGI_APPLICATION = 'mysite.wsgi.app' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +# STATIC_URL = 'static/' +# STATIC_URL = '/static/' + +import os +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/mysite/urls.py b/mysite/urls.py new file mode 100644 index 0000000..a2e7835 --- /dev/null +++ b/mysite/urls.py @@ -0,0 +1,24 @@ +""" +URL configuration for mysite project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', include('myapp.urls')), # Include app URLs + +] diff --git a/mysite/wsgi.py b/mysite/wsgi.py new file mode 100644 index 0000000..b647c51 --- /dev/null +++ b/mysite/wsgi.py @@ -0,0 +1,7 @@ +import os +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_wsgi_application() +app = application \ No newline at end of file diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000..d3d3248 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,66 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "asgiref" +version = "3.8.1" +description = "ASGI specs, helper code, and adapters" +optional = false +python-versions = ">=3.8" +files = [ + {file = "asgiref-3.8.1-py3-none-any.whl", hash = "sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47"}, + {file = "asgiref-3.8.1.tar.gz", hash = "sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590"}, +] + +[package.extras] +tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] + +[[package]] +name = "django" +version = "5.1.1" +description = "A high-level Python web framework that encourages rapid development and clean, pragmatic design." +optional = false +python-versions = ">=3.10" +files = [ + {file = "Django-5.1.1-py3-none-any.whl", hash = "sha256:71603f27dac22a6533fb38d83072eea9ddb4017fead6f67f2562a40402d61c3f"}, + {file = "Django-5.1.1.tar.gz", hash = "sha256:021ffb7fdab3d2d388bc8c7c2434eb9c1f6f4d09e6119010bbb1694dda286bc2"}, +] + +[package.dependencies] +asgiref = ">=3.8.1,<4" +sqlparse = ">=0.3.1" +tzdata = {version = "*", markers = "sys_platform == \"win32\""} + +[package.extras] +argon2 = ["argon2-cffi (>=19.1.0)"] +bcrypt = ["bcrypt"] + +[[package]] +name = "sqlparse" +version = "0.5.1" +description = "A non-validating SQL parser." +optional = false +python-versions = ">=3.8" +files = [ + {file = "sqlparse-0.5.1-py3-none-any.whl", hash = "sha256:773dcbf9a5ab44a090f3441e2180efe2560220203dc2f8c0b0fa141e18b505e4"}, + {file = "sqlparse-0.5.1.tar.gz", hash = "sha256:bb6b4df465655ef332548e24f08e205afc81b9ab86cb1c45657a7ff173a3a00e"}, +] + +[package.extras] +dev = ["build", "hatch"] +doc = ["sphinx"] + +[[package]] +name = "tzdata" +version = "2024.2" +description = "Provider of IANA time zone data" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"}, + {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"}, +] + +[metadata] +lock-version = "2.0" +python-versions = "^3.12" +content-hash = "319a0ba62510a6c5bc6f5a861990a2bf9a827331daa8563ce5d8dcf426fefd39" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..47b91a4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "again hackathon" +version = "0.1.0" +description = "" +authors = ["Your Name "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.12" +django = "^5.1.1" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3a7dbf4 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +asgiref==3.8.1 ; +django==5.1.1 ; +sqlparse==0.5.1 ; +tzdata==2024.2 ; +google-generativeai == 0.8.2; +gunicorn==23.0.0 diff --git a/vercel.json b/vercel.json new file mode 100644 index 0000000..7c24a9f --- /dev/null +++ b/vercel.json @@ -0,0 +1,12 @@ + +{ + "builds": [ + { "src": "mysite/wsgi.py", "use": "@vercel/python" }, + { "src": "staticfiles/**/*", "use": "@vercel/static" } + ], + "routes": [ + { "src": "/static/(.*)", "dest": "/staticfiles/$1" }, + { "src": "(.*)", "dest": "mysite/wsgi.py" } + ] + } + \ No newline at end of file