Jibber AI License Token
When making API requests to the docker container, a license must be present.
There are 3 different ways of using the license token with Docker.
Using a Docker environment variable
To avoid having to include the token in every request, you can set an environment variable when starting the docker container:
docker run -d -p 5000:8000 --env TOKEN=my-license-token-from-jibber-ai jibberhub/jibber_extractor_en:1.0
You can also include it in Docker Compose:
version: "3"
services:
jibber-service:
image: jibberhub/jibber_extractor_en:1.0
environment:
- TOKEN=my-license-token-from-jibber-ai
ports:
- "8000:8000"
In the request header
You can include the license token in the header. If one is set in the header and in the docker environment variable, the token in the header will take precedence when evaluating the license.
import requests
url = "http://my-docker-server-name:5000/analyze"
headers = {
"token": "my-license-token-from-jibber-ai"
}
body = {
"features": {
"sentiment": True,
"keyword": True,
"pii": True,
"entities": True,
"summary": True
},
"text": "My name is Julia Peach and I live in Paris."
}
response = requests.post(url, headers=headers, json=body)
response.raise_for_status()
print(response.json())
In the request body
You can include the license token in the body of the request. If one is set in the body and in the docker environment variable, the token in the body will take precedence when evaluating the license.
import requests
url = "http://my-docker-server-name:5000/analyze"
body = {
"features": {
"sentiment": True,
"keyword": True,
"pii": True,
"entities": True,
"summary": True
},
"token": "my-license-token-from-jibber-ai",
"text": "My name is Julia Peach and I live in Paris."
}
response = requests.post(url, json=body)
response.raise_for_status()
print(response.json())