Skip to content

Online Operations

Jael Gu edited this page Jun 5, 2023 · 2 revisions

Visit Deployment to start an API service. With APIs below, you are able to interact with the system.

Chat

/answer

This API allows context-support and knowledge-enhanced conversation with user, it retrieves information from project-specific knowledge base and uses different sessions to manage chat history.

  • Parameters:

    • session_id (str): a unique session is used for the chat history of each conversation, which enables context support.
    • project (str): a project name is normally the table name in each store with project-specific data.
    • question (str): a user query.
  • Response:

    [
        {
            "status": true,
            "msg": "answer content is here."
        },
        200
    ]

Add Project

/project/add

This API builds knowledge base for a specific project with data from either website or local file.

Please note this is an online operations, which is only recommended for a small and simple data insert. Refer to Offline Tools if you want to insert a large scale of data or utilize advanced tools such as question generator.

  • Parameters:

    • data_src (str): the source of data is where document is load from, either path or url of the document.
    • project (str): a project name is normally the table name in each store with project-specific data
    • source_type (str = 'file'): the source type specifies the type of data source, value of which is either "file" or "url".
  • Response:

    [
        {
            "status": true,
            "msg": "Successfully inserted doc chunks: num_chunks"
        },
        200
    ]

Drop Project

/project/drop

This API will clean all project-related data in stores, including deleting tables from vector store, scalar store, and memory store.

This action deletes data so the system adds a projection rule for it: you need to double confirm (enter 'y') at the backend to drop project.

  • Parameters:

    • project (str): a project name is normally the table name in each store with project-specific data
  • Response:

    [
        {
            "status": true,
            "msg": "Dropped project: project_name"
        },
        200
        ]
Clone this wiki locally