Skip to content

Commit

Permalink
Improve setup doc, add logging to VertexAI (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
romankhar authored Sep 13, 2023
1 parent 93f5e4f commit 34f54d6
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 124 deletions.
39 changes: 36 additions & 3 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ from the GCS bucket every time there is a change in one or more objects in the b
In order to build and deploy this project you need the following:

- ChatGPT API key
- Google PaLM key
- Google PaLM key (use https://makersuite.google.com)
- Allow listed account for Google Gen AI Enterprise Search
- Meta Llama 2 key
- Install GCLoud SDK
Expand Down Expand Up @@ -107,9 +107,21 @@ In order to build and deploy this project you need the following:
However aware that the initial setup will take more than an hour because it takes that long to propagate the SSL
certificate settings. I recommend setting `ENABLE_EAP` to `false` for the simple development and experimentation.

- Add any number of PDF files with resumes to the [data](data) folder. Files shall be named using 'Firstname
- Add any number of PDF files with resumes to the [data](data) folder. The implementation detail of LlamaIndex and
ChatGP in this project uses specific naming for resume files. Specifically, files shall be named using 'Firstname
Lastname.pdf' format with space separating first and last name. Optionally you can append 'Resume' after last name.
For example: 'Roman Kharkovski Resume.pdf'.
For example: 'Roman Kharkovski Resume.pdf'. The Google PaLM and Enterprise Search implementations do not require any
specific naming of files, therefore if you want to load up financial documents, technical documentation, user manuals,
etc. it will still work ok.

- Optional (only if you need plan to run services locally for test or dev): Install Node.js and React:

```bash
brew update
brew install node
cd "${PROJECT_HOME}/components/client"
npm i react-scripts
```

- Create new virtual environment (if VSCode prompts you to switch to this new virtual environment, accept it). You may
decide to have a separate Virtual Environment for each service, or have one common for all services:
Expand All @@ -125,6 +137,13 @@ In order to build and deploy this project you need the following:
source "${PROJECT_HOME}/.venv/bin/activate"
```

- Optional (only if you need plan to run services locally for test or dev): Install proper Python modules:

```bash
cd "${PROJECT_HOME}/components"
pip install -r ./common/requirements.txt -r ./query_engine/requirements.txt -r ./resume_manager/requirements.txt"
```
- Complete the setup:
```bash
Expand Down Expand Up @@ -179,6 +198,10 @@ URL to the page source code:
services should work, except for the Google Enterprise Search. To enable Google Enterprise Search, refer to the
section below.
- Optional: If you are using sensitive data (such as your company financial, or other documents) in this project, you
either must enable IAP to protect your deployed Cloud Run instances, or, make those instances visible only to internal
VPC traffic and access them using the [Cloud Run proxy](https://github.com/GoogleCloudPlatform/cloud-run-proxy).
## Create Google Enterprise Search Gen AI App
Follow
Expand Down Expand Up @@ -328,6 +351,16 @@ process (or as a local container), and run UI in a local NodeJS process (or a lo
- Once you open the local client UI in your browser, navigate to the "Settings" menu option and update the "Backend URL"
to point to your local server: [http://127.0.0.1:8000](http://127.0.0.1:8000).
# Replacing resumes with your own data
If you have working project with resume data and need to try it out with different type of data (financial statements,
or something else):
- Delete resume files from the GCS bucket with source resumes (`resume-originals-${PROJECT_ID}`) and upload your own
files into it.
- Delete VertexAI index (refer to the `components/setup/delete_index.sh` script).
- Run VertexAI setup (`components/setup/delete_index.sh`). resumes.
# Credits
Various parts of this project were derived from Open Source tutorials an blog articles:
Expand Down
12 changes: 6 additions & 6 deletions components/query_engine/dev/client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,17 @@ log "Ask a question about a person..."
# -d "{\"question\":\"What is email of Steven Kim?\"}" \
# "${CHAT_SVC_DEV_URL}/ask_gpt"

gcurl -i -X POST \
-d "{\"question\":\"Can Roman Kharkovski build a cloud native application using Kubernetes?\"}" \
"${CHAT_SVC_DEV_URL}/ask_palm_chroma_langchain"
# gcurl -i -X POST \
# -d "{\"question\":\"Can Roman Kharkovski build a cloud native application using Kubernetes?\"}" \
# "${CHAT_SVC_DEV_URL}/ask_palm_chroma_langchain"

# gcurl -i -X POST \
# -d "{\"question\":\"What is email of Steven Kim?\"}" \
# "${CHAT_SVC_DEV_URL}/ask_palm_chroma_langchain"

# gcurl -i -X POST \
# -d "{\"question\":\"Can Roman Kharkovski build a cloud native application using Kubernetes?\"}" \
# "${CHAT_SVC_DEV_URL}/ask_vertexai"
gcurl -i -X POST \
-d "{\"question\":\"Can Roman Kharkovski build a cloud native application using Kubernetes?\"}" \
"${CHAT_SVC_DEV_URL}/ask_vertexai"

# gcurl -i -X POST \
# -d "{\"question\":\"What is email of Steven Kim?\"}" \
Expand Down
Loading

0 comments on commit 34f54d6

Please sign in to comment.