Locally, the service runs on port 8003. To start it,
-
first, run the following command for some preparations:
make
This will create a virtual environment and install all dependencies.
-
After that, configure the used virtual environment:
source venv/bin/activate
If you use an IDE, you can also configure the virtual environment there. In PyCharm, you can even go to
File > Open
, choose the embedding folder and then choose theAttach
option. -
Then, you can start the embedding server using
python start.py
or using your IDE.
Use the docker-compose.yml
file from the parent directory
to start the embedding service (and all others) with Docker.
Configurable environment variables:
BALANCER_QUEUE_FREQUENCY
BALANCER_GETTASK_URL
CHUNK_SIZE
BALANCER_SENDRESULT_URL
The following API-routes will be available after start: http://localhost:8002/trigger
Input example JSON for POST on http://localhost:8001/embed
{
"courseId" : "1234",
"blocks": [
{
"id" : 1,
"text" : "This is the first text block."
},
{
"id" : 2,
"text" : "and this is the second one"
}
]
}
Input example JSON for POST on http://localhost:8001/upload
{
"courseId" : "1234",
"fileName" : "file.pdf",
"fileData" : "a21s5d5sqa354a34575"
}