Briano AI
    Briano AI
    • Briano Chat API

    Briano Chat API

    Create new Thread#

    Endpoint#

    POST /{locale}/threads

    Description#

    Creates a new thread in the specified locale.

    Parameters#

    NameTypeLocationRequiredDescription
    localestringpathYesThe locale in which the thread is created.
    authorizationstringheaderYesThe authorization token required for authentication. format: Bearer {token}

    Request Body#

    The request body should be a JSON object with the following structure:

    Request Body Parameters#

    NameTypeRequiredDescription
    configobjectNoConfiguration for the request.
    config.search_typestringNoThe type of search values: ["vector_search", "assistant"] default: "vector_search".
    config.typestringNoThe type of request values: ["chat", "assistant"] default: "chat".
    providerstringNoThe provider handling the request, default: "briano"

    Request Body#

    {
      "config": {
        "search_type": "vector_search",
        "type": "chat"
      },
      "provider": "briano"
    }

    Responses#

        {
            "data": {
                "id": "briano_0d582974-6833-435e-8148-9d43228cadc0"
            }
        }
    200 OK: On successful creation of the thread.
    400 Bad Request: If there are any errors during the creation of the message. The response body contains an errors field with the error details.

    Add new Message to the Thread#

    Endpoint#

    POST /{locale}/threads/messages

    Description#

    add user message to thread.

    Parameters#

    NameTypeLocationRequiredDescription
    localestringpathYesThe locale in which the thread is created.
    authorizationstringheaderYesThe authorization token required for authentication. format: Bearer {token}

    Request Body Parameters#

    NameTypeRequiredDescription
    textstringYesmessage text.
    thread_idstringYesid return from create thread api

    Request Body#

    The request body should be a JSON object with the following structure:
        {
            "text": "გამარჯობა",
            "thread_id": "briano_0d582974-6833-435e-8148-9d43228cadc0"
        }

    Responses#

        {
        "message": {
            "id": "chat_message",
            "role": "user",
            "thread_id": "briano_0d582974-6833-435e-8148-9d43228cadc0",
            "content": [
                "გამარჯობა"
            ],
            "status": "completed"
        }
    }

    Open Web Socket to receive AI responce#

    Endpoint#

    WebSocket /{locale}/threads/ws/{thread_id}?token={token}

    Description#

    Retrieve BRIANO AI response

    Parameters#

    NameTypeLocationRequiredDescription
    localestringpathYesThe locale in which the thread is created.
    authorizationstringheaderYesThe authorization token required for authentication. wihout Bearer

    Responses#

    {
        "message": {
            "id": "chat_message",
            "role": "assistant",
            "thread_id": "briano_0d582974-6833-435e-8148-9d43228cadc0",
            "content": ["გამარჯობა! მე ვარ BRIATO-ის AI ასისტენტი. როგორ შემიძლია დაგეხმაროთ?"],
            "tool_calls": [],
            "tool_outputs": [],
            "backend_data": [],
            "status": "completed"
        },
        "status": "completed"
    }

    Get existing messages from the Thread#

    Endpoint#

    GET /{locale}/threads/messages/{thread_id}

    Description#

    get current thread messages

    Parameters#

    NameTypeLocationRequiredDescription
    localestringpathYesThe locale in which the thread is created.
    authorizationstringheaderYesThe authorization token required for authentication. format: Bearer {token}
    thread_idstringpathYesThe id of thread

    Responses#

    {
        "messages": [
            {
                "id": "chat_message",
                "role": "user",
                "thread_id": "briano_0d582974-6833-435e-8148-9d43228cadc0",
                "content": ["გამარჯობა"],
                "status": "completed"
            },
            {
                "id": "chat_message",
                "role": "assistant",
                "thread_id": "briano_0d582974-6833-435e-8148-9d43228cadc0",
                "content": ["გამარჯობა! მე ვარ BRIATO-ის AI ასისტენტი. როგორ შემიძლია დაგეხმაროთ?"],
                "tool_calls": [],
                "tool_outputs": [],
                "backend_data": [],
                "status": "completed"
            }
        ]
    }
    200 OK: On successful retrieval of the messages. The response body contains a messages field with the list of messages from the thread.
    400 Bad Request: If there are any errors during the retrieval of the messages. The response body contains an errors field with the error details.
    Modified at 2025-03-07 12:07:12
    Built with