Skip to content

Commit

Permalink
moved sql db object inside supabase padding fn
Browse files Browse the repository at this point in the history
  • Loading branch information
star-nox committed Mar 18, 2024
1 parent af30a81 commit 9b95941
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions ai_ta_backend/utils/context_parent_doc_padding.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
#import os
import time
from concurrent.futures import ProcessPoolExecutor
#from concurrent.futures import ProcessPoolExecutor
from functools import partial
from multiprocessing import Manager
from ai_ta_backend.database.sql import SQLDatabase
Expand All @@ -11,8 +11,6 @@
# SUPABASE_CLIENT = supabase.create_client(supabase_url=os.environ['SUPABASE_URL'],
# supabase_key=os.environ['SUPABASE_API_KEY']) # type: ignore

SQL_DB = SQLDatabase()


def context_parent_doc_padding(found_docs, search_query, course_name):
"""
Expand Down Expand Up @@ -77,8 +75,9 @@ def qdrant_context_processing(doc, course_name, result_contexts):
def supabase_context_padding(doc, course_name, result_docs):
"""
Does context padding for given doc.
"""

"""
SQL_DB = SQLDatabase()

# query by url or s3_path
if 'url' in doc.metadata.keys() and doc.metadata['url']:
parent_doc_id = doc.metadata['url']
Expand Down

0 comments on commit 9b95941

Please sign in to comment.