AI Tool Server


This is the Documentaion for the AI Tool Server. This API hosts AI Tools that can be used with API Calls. The Server requires a highly parallalized and strong performance resource to run on. This can either be in house by a GPU Server or using a cloud solution.

Included API Calls in this Documentation:

  1. Collections:
    1. All AI Tools supported
    2. List of AI Tools that are already initiated
    3. AI Tools currently running
  2. Instances:
    1. initiating a new AI Tool
    2. improving an AI Tool
    3. opening an AI Tool
    4. using an AI Tool
    5. closing an AI Tool
    6. deleting an AI Tool

All Responses that come back from the API Calls follow this style:

json {
    "data": {
        "Content of the response in a JSON object"
        },
    "message": "Message Code: Description of what happened"
}


1. Collections

1.1. List of all supported AI Tools:

Definition

GET /ai_tool_templates

Response Examples

json {
    "context_search":{
        "type": "nlu",
        "tradeoff_attributes": {
            "accuracy_speed_tradeoff": 
            {
                “min”:
                {
                    "text": "accuracy",
                    "description": "More Computationcosts and higher Accuracy",
                    “value”: “0”
                },
                "max": 
                {
                    “text”:"speed",
                    "description": "Less Computationcosts and faster Speed",
                    “value”: “1”
                },
                "default_value": "0.5"
            },
            "results_number_tradeoff": 
            {
                “min”:
                {
                    "text": "Top 1 Result",
                    "description": "The less results the lower the chance of having the right result appear",
                    “value”: “1”
                },
                "max": 
                {
                    “text”:"Top 20 Results",
                    "description": "Too many results make the AI Tool less confinient to use",
                    “value”: “20”
                },
                "default_value": "3"
            }}
        "additional_data_for_initiation": 
        {
            "search_corpus":
            {
                "description":"The text body that will be searched through",
                "type":"String",
                "max_size":{
                    "value":"3",
                    "unit":"gb"}
            }
        }
    },
    ...
}


1.2. List of initiated AI Tools:

Definition

GET /existing_ai_tools

Response Examples

json {
    "context_search":{
        "id": "context_2823d789"
        "type": "nlu",
        "tradeoff_attributes": 
        {
            "accuracy_speed_tradeoff":
            {
                "set_value": "0.5"
            },
            "results_number_tradeoff": 
            {
                "set_value": "3"
            }}},          
        ...
}


1.3. List of AI Tools currently active:

Definition

GET /running_ai_tools

Response Examples

json {
    "sentiment_analysis":{
        "id": "sentiment_8h44472h33"
        "type": "nlu",
        "tradeoff_attributes": 
        {
            "accuracy_speed_tradeoff":
            {
                "set_value": "0.5"
            }}},          
        ...
}


2. Instances

2.1. Initiate an AI Tool:

To make an AI Tool available for use, it first needs to be Initiated. Sometimes its just about setting tradeoff values and sometimes data has to be supplied. To find out what is needed use '''GET /available_ai_tools'''

Definition

PUT /ai_tool/:ai_tool_name

Arguments

json {
    "ai_tool_template": string, -> specifies the available AI Tool to be used
    "tradeoff_attributes": {
        "accuracy_speed_tradeoff": double,
        "results_number_tradeoff": double,
        ... }, -> The values for the Tradeoff attributes. If not set then the default value will be used. Varies by AI tool
    "additional_data": {
        "search_corpus": string,
        "finetune_data": {
            "url": url,
            "number_of_input_columns": int,
            "label_column": int,
            "first_input": int,
            "second_input": int,
            "input_format": string,
            "label_format": string}`
        }, ... -> Additional data input specified in the template. Varies by AI Tool.
}

Response

json {
    "ai_tool_id": string,
    "progress_url": string,
    "error_message": string
}


2.2. Improve an AI Tool:

Here you are able to improve an existing AI Tool with own data or change the tradeoff attributes

Definition

POST /ai_tool/:ai_tool_id

Arguments

json {
    "tradeoff_attributes": {
        "accuracy_speed_tradeoff": double,
        "results_number_tradeoff": double,
        ... } -> The values for the Tradeoff attributes. If not set then the previous value will be used. Varies by AI tool
    "additional_data": {
        "search_corpus": string,
        "finetune_data": {
            "url": url,
            "number_of_input_columns": int,
            "label_column": int,
            "first_input": int,
            "second_input": int,
            "input_format": string,
            "label_format": string}`
        }, ... -> Additional data input specified in the template. Varies by AI Tool.
}

Response

json {
    "ai_tool_id": string,
    "progress_url": string,
    "error_message": string
}


2.3. Load an AI Tool into the Server:

Definition

LOAD /ai_tool/:ai_tool_id

Response

json { "error_message": string }


2.4. Use an AI Tool on the Server:

Definition

GET /ai_tool/:ai_tool_id

Arguments

json {
    "input":
    {
        "data":data,
        "data_type":string
    }
}

Response

json { 
    "output": {
        "value": data,
        "type": string,
        "confidence": doulbe 
        }
    "error_message": string 
}


2.5. Unload an AI Tool from the Server:

Definition

UNLOAD /ai_tool/:ai_tool_id

Response

json { "error_message": string }


2.6. Delete an AI Tool:

Definition

DELETE /ai_tool/:ai_tool_id

Response

json {
    "deleted_model_id": string
}