Check and accept Disclaimer before use

Corporate: JSON API Usage Instructions

 

Welcome to Table-Search.com

Most the world best AI models of "Table Question Answering" can process fast only <100 records.

This the only New AI system based on LLM that can take: 100... up to 20 000 !!! records

Remarkable speed in generating human-readable queries.

The system can handle such complex Queries to table as:

> java with rating above 4.7 and review num > 5k

Example

Queries can contain:

Uses

Testing "Table Question Answering" at any size for:

Below are examples of uploading JSON data through REST API.

JSON format is a plain Array with key-value pairs. Example:

        
    [
        {
            "name": "John", "age": 25, "city": "New York"
        },
        {
            "name": "Jane", "age": 30, "city": "Los Angeles"
        }
        ...
    ]
        
    

POST your JSON

You can create new table for testing. For example with name: abc_tset_table

Your table name will be part of the URL: https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/abc_tset_table

Example of Function to POST JSON

        
    import json
    import requests

    def post_test_json():
        try:
            test_data = [
                {"id": "crgqulicdqn60bdjf4", "name": "John", "age": 25, "description": "John is a good guy. Doctor."},
                {"id": "crgqulicdasdfbdjf4m0", "name": "Alice", "age": 22, "description": "teacher in school"},
                {"id": "crgwewrtlicdqn60bdjf4m0", "name": "Bob", "age": 30, "description": "software engineer with Java skills"},
                {"id": "crgqugfhcdqn60bdjf4m0", "name": "Ivan", "age": 40, "description": "manager in big company"},
            ]
            table_id = "abc_tset_table"
            full_url_to_dev_public = "https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/" + table_id
            headers = {
                'Content-Type': 'application/json'
            }
            json_to_post = {"data":test_data}
            response = requests.post(full_url_to_dev_public, data=json.dumps(json_to_post), headers=headers)
            assert response.status_code == 201
            print("DB table created: ", response.json()['db_name'])
            print(response.json())
        except requests.RequestException as e:
            print("Error: uploading json." + e)
        return None
        
    

PUT additional JSON

At any point of time you can add additional data to your AI Search data.

Use the same url, but now with PUT: https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/abc_tset_table

Pay attention to the fact that if all identity values match with existing key it will be updated to the new the value. If not all identity fields match - a new record will be added.

Example:

        
    def add_to_file():
        try:
            add_data = [
                {"id": "crgqugfhcdsadf0bdjf4m0", "name": "Nikole", "age": 34, "description": "working in airlines"},
                {"id": "crgqugfhc34gshdbdjf4m0", "name": "Sara", "age": 28, "description": "going back home, eating pizza"},
            ]
            table_id = "abc_tset_table"
            full_url_to_dev_public = "https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/" + table_id
            headers = {
                'Content-Type': 'application/json'
            }
            json_to_post = {"data":add_data}
            response = requests.put(full_url_to_dev_public, data=json.dumps(json_to_post), headers=headers)
            assert response.status_code == 200
            print("Data added to DB table: ", response.json()['db_name'])
            print(response.json())
        except requests.RequestException as e:
            print("Error: uploading json." + e)
        return None
        
    

DELETE records by key

To delete records you need to provide JSON Array only with one key field values. See Example in code.

Use the same url, now with DELETE: https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/abc_tset_table

Example:

        
    def delete_from_file():
        try:
            delete_keys = [
                {"id": "crgqulicdasdfbdjf4m0"},
                {"id": "crgqugfhcdqn60bdjf4m0"}
            ]
            table_id = "abc_tset_table"
            full_url_to_dev_public = "https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/" + table_id
            headers = {
                'Content-Type': 'application/json'
            }
            json_to_post = {"data":delete_keys}
            response = requests.delete(full_url_to_dev_public, data=json.dumps(json_to_post), headers=headers)
            assert response.status_code == 200
            print("Data DELETED to DB table: ", response.json()['db_name'])
            print(response.json())
        except requests.RequestException as e:
            print("Error: deleting json." + e)
        return None
        
    

Start Question Answer your TABLE

Example of Function to Question Answer your json data uploaded above:

        
    def query_uploaded_table(table_id, query):
        try:
            full_url_to_dev_public = "https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/" + table_id
            headers = {
                'Content-Type': 'application/json'
            }
            search_result = requests.get(full_url_to_dev_public + "?query_param=" + query, headers=headers)
            return search_result.json()
        except requests.RequestException as e:
            print("Error: reading data." + e)
        return None
        
    

Example of usage:

        
    if __name__ == '__main__':
        post_test_json()
        add_to_file()
        table_id = "abc_tset_table"
        query = "who is planning to eat?"
        print("Query: " + query)
        query_response = query_uploaded_table(table_id, query)
        print("Answer:" + query_response['result']['companies'][0]['loaded_data_categories']['description'])

        
    

Get blazingly fast hints from your captions

Some of your input data is indexed automatically for automatic hinting. That is usually caption or title text data.

Example of Function to get hints - just add /hints:

        
    def query_uploaded_table(table_id, query):
        try:
            full_url_to_dev_public = "https://www.table-search.com/api/ai_search/v1/target-group-http-ai-linked-dev/" + table_id + "/hints"
            headers = {
                'Content-Type': 'application/json'
            }
            search_result = requests.get(full_url_to_dev_public + "?query_param=" + query, headers=headers)
            return search_result.json()
        except requests.RequestException as e:
            print("Error: reading data." + e)
        return None
        
    

Example of usage:

        
    if __name__ == '__main__':
        post_test_json()
        add_to_file()
        table_id = "abc_tset_table"
        query = "who is planning to eat?"
        print("Query: " + query)
        query_response = query_uploaded_table(table_id, query)
        print("Answer:" + query_response['result']['companies'][0]['loaded_data_categories']['description'])

        
    

Production Secure access

For Production in headers, you must provide a secrete value with the name: X-ai-linked-token

For POST/PUT/DELETE - use write secrete; for GET use - read secrete.

Please check the example below, pay attention to headers, and URL instead of public you must use your client_id:

        
    def query_uploaded_table(table_id, query):
        try:
            full_url_to_dev_public = "https://www.table-search.com/api/ai_search/v1/client_id/" + table_id
            headers = {
                'Content-Type': 'application/json',
                'X-ai-linked-token': 'your-read-level-secrete-here'
            }
            ...
        
    

Last updated: 08/19/2024