JaaI API
This API is intended to enable you to create a scalable 'Chat GPT' for your own data.
There is a lot on the internet about how you can create your own GPT or how you can use GPT with your data. If you want to do it on your own, I strongly recommend that you check https://github.com/hwchase17/langchain.
However, if you just want to test the technology or are looking for something to start playing with your own data with Chat GPT in seconds, I strongly recommend that you keep reading.
Installation
To start the idea it's to do it as simple as possible, you just only need
- docker
- docker-compose installed,
- an open ai api key (if you don't know hot to get it check https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key )
then you need to run
git clone https://github.com/geisbruch/jaai-api
cd jaai-api
export OPENAI_API_KEY=<here your key>
docker-compose up
It will take a while ... After it has started (It will create a local opensearch server, a local PostgresSql and the api server)
Usage
by now json and text document (any text document) are supported
Here some examples about how to usage
First create an "account"
curl -X POST 127.0.0.1:3000/account -d '{"name":"test"}' -H"Content-Type: application/json"
Example response:
{"id":"df0011cc4e104aeb85c7a1eaa98c02d2","status":"ACTIVE","name":"test","suspended_message":null,"documents_repository_url":"s3://demo-bucket/df0011cc4e104aeb85c7a1eaa98c02d2"}
Now index a document
Node: your documents will be created into collections, a collection is the "search unit" you can create add-hoc chat gpt query's using either a collection or a document
ACCOUNT_ID=df0011cc4e104aeb85c7a1eaa98c02d2
curl -XPOST 127.0.0.1:3000/document -H"X-Account-Id: $ACCOUNT_ID" -H"X-Collection-Name: test" -H"X-Document-Name: test1" -H"Content-Type: text/plain" --data-binary "@$PWD/errors/errors.js"
example response
{"id":"d1d1f09bf4984083a52f2a11ca52a0a9","status":"CREATED","name":"test1","collection_id":"4d3b9d5feeae4bfb993b64d78902eb89"}