Spaces:
Sleeping
Sleeping
added a new data type
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ import fitz
|
|
| 11 |
from scraper import scrapeCourse
|
| 12 |
import asyncio
|
| 13 |
from google import genai
|
| 14 |
-
from typing import Optional
|
| 15 |
from pydantic import BaseModel
|
| 16 |
load_dotenv()
|
| 17 |
|
|
@@ -37,6 +37,14 @@ class Token(BaseModel):
|
|
| 37 |
refreshToken:str
|
| 38 |
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
class UserCourse(BaseModel):
|
| 41 |
employmentStatus:str
|
| 42 |
interimRole:bool
|
|
@@ -46,6 +54,8 @@ class UserCourse(BaseModel):
|
|
| 46 |
timeCommitmentPerDay:str
|
| 47 |
challenges:list
|
| 48 |
timeframeToAchieveDreamRole:str
|
|
|
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
class CourseRecommendation(BaseModel):
|
|
@@ -119,6 +129,8 @@ def get_course_func(query):
|
|
| 119 |
title = item.get('title')
|
| 120 |
link = item.get('link')
|
| 121 |
snippet = item.get('snippet')
|
|
|
|
|
|
|
| 122 |
content_structure={}
|
| 123 |
content_structure["courseTitle"]=title
|
| 124 |
content_structure["courseLink"]=link
|
|
|
|
| 11 |
from scraper import scrapeCourse
|
| 12 |
import asyncio
|
| 13 |
from google import genai
|
| 14 |
+
from typing import Optional,List
|
| 15 |
from pydantic import BaseModel
|
| 16 |
load_dotenv()
|
| 17 |
|
|
|
|
| 37 |
refreshToken:str
|
| 38 |
|
| 39 |
|
| 40 |
+
class RecommendCourse(BaseModel):
|
| 41 |
+
courseTitle:str
|
| 42 |
+
duration:str
|
| 43 |
+
courseLevel:str
|
| 44 |
+
interimRoleBenefit:str
|
| 45 |
+
dreamRoleBenefit:str
|
| 46 |
+
courseDescription:str
|
| 47 |
+
courseProvider:str
|
| 48 |
class UserCourse(BaseModel):
|
| 49 |
employmentStatus:str
|
| 50 |
interimRole:bool
|
|
|
|
| 54 |
timeCommitmentPerDay:str
|
| 55 |
challenges:list
|
| 56 |
timeframeToAchieveDreamRole:str
|
| 57 |
+
recommendCourses: List[RecommendCourse]
|
| 58 |
+
|
| 59 |
|
| 60 |
|
| 61 |
class CourseRecommendation(BaseModel):
|
|
|
|
| 129 |
title = item.get('title')
|
| 130 |
link = item.get('link')
|
| 131 |
snippet = item.get('snippet')
|
| 132 |
+
provider = extract_provider(link)
|
| 133 |
+
|
| 134 |
content_structure={}
|
| 135 |
content_structure["courseTitle"]=title
|
| 136 |
content_structure["courseLink"]=link
|