Ali Hashhash commited on
Commit
e204a8a
·
2 Parent(s): be6b518dfcca37

Merge branch 'main' of https://huggingface.co/spaces/ATInc1/AIdea-Server

Browse files
app.py CHANGED
@@ -1,5 +1,5 @@
1
- import datetime
2
- import uvicorn
3
 
4
  # Ali Test
5
  from src.api.main import app
 
1
+ import datetime
2
+ import uvicorn
3
 
4
  # Ali Test
5
  from src.api.main import app
src/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/__pycache__/__init__.cpython-312.pyc and b/src/__pycache__/__init__.cpython-312.pyc differ
 
src/api/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/api/__pycache__/__init__.cpython-312.pyc and b/src/api/__pycache__/__init__.cpython-312.pyc differ
 
src/api/__pycache__/auth_routes.cpython-312.pyc CHANGED
Binary files a/src/api/__pycache__/auth_routes.cpython-312.pyc and b/src/api/__pycache__/auth_routes.cpython-312.pyc differ
 
src/api/__pycache__/main.cpython-312.pyc CHANGED
Binary files a/src/api/__pycache__/main.cpython-312.pyc and b/src/api/__pycache__/main.cpython-312.pyc differ
 
src/api/__pycache__/notes_routes.cpython-312.pyc CHANGED
Binary files a/src/api/__pycache__/notes_routes.cpython-312.pyc and b/src/api/__pycache__/notes_routes.cpython-312.pyc differ
 
src/api/recommendation_routes.py CHANGED
@@ -1,3 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from fastapi import APIRouter
2
  from typing import Dict, Any
3
 
@@ -7,8 +23,18 @@ router = APIRouter(prefix="/recommendations", tags=["Recommendations"])
7
  async def get_general_recommendations() -> Dict[str, Any]:
8
  """
9
  Placeholder endpoint for future ML recommendation logic.
10
- """
11
  return {
12
  "status": "success",
13
- "recommendations": []
14
- }
 
 
 
 
 
 
 
 
 
 
 
1
+ # from fastapi import APIRouter
2
+ # from typing import Dict, Any
3
+
4
+ # router = APIRouter(prefix="/recommendations", tags=["Recommendations"])
5
+
6
+ # @router.get("")
7
+ # async def get_general_recommendations() -> Dict[str, Any]:
8
+ # """
9
+ # Placeholder endpoint for future ML recommendation logic.
10
+ # """
11
+ # return {
12
+ # "status": "success",
13
+ # "recommendations": []
14
+ # }
15
+
16
+
17
  from fastapi import APIRouter
18
  from typing import Dict, Any
19
 
 
23
  async def get_general_recommendations() -> Dict[str, Any]:
24
  """
25
  Placeholder endpoint for future ML recommendation logic.
26
+ """
27
  return {
28
  "status": "success",
29
+ "recommendations": [
30
+ {
31
+ "id": "vS07S_yIn_U",
32
+ "title": "Introduction to Neural Networks",
33
+ "description": "Learn the basics of Neural Networks in this educational video.",
34
+ "thumbnail": "https://i.ytimg.com/vi/vS07S_yIn_U/mqdefault.jpg",
35
+ "channelTitle": "AI Academy",
36
+ "url": "https://www.youtube.com/watch?v=vS07S_yIn_U",
37
+ "type": "youtube_video"
38
+ }
39
+ ]
40
+ }
src/auth/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/auth/__pycache__/__init__.cpython-312.pyc and b/src/auth/__pycache__/__init__.cpython-312.pyc differ
 
src/auth/__pycache__/dependencies.cpython-312.pyc CHANGED
Binary files a/src/auth/__pycache__/dependencies.cpython-312.pyc and b/src/auth/__pycache__/dependencies.cpython-312.pyc differ
 
src/auth/__pycache__/security.cpython-312.pyc CHANGED
Binary files a/src/auth/__pycache__/security.cpython-312.pyc and b/src/auth/__pycache__/security.cpython-312.pyc differ
 
src/db/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/db/__pycache__/__init__.cpython-312.pyc and b/src/db/__pycache__/__init__.cpython-312.pyc differ
 
src/db/__pycache__/database.cpython-312.pyc CHANGED
Binary files a/src/db/__pycache__/database.cpython-312.pyc and b/src/db/__pycache__/database.cpython-312.pyc differ
 
src/db/__pycache__/models.cpython-312.pyc CHANGED
Binary files a/src/db/__pycache__/models.cpython-312.pyc and b/src/db/__pycache__/models.cpython-312.pyc differ
 
src/recommendation/recommender.py CHANGED
@@ -9,6 +9,11 @@ from src.db.models import Note
9
  from src.utils.logger import setup_logger
10
  from src.utils.config import settings
11
 
 
 
 
 
 
12
  logger = setup_logger(__name__)
13
 
14
 
@@ -19,9 +24,10 @@ class RecommendationService:
19
  """
20
 
21
  def __init__(self, api_key: Optional[str] = None):
22
- self.api_key = api_key or settings.gemini_api_key_1
 
23
  # Use the newer google-genai client
24
- self.client = genai.Client(api_key=self.api_key)
25
  self.youtube = build("youtube", "v3", developerKey=self.api_key)
26
 
27
  async def get_recommendations_for_user(
@@ -104,6 +110,11 @@ class RecommendationService:
104
  "type": "youtube_video",
105
  }
106
  )
 
 
 
 
 
107
  return videos
108
  except Exception as e:
109
  logger.error(f"YouTube search failed: {e}")
 
9
  from src.utils.logger import setup_logger
10
  from src.utils.config import settings
11
 
12
+ import os
13
+ from dotenv import load_dotenv
14
+ load_dotenv()
15
+
16
+
17
  logger = setup_logger(__name__)
18
 
19
 
 
24
  """
25
 
26
  def __init__(self, api_key: Optional[str] = None):
27
+
28
+ self.api_key = "AIzaSyA3erB-Lxd5SOoBOXaumOCVaEr3TcgYG60"
29
  # Use the newer google-genai client
30
+ # self.client = genai.Client(api_key=self.api_key)
31
  self.youtube = build("youtube", "v3", developerKey=self.api_key)
32
 
33
  async def get_recommendations_for_user(
 
110
  "type": "youtube_video",
111
  }
112
  )
113
+ # ✨ السطر ده اللي هيظهرلك الفيديو في الـ Logs
114
+ logger.info(f"✅ Found Video: {snippet['title']}")
115
+
116
+ # ✨ السطر ده عشان تعرفي إجمالي اللي رجع كام فيديو
117
+ logger.info(f"🚀 Total videos fetched: {len(videos)}")
118
  return videos
119
  except Exception as e:
120
  logger.error(f"YouTube search failed: {e}")
src/summarization/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/summarization/__pycache__/__init__.cpython-312.pyc and b/src/summarization/__pycache__/__init__.cpython-312.pyc differ
 
src/summarization/__pycache__/note_generator.cpython-312.pyc CHANGED
Binary files a/src/summarization/__pycache__/note_generator.cpython-312.pyc and b/src/summarization/__pycache__/note_generator.cpython-312.pyc differ
 
src/transcription/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/transcription/__pycache__/__init__.cpython-312.pyc and b/src/transcription/__pycache__/__init__.cpython-312.pyc differ
 
src/transcription/__pycache__/whisper_transcriber.cpython-312.pyc CHANGED
Binary files a/src/transcription/__pycache__/whisper_transcriber.cpython-312.pyc and b/src/transcription/__pycache__/whisper_transcriber.cpython-312.pyc differ
 
src/utils/__pycache__/__init__.cpython-312.pyc CHANGED
Binary files a/src/utils/__pycache__/__init__.cpython-312.pyc and b/src/utils/__pycache__/__init__.cpython-312.pyc differ
 
src/utils/__pycache__/config.cpython-312.pyc CHANGED
Binary files a/src/utils/__pycache__/config.cpython-312.pyc and b/src/utils/__pycache__/config.cpython-312.pyc differ
 
src/utils/__pycache__/logger.cpython-312.pyc CHANGED
Binary files a/src/utils/__pycache__/logger.cpython-312.pyc and b/src/utils/__pycache__/logger.cpython-312.pyc differ
 
src/utils/config.py CHANGED
@@ -30,6 +30,7 @@ class Settings(BaseSettings):
30
  description="Whisper model size (larger = more accurate but slower)"
31
  )
32
 
 
33
  # Processing Limits
34
  max_video_duration: int = Field(
35
  default=7200,
 
30
  description="Whisper model size (larger = more accurate but slower)"
31
  )
32
 
33
+
34
  # Processing Limits
35
  max_video_duration: int = Field(
36
  default=7200,