Spaces:
Runtime error
Runtime error
Patel aryan
commited on
Commit
·
5beb0d7
1
Parent(s):
6505613
refactor: update import paths to remove 'app' prefix for consistency
Browse files- backend/__pycache__/main.py +2 -2
- backend/app/controllers/search_controller.py +2 -2
- backend/app/database/find_k_nearest.py +1 -1
- backend/app/database/insert_data.py +1 -1
- backend/app/database/last_fetched_data.py +1 -1
- backend/app/main.py +2 -2
- backend/app/routes/search_route.py +1 -1
- backend/app/scripts/populate_db.py +2 -2
- backend/app/scripts/update_data.py +1 -1
- backend/app/services/genrate_embeddings.py +2 -2
- backend/app/services/scrape_problems.py +3 -3
backend/__pycache__/main.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
import threading
|
| 6 |
import time
|
| 7 |
import logging
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
+
from routes import search_route
|
| 4 |
+
from services.scrape_problems import scrape_problems
|
| 5 |
import threading
|
| 6 |
import time
|
| 7 |
import logging
|
backend/app/controllers/search_controller.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
from
|
| 2 |
-
from
|
| 3 |
from typing import List
|
| 4 |
|
| 5 |
|
|
|
|
| 1 |
+
from utils.get_embeddings import get_embedding
|
| 2 |
+
from database.find_k_nearest import get_questions_by_similarity_range
|
| 3 |
from typing import List
|
| 4 |
|
| 5 |
|
backend/app/database/find_k_nearest.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from typing import List
|
| 2 |
# Adjust the import path as needed
|
| 3 |
-
from
|
| 4 |
|
| 5 |
|
| 6 |
def get_questions_by_similarity_range(query_embedding: List[float], page: int
|
|
|
|
| 1 |
from typing import List
|
| 2 |
# Adjust the import path as needed
|
| 3 |
+
from database.supabase_client import supabase
|
| 4 |
|
| 5 |
|
| 6 |
def get_questions_by_similarity_range(query_embedding: List[float], page: int
|
backend/app/database/insert_data.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
# insert_problems.py
|
| 2 |
import logging
|
| 3 |
-
from
|
| 4 |
|
| 5 |
|
| 6 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 1 |
# insert_problems.py
|
| 2 |
import logging
|
| 3 |
+
from database.supabase_client import supabase
|
| 4 |
|
| 5 |
|
| 6 |
logging.basicConfig(level=logging.INFO)
|
backend/app/database/last_fetched_data.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
from
|
| 2 |
|
| 3 |
|
| 4 |
def get_last_fetched_question(type):
|
|
|
|
| 1 |
+
from database.supabase_client import supabase
|
| 2 |
|
| 3 |
|
| 4 |
def get_last_fetched_question(type):
|
backend/app/main.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
-
from
|
| 4 |
import logging
|
| 5 |
|
| 6 |
-
from
|
| 7 |
|
| 8 |
# Initialize FastAPI app
|
| 9 |
app = FastAPI(title="LeetCode Vector Search API", version="1.0")
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.middleware.cors import CORSMiddleware
|
| 3 |
+
from routes import search_route
|
| 4 |
import logging
|
| 5 |
|
| 6 |
+
from scripts.populate_db import populate_db
|
| 7 |
|
| 8 |
# Initialize FastAPI app
|
| 9 |
app = FastAPI(title="LeetCode Vector Search API", version="1.0")
|
backend/app/routes/search_route.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
from fastapi import APIRouter, HTTPException, Query, Body
|
| 2 |
from typing import Dict, Any
|
| 3 |
-
from
|
| 4 |
|
| 5 |
router = APIRouter()
|
| 6 |
|
|
|
|
| 1 |
from fastapi import APIRouter, HTTPException, Query, Body
|
| 2 |
from typing import Dict, Any
|
| 3 |
+
from controllers.search_controller import handle_search
|
| 4 |
|
| 5 |
router = APIRouter()
|
| 6 |
|
backend/app/scripts/populate_db.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
from
|
| 2 |
-
from
|
| 3 |
import re
|
| 4 |
import logging
|
| 5 |
import os
|
|
|
|
| 1 |
+
from utils.get_paid_problems import get_paid_problems
|
| 2 |
+
from utils.get_embeddings import get_embedding
|
| 3 |
import re
|
| 4 |
import logging
|
| 5 |
import os
|
backend/app/scripts/update_data.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import logging
|
| 2 |
-
from
|
| 3 |
|
| 4 |
|
| 5 |
def main():
|
|
|
|
| 1 |
import logging
|
| 2 |
+
from services.scrape_problems import scrape_problems
|
| 3 |
|
| 4 |
|
| 5 |
def main():
|
backend/app/services/genrate_embeddings.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
from
|
| 2 |
-
from
|
| 3 |
|
| 4 |
|
| 5 |
def generate_embeddings(data):
|
|
|
|
| 1 |
+
from utils.get_embeddings import get_embedding
|
| 2 |
+
from database.insert_data import insert_questions
|
| 3 |
|
| 4 |
|
| 5 |
def generate_embeddings(data):
|
backend/app/services/scrape_problems.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import logging
|
| 2 |
-
from
|
| 3 |
-
from
|
| 4 |
-
from
|
| 5 |
from bs4 import BeautifulSoup
|
| 6 |
import requests
|
| 7 |
import re
|
|
|
|
| 1 |
import logging
|
| 2 |
+
from services.genrate_embeddings import generate_embeddings
|
| 3 |
+
from database.last_fetched_data import get_last_fetched_question
|
| 4 |
+
from utils.get_paid_problems import get_paid_problems
|
| 5 |
from bs4 import BeautifulSoup
|
| 6 |
import requests
|
| 7 |
import re
|