Skip to content

Commit

Permalink
Migrate to using LangGraph based workflow, and serve it through custo…
Browse files Browse the repository at this point in the history
…m API endpoint
  • Loading branch information
vemonet committed Jan 16, 2025
1 parent ab76ad2 commit fca1917
Show file tree
Hide file tree
Showing 25 changed files with 983 additions and 1,001 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/tiangolo/uvicorn-gunicorn-fastapi:python3.11
FROM docker.io/python:3.11

WORKDIR /app

Expand All @@ -11,12 +11,15 @@ RUN pip install --upgrade pip


COPY . /app/
# COPY ./scripts/prestart.sh /app/

WORKDIR /app/packages/expasy-agent

RUN pip install -e ".[cpu]" "../sparql-llm"

ENV PYTHONPATH=/app/packages/expasy-agent
ENV MODULE_NAME=src.expasy_agent.api
# ENV VARIABLE_NAME=app
# ENV PYTHONPATH=/app/packages/expasy-agent
# ENV MODULE_NAME=src.expasy_agent.api

# https://github.com/tiangolo/uvicorn-gunicorn-docker/blob/master/docker-images/gunicorn_conf.py

CMD ["uvicorn", "src.expasy_agent.api", "--host", "0.0.0.0", "--port", "80", "--workers", "4"]
# CMD ["uvicorn", "src.expasy_agent.api", "--host", "0.0.0.0", "--port", "80", "--workers", "4", "--http", "h11"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ print("\n".join(issues))
4. Run the script to index the resources (SPARQL endpoints listed in config file):

```sh
docker compose run api python src/expasy_agent/index.py
docker compose run api python src/expasy_agent/indexing/index_endpoints.py
```

> [!WARNING]
Expand All @@ -213,7 +213,7 @@ print("\n".join(issues))
>
> ```sh
> pip install -e ".[chat,gpu]"
> python src/sparql_llm/index_entities.py
> python src/expasy_agent/indexing/index_entities.py
> ```
>
> Then move the entities collection containing the embeddings in `data/qdrant/collections/entities` before starting the stack
Expand Down
2 changes: 1 addition & 1 deletion chat-with-context/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h2 class="text-xl text-center font-semibold border-b pb-2">
<!-- LangGraph prod: api="http://localhost:8123/" -->
<!-- LangServe: api="http://localhost:8001/langgraph/" -->
<chat-with-context
api="http://localhost:2024/"
api="http://localhost:8000/langgraph/"
api-key="%EXPASY_API_KEY%"
examples="Which resources are available at the SIB?,How can I get the HGNC symbol for the protein P68871?,What are the rat orthologs of the human TP53?,Where is expressed the gene ACE2 in human?,Anatomical entities where the INS zebrafish gene is expressed and its gene GO annotations,List the genes in primates orthologous to genes expressed in the fruit fly eye"
></chat-with-context>
Expand Down
Loading

0 comments on commit fca1917

Please sign in to comment.