Beispiel #1
0
def view_kbases(server_name, suff, org_id, token, limit=5):
    # VIEW Knowledge-Base
    resp_list = kbase.view_kbase(server_name, suff, org_id, token, limit=limit)
    return resp_list
Beispiel #2
0
    token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcmdJZCI6IjNhZTZiZDhiLTIzYjYtNDdjNy1hOWEwLThkYzU2ODMzY2ExOCIsImV4cCI6MTU3MTUyNjUxMiwiaWF0IjoxNTcxNTIyOTEyfQ.HVelm58b8HA4yx1PASrO84g8wAiQRCWtv73gYz7WtOQ"

    # payload_info = {"name": "Sample KBase",
    #                "description": "Testing our preliminary kbase!",
    #                "coreLanguage": "en-US"}

    #kbase_responses = {}

    print("-----------------------------------------------------------")
    #kbase.create_kbase(server_name,suff,payload_info,org_id,token,kbase_responses)

    #VIEW Knowledge-Base
    print("-----------------------------------------------------------")
    resp_list = kbase.view_kbase(server_name,
                                 suff,
                                 org_id,
                                 token,
                                 limit=5,
                                 kbase_id=None)
    print(resp_list)
    #List: ['891c0775-18d5-4f4c-9222-314a7ff650ac', '254a5aae-225f-412c-98c2-b1f5dfd6c6b9', 'fd41a9b6-442c-44d5-b6b7-0317d6add350', '68e2b7b8-b3cd-4af0-b21b-f699ea9d3a00', '6bda054f-e54d-4232-96e5-34c59bf2b0f5']

    #Load 5 Docs
    # questions = ["What is the state dessert of Arizona?",
    # "What is the national spirit of America?",
    # "In 1963, which state sold the first fried dill pickle?",
    # "Name the state which is the birthplace of Cheeseburger?",
    # "What is the national dish of Germany?"]
    #
    # answers = ["Lane Cake","Bourbon","Arkansas","Colorado","Pot Roast"]
    #
    kbase1_id = '891c0775-18d5-4f4c-9222-314a7ff650ac'