Using Begin AI Docker Image
Begin AI Docker Image can be easily used to process live data without the need for any knowledge of
python
, follow this guide for details on how to use it πGet the Image
Before pulling the Begin AI Docker Image, make sure you have
docker
available on your computer, by running the following commands on a terminal:docker --version
If
docker
is not installed on your machine, install both before proceedingΒ
Now, that you have confirmed that
docker
is available on your computer, letβs pull the image and start a container by running the following commands on a terminal:docker pull engineeringbeginai/beginai docker run -d -p {your_exposed_port}:5000 engineeringbeginai/beginai
Once the commands are completed, run the command:
curl http://localhost:{your_exposed_port}/
You should see a
"Pong!"
message πAccessing Swagger UI
The Begin AI Docker Image runs a lightweight WEB API built using Fast API, in order to access the Swagger UI, open on your browser:
http://localhost:{your_exposed_port}/docs
, you should see something similar to:Using the WEB API
The WEB API contains two endpoints:
/
β SimpleGET
endpoint that only returns"Pong!"
/learn
βPOST
endpoint used to perform the learn data process
Β
The /learn
Endpoint
Header
appid
β Your Team App ID
licensekey
β Your Team License Key
Β
For details on how to retrieve that information visit Find Your App and License ID
Β
Body
This is a sample structure of the expected body:
{ "object": "string", "id": "string", "properties": [ { "type": "number", "name": "string", "value": 0 } ], "labels": [ "string" ], "interaction": { "object": "string", "id": "string", "action": "string" } }
Mandatory Fields
The
object
property refers to the name of the object to which you are providing data, the name must follow what was defined in your Schema (for example: book
)The
id
property represents the id of the object - this could either be a real id in your application or something created just for the integration with Begin AIThe
properties
field receives a list of fields, for each field you must provide:type
β either one of the following options:number
text
boolean
date
category
id
name
β the name of the property - must follow the same name as defined in your Schema
value
β The value to be used (either a number, a boolean or a string)
Optional Fields
The list of
labels
to be added to the object. This property is optional and should only be used if the labels
property is also defined on your SchemaThe
interaction
property is also optional and used to represent an interaction between a user
and a user/object
, an interaction
contains the following properties:object
β the name of the object youruser
interacted with
id
β the id of theobject
interacted with
action
β the name of the action done by the user
Interactions are only available between a
user
and another object/user
Β
For each
POST
request sent, the WEB API will generate the appropriate embedding and send it over to the Begin AI server but donβt worry the server does not store any data provided