Spaces:
Build error
Build error
XThomasBU
commited on
Commit
•
d3eb480
1
Parent(s):
bbff0eb
minor updates
Browse files- code/modules/vectorstore/store_manager.py +1 -1
- docs/setup.md +44 -3
code/modules/vectorstore/store_manager.py
CHANGED
@@ -115,7 +115,7 @@ class VectorStoreManager:
|
|
115 |
)
|
116 |
num_documents = len(document_chunks)
|
117 |
self.logger.info(f"Number of documents in the DB: {num_documents}")
|
118 |
-
metadata_keys = list(document_metadata[0].keys())
|
119 |
self.logger.info(f"Metadata keys: {metadata_keys}")
|
120 |
self.logger.info("Completed loading data")
|
121 |
self.initialize_database(
|
|
|
115 |
)
|
116 |
num_documents = len(document_chunks)
|
117 |
self.logger.info(f"Number of documents in the DB: {num_documents}")
|
118 |
+
metadata_keys = list(document_metadata[0].keys()) if document_metadata else []
|
119 |
self.logger.info(f"Metadata keys: {metadata_keys}")
|
120 |
self.logger.info("Completed loading data")
|
121 |
self.initialize_database(
|
docs/setup.md
CHANGED
@@ -26,8 +26,8 @@ To set up the Google OAuth 2.0 Client ID and Secret, follow these steps:
|
|
26 |
4. Click on "Create Credentials" and select "OAuth 2.0 Client ID".
|
27 |
5. Configure the OAuth consent screen if you haven't already.
|
28 |
6. Choose "Web application" as the application type.
|
29 |
-
7.
|
30 |
-
8.
|
31 |
|
32 |
Set the following in the .env file (if running locally) or in secrets (if running on Hugging Face Spaces):
|
33 |
|
@@ -47,7 +47,8 @@ To obtain the Literal AI API key:
|
|
47 |
Set the following in the .env file (if running locally) or in secrets (if running on Hugging Face Spaces):
|
48 |
|
49 |
```bash
|
50 |
-
|
|
|
51 |
```
|
52 |
|
53 |
## LlamaCloud API Key
|
@@ -78,6 +79,46 @@ Set the following in the .env file (if running locally) or in secrets (if runnin
|
|
78 |
HUGGINGFACE_TOKEN=<your-huggingface-token>
|
79 |
```
|
80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
81 |
# Configuration
|
82 |
|
83 |
The configuration file `code/modules/config.yaml` contains the parameters that control the behaviour of your app.
|
|
|
26 |
4. Click on "Create Credentials" and select "OAuth 2.0 Client ID".
|
27 |
5. Configure the OAuth consent screen if you haven't already.
|
28 |
6. Choose "Web application" as the application type.
|
29 |
+
7. Configure the redirect URIs as needed.
|
30 |
+
8. Copy the generated `Client ID` and `Client Secret`.
|
31 |
|
32 |
Set the following in the .env file (if running locally) or in secrets (if running on Hugging Face Spaces):
|
33 |
|
|
|
47 |
Set the following in the .env file (if running locally) or in secrets (if running on Hugging Face Spaces):
|
48 |
|
49 |
```bash
|
50 |
+
LITERAL_API_KEY_LOGGING=<your_api_key>
|
51 |
+
LITERAL_API_URL=https://cloud.getliteral.ai
|
52 |
```
|
53 |
|
54 |
## LlamaCloud API Key
|
|
|
79 |
HUGGINGFACE_TOKEN=<your-huggingface-token>
|
80 |
```
|
81 |
|
82 |
+
## Chainlit Authentication Secret
|
83 |
+
|
84 |
+
You must provide a JWT secret in the environment to use authentication. Run `chainlit create-secret` to generate one.
|
85 |
+
|
86 |
+
```bash
|
87 |
+
chainlit create-secret
|
88 |
+
```
|
89 |
+
|
90 |
+
Set the following in the .env file (if running locally) or in secrets (if running on Hugging Face Spaces):
|
91 |
+
|
92 |
+
```bash
|
93 |
+
CHAINLIT_AUTH_SECRET=<your_jwt_secret>
|
94 |
+
CHAINLIT_URL=<your_chainlit_url> # Example: CHAINLIT_URL=https://localhost:8000
|
95 |
+
```
|
96 |
+
|
97 |
+
## OpenAI API Key
|
98 |
+
|
99 |
+
Set the following in the .env file (if running locally) or in secrets (if running on Hugging Face Spaces):
|
100 |
+
|
101 |
+
```bash
|
102 |
+
OPENAI_API_KEY=<your_openai_api_key>
|
103 |
+
```
|
104 |
+
|
105 |
+
## In a Nutshell
|
106 |
+
|
107 |
+
Your .env file (secrets in HuggingFace) should look like this:
|
108 |
+
|
109 |
+
```bash
|
110 |
+
CHAINLIT_AUTH_SECRET=<your_jwt_secret>
|
111 |
+
OPENAI_API_KEY=<your_openai_api_key>
|
112 |
+
HUGGINGFACE_TOKEN=<your-huggingface-token>
|
113 |
+
LITERAL_API_KEY_LOGGING=<your_api_key>
|
114 |
+
LITERAL_API_URL=<https://cloud.getliteral.ai>
|
115 |
+
OAUTH_GOOGLE_CLIENT_ID=<your_client_id>
|
116 |
+
OAUTH_GOOGLE_CLIENT_SECRET=<your_client_secret>
|
117 |
+
LLAMA_CLOUD_API_KEY=<your_api_key>
|
118 |
+
CHAINLIT_URL=<your_chainlit_url>
|
119 |
+
```
|
120 |
+
|
121 |
+
|
122 |
# Configuration
|
123 |
|
124 |
The configuration file `code/modules/config.yaml` contains the parameters that control the behaviour of your app.
|