Okay!!!!!!!!

This commit is contained in:
DESKTOP-RTLN3BA\$punk 2024-10-08 02:08:11 -07:00
parent 4d29fb214c
commit 36ca40a335
3 changed files with 6 additions and 1 deletions

View file

@ -75,6 +75,7 @@ Now lets setup the SurfSense BackEnd
|ENV VARIABLE|Description |
|--|--|
| IS_LOCAL_SETUP | 'true' for Ollama mistral-nemo or 'false' from OpenAI gpt-4o-mini|
| UNSTRUCTURED_API_KEY | Your Unstructured IO API Key. Use any value if running a local instance or file upload support isn't needed.|
| POSTGRES_DATABASE_URL | postgresql+psycopg2://user:pass@host:5432/database|
| API_SECRET_KEY | Can be any Random String value. Make Sure to remember it for as you need to send it in user registration request to Backend for security purposes.|

View file

@ -1,6 +1,9 @@
#true if you wana run local setup with Ollama
IS_LOCAL_SETUP = 'false'
#Your Unstructured IO API Key. Use any value if running a local instance or file upload support isn't needed.
UNSTRUCTURED_API_KEY = ""
#POSTGRES DB TO TRACK USERS
POSTGRES_DATABASE_URL = "postgresql+psycopg2://postgres:postgres@localhost:5432/surfsense"

View file

@ -36,6 +36,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES = int(os.environ.get("ACCESS_TOKEN_EXPIRE_MINUTES"))
ALGORITHM = os.environ.get("ALGORITHM")
API_SECRET_KEY = os.environ.get("API_SECRET_KEY")
SECRET_KEY = os.environ.get("SECRET_KEY")
UNSTRUCTURED_API_KEY = os.environ.get("UNSTRUCTURED_API_KEY")
app = FastAPI()
@ -65,7 +66,7 @@ async def upload_files(files: list[UploadFile], token: str = Depends(oauth2_sche
loader = UnstructuredLoader(
file=file.file,
api_key="nWDzKHygqnQzbb1pBsxYnMoQ3nQBja",
api_key=UNSTRUCTURED_API_KEY,
partition_via_api=True,
chunking_strategy="basic",
max_characters=90000,