Skip to content

Commit

Permalink
README.md: Update the readme file (#3)
Browse files Browse the repository at this point in the history
Update the readme file
  • Loading branch information
eyurtsev authored Feb 29, 2024
1 parent 44b9587 commit 4aaba65
Showing 1 changed file with 45 additions and 20 deletions.
65 changes: 45 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,32 @@ Please expect breaking changes!
[![](https://dcbadge.vercel.app/api/server/6adMQxSpJS?compact=true&style=flat)](https://discord.gg/6adMQxSpJS)
[![Open Issues](https://img.shields.io/github/issues-raw/langchain-ai/langchain-extract)](https://github.com/langchain-ai/langchain-extract/issues)

This repo is an implementation of a locally hosted extraction service.

# Set up
It's build with LangChain, FastAPI and Postgresql.

## Services
## ✅ Running locally

The root folder contains a docker compose file which will a launch a postgres
instance.
The `backend` code is located in `/backend`.

```
docker compose up
The backend code relies on having access to a postgres instance.


### Launch Postgres

Use the `docker-compose.yml` file in the root directory to launch a postgres instance.

```sh
docker compose up postgres
```

At the time of writing, the app wasn't using postgres yet!
### Launch the extraction webserver

## App
At the moment, we don't have the backend defined in docker compose, so
you'll need to set up the backend.

```sh
cd [root]/backend
cd backend
```

Set up the environment using poetry:
Expand All @@ -36,28 +44,45 @@ Set up the environment using poetry:
poetry install --with lint,dev,test
```

Verify that unit tests pass (they probably wont?)
Run the following script to create a database and schema:

# Test and format
```sh
python -m scripts.run_migrations create
```

Testing and formatting is done using a Makefile inside `[root]/backend`
From `/backend`:

```sh
make format
OPENAI_API_KEY=[YOUR API KEY] python -m server.main
```

## Set up for development

Use this if you want to develop in your own fork of the repo.

For now, we will not be accepting pull requests, but would love to hear any feedback
about ideas or issues etc.

### Testing

Create a test database. The test database is used for running tests and is
separate from the main database. It will have the same schema as the main
database.

```sh
make test
python -m scripts.run_migrations create-test-db
```

# Launch Server

From `[root]/backend`:
Run the tests

```sh
python -m server.main
make test
```

# Example client
# Linting and format

Testing and formatting is done using a Makefile inside `[root]/backend`

See `docs/source/notebooks` for an example client.
```sh
make format
```

0 comments on commit 4aaba65

Please sign in to comment.