Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,33 @@ Follow these steps to run the barebones Chainlit application.
```bash
poetry install
```
4. Verify your `PYTHONPATH` environment variable includes `./src`:
4. Add your OpenAI key. The chatbot cannot answer without one:
```bash
echo $PYTHONPATH
# ./src
echo 'OPENAI_API_KEY=sk-...' > .env
```
5. List embeddings available for download:
Do **not** copy `env_template` for this. It sets `POSTGRES_*`, which makes the
app try to reach a database at host `postgres:5432` — that exists in Docker
Compose but not on your machine, and the failure only appears on the first
message. `env_template` is for the Docker setup below.
5. Put `./src` on the `PYTHONPATH`. The entry points import from there, and
nothing sets it for you:
```bash
./bin/embeddings_manager ls-remote
export PYTHONPATH="./src:$PYTHONPATH"
```
6. Install your chosen embeddings:
6. List embeddings available for download. `poetry run` puts the project's
dependencies on the path:
```bash
./bin/embeddings_manager install openai/text-embedding-3-large/reactome/ReleaseXX
poetry run ./bin/embeddings_manager ls-remote
```
7. Run the Chainlit application:
7. Install your chosen embeddings. These are multi-gigabyte downloads:
```bash
poetry run ./bin/embeddings_manager install openai/text-embedding-3-large/reactome/ReleaseXX
```
chainlit run bin/chat-chainlit.py -w
8. Run the Chainlit application:
```bash
poetry run chainlit run bin/chat-chainlit.py -w
```
8. Access the app at http://localhost:8000 🎉
9. Access the app at http://localhost:8000 🎉

### Docker Setup

Expand Down
2 changes: 1 addition & 1 deletion bin/embeddings_manager
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os
import re
Expand Down
2 changes: 1 addition & 1 deletion bin/retrieval_baseline
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
"""Record what each retriever returns, so a change to retrieval can be diffed.

Retrieval quality has no right answer, only a "did this change". This captures
Expand Down
4 changes: 2 additions & 2 deletions src/retrievers/uniprot/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
2. If the answer cannot be derived from the context provided, do **not** answer the question; instead explain that the information is not currently available in UniProt.
3. Answer the question comprehensively and accurately, providing useful background information based **only** on the context.
4. keep track of **all** the sources that are directly used to derive the final answer, ensuring **every** piece of information in your response is **explicitly cited**.
5. Create Citations for the sources used to generate the final asnwer according to the following:
- For Reactome always format citations in the following format: <a href="citation">*short_protein_name*</a>.
5. Create Citations for the sources used to generate the final answer according to the following:
- For UniProt always format citations in the following format: <a href="citation">*short_protein_name*</a>.
Examples:
- <a href="https://www.uniprot.org/uniprotkb/Q92908">GATA6</a>
- <a href="https://www.uniprot.org/uniprotkb/O00482">NR5A2</a>
Expand Down
2 changes: 1 addition & 1 deletion src/tools/external_search/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ class WebSearchResult(TypedDict):

class SearchState(TypedDict, total=False):
input: str # LLM enhanced User question
generation: str # LLM generated reponse to the user question
generation: str # LLM generated response to the user question
complete: str # "Yes" or "No" to search for external resources
search_results: list[WebSearchResult] # Results from searching the web
Loading