Skip to content

Commit c3315b4

Browse files
authored
Update README.md files for the gdrive_text_embedding example. (#173)
* Update `README.md` for `gdrive_text_embedding` example. * Add the `gdrive_text_embedding` to top level `README.md`. #108
1 parent 1325855 commit c3315b4

File tree

3 files changed

+26
-5
lines changed

3 files changed

+26
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Go to the [examples directory](examples) to try out with any of the examples, fo
9696
| [Code Embedding](examples/code_embedding) | Index code embeddings for semantic search |
9797
| [PDF Embedding](examples/pdf_embedding) | Parse PDF and index text embeddings for semantic search |
9898
| [Manuals LLM Extraction](examples/manuals_llm_extraction) | Extract structured information from a manual using LLM |
99+
| [Google Drive Text Embedding](examples/gdrive_text_embedding) | Index text documents from Google Drive |
99100

100101
More coming and stay tuned! If there's any specific examples you would like to see, please let us know in our [Discord community](https://discord.com/invite/zpA9S2DR7s) 🌱.
101102
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Postgres database address for cocoindex
22
COCOINDEX_DATABASE_URL=postgres://cocoindex:cocoindex@localhost/cocoindex
33

4-
# Google Drive service account credential path
5-
# GOOGLE_SERVICE_ACCOUNT_CREDENTIAL=/path/to/service_account_credential.json
4+
# Google Drive service account credential path.
5+
#! PLEASE FILL IN
6+
GOOGLE_SERVICE_ACCOUNT_CREDENTIAL=/path/to/service_account_credential.json
67

7-
# Google Drive root folder IDs, comma separated
8-
# GOOGLE_DRIVE_ROOT_FOLDER_IDS=id1,id2
8+
# Google Drive root folder IDs, comma separated.
9+
#! PLEASE FILL IN
10+
GOOGLE_DRIVE_ROOT_FOLDER_IDS=id1,id2

examples/gdrive_text_embedding/README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
11
Simple example for cocoindex: build embedding index based on Google Drive files.
22

33
## Prerequisite
4-
[Install Postgres](https://cocoindex.io/docs/getting_started/installation#-install-postgres) if you don't have one.
4+
5+
Before running the example, you need to:
6+
7+
1. [Install Postgres](https://cocoindex.io/docs/getting_started/installation#-install-postgres) if you don't have one.
8+
9+
2. Prepare for Google Drive:
10+
11+
- Setup a service account in Google Cloud, and download the credential file.
12+
- Share folders containing files you want to import with the service account's email address.
13+
14+
See [Setup for Google Drive](https://cocoindex.io/docs/ops/sources#setup-for-google-drive) for more details.
15+
16+
3. Create `.env` file with your credential file and folder IDs.
17+
Starting from copying the `.env.example`, and then edit it to fill in your credential file path and folder IDs.
18+
19+
```bash
20+
cp .env.exmaple .env
21+
$EDITOR .env
22+
```
523

624
## Run
725

0 commit comments

Comments
 (0)