mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-04 05:07:48 +03:00
d2b4ef4aff
* ✨ get all knowledge utils * ✨ add remove knowledge and update router * ✨ new knowledge provider * 🚨 remove eslint -disable * ✨ new useKnowledgeApi * ✨ set up KnowledgeItem * ✨ add KnowledgeTable component in knowledge tab * 🔥 remove DocumentData replaced by KnowledgeItem * 🐛 fix weird characters instead of '/' * 💄 truncate knowledge name * ✨ add DownloadUploadedKnowledge component * ⚰️ unused code * 🏷️ introduce UploadedKnowledge and CrawledKnowledge types * 💄 remove thread * 💄 bin for delete knowledge * 🌐 update wording for knowledge tab * 🔇 remove logs and comments
27 lines
676 B
Python
27 lines
676 B
Python
from multiprocessing import get_logger
|
|
|
|
from models import get_supabase_client
|
|
from supabase.client import Client
|
|
|
|
logger = get_logger()
|
|
|
|
SIGNED_URL_EXPIRATION_PERIOD_IN_SECONDS = 600
|
|
|
|
|
|
def generate_file_signed_url(path):
|
|
supabase_client: Client = get_supabase_client()
|
|
|
|
try:
|
|
response = supabase_client.storage.from_("quivr").create_signed_url(
|
|
path,
|
|
SIGNED_URL_EXPIRATION_PERIOD_IN_SECONDS,
|
|
options={
|
|
"download": True,
|
|
"transform": None,
|
|
},
|
|
)
|
|
logger.info("RESPONSE SIGNED URL", response)
|
|
return response
|
|
except Exception as e:
|
|
logger.error(e)
|