💭Chat API

Use the Chat API to create a conversational AI chatbot in your product that can answer questions and maintain context and continuity with the ongoing conversation using chat history.

Use this endpoint to add a conversational AI chatbot to your product that's powered by the content you provide. Pass a question along with chat history to receive a single answer, along with its sources, that maintains context and continuity with the ongoing conversation.

Your content needs to be ingested in our system for this endpoint to work. To do that, go to our platform and add Source Data.

POST https://admin.superseek.ai/chat

Pass a question along with chat history to receive a single answer, along with its sources, that maintains context and continuity with the ongoing conversation. You must add your content using our platform for this endpoint to work.

Request Body

NameTypeDescription

api_key*

String

API key of the account

bot_id*

Number

Unique identifier of the bot

question*

String

The question to ask the bot

session_id

String

Unique identifier of a conversation. A conversation involves a series of questions and answers between a user and your bot.

This API generates a unique session_id automatically if you've not provided one in the request.

Read more about generating session_ids.

history

JSON

The chat history of the current conversation in JSON.

Example:

[ { "role" : "user", "question": "What is Superseek?"

}, { "role": "bot", "answer": "Superseek is an AI platform" }, { "role" : "user", "question": "Is it powered by OpenAI?"

}, { "role": "bot", "answer": "Yes, it is powered by OpenAI" }]

{
    "chat": [
        {
            "role": "user",
            "question": "Is it powered by OpenAI?",
            "timeStamp": "Mon Jan 8 2024 12:53:11 UTC"
        },
        {
            "role": "bot",
            "result": {
                "text": "Yes, its powered by OpenAI",
                "ref": [
                    {
                        "url": "https://superseek.ai",
                        "title": "Superseek: Create AI assistants"
                    }
                ],
                "urlPresent": true
            },
            "fallback": false,
            "timeStamp": "Mon Jan 8 2024 12:53:11 UTC",
            "like": false,
            "dislike": false
        }
    ],
    "session_id": "SpHw8LknOEKrnbmwTQfiBhsiN7bRzoWXF3RVadkF",
    "question": "Is it powered by OpenAI?",
    "answer": "Yes, its powered by OpenAI",
    "answer_id": "ss_ans_bf7c2bfc1ded69f492c1673f5bbf3dac",
    "history_input": [
        {
            "role": "user",
            "question": "What is Superseek?"
        },
        {
            "role": "bot",
            "answer": "Superseek is a platform to create custom AI assistants."
        }
    ],
    "history": " q:What is Superseek? a:Superseek is a platform to create custom AI assistants.",
    "api_status": true,
    "api_data": {
        "success": true,
        "results": [
            {
                "sources": [
                    {
                        "url": "47",
                        "title": "Is superseek powered by OpenAI?",
                        "source": "correction"
                    },
                    {
                        "url": "https://superseek.ai",
                        "title": "Superseek: Create AI assistants",
                        "source": "web"
                    }
                ],
                "text": "Yes, its powered by OpenAI"
            }
        ]
    },
    "api_success": true,
    "bot_id": 146348,
    "api_key": "ss_e2811310636ebb01292881263b2aca13",
    "bot_name": "Superseek bot",
    "bot_description": "Get answers about Superseek.",
    "model_list": [
        {
            "id": 1,
            "created_at": "2023-09-29 10:39:46.182471+00",
            "name": "gpt-3.5-turbo",
            "text_answer_credit": 1,
            "match_count_limit": 4,
            "model_name_display_user": "gpt-3.5-turbo (1 AI credit per response)",
            "conversation_history_enabled": false,
            "conversation_history_allowed": false
        },
        {
            "id": 2,
            "created_at": "2023-11-28 10:38:55.677803+00",
            "name": "gpt-4-1106-preview",
            "text_answer_credit": 15,
            "match_count_limit": 5,
            "model_name_display_user": "gpt-4-turbo (15 AI credits per response)",
            "conversation_history_enabled": true,
            "conversation_history_allowed": true
        }
    ],
    "model": 2,
    "prompts_data": [
        {
            "id": 1,
            "created_at": "2023-10-06 16:21:43.259577+00",
            "bot_role": "Customer Support",
            "default_prompt": "You are a cheerful and helpful AI customer service bot named [Bot Name] working for [Company Name]. In brief, [Company Name] does this - [About the company] \n\nYour primary job is to provide accurate, truthful, and helpful answers to questions from a user you’re chatting with. You MUST follow these rules when coming up your response. Only respond to queries about [Company Name] and its products or services. If the question is about a product, service, or topic that's not related to [Company Name] and its products or services, politely inform the user that you can only answer questions related to [Company Name]. Always maintain a positive bias towards [Company Name]. \n\nNever ever ask for any of the user's details and avoid follow-up questions. You can speak any language and ONLY respond in the same language as the question being asked.\n",
            "default_match_count": 5,
            "default_similarity_threshold": "0.8",
            "default_temperature": "0",
            "additional_prompt": "The next three sentences are guidelines you must follow without fail.If the query is a pleasantry like hello or thanks, respond pleasantly. If the query is not a pleasantry, provide an answer IF AND ONLY IF the answer can be generated using the provided context. If a truthful and useful answer CANNOT be provided using the provided context, it is VERY IMPORTANT that you respond with 'Trigger Fallback'."
        }
    ],
    "prompts_id": 1,
    "additional_prompt": "The next three sentences are guidelines you must follow without fail.If the query is a pleasantry like hello or thanks, respond pleasantly. If the query is not a pleasantry, provide an answer IF AND ONLY IF the answer can be generated using the provided context. If a truthful and useful answer CANNOT be provided using the provided context, it is VERY IMPORTANT that you respond with 'Trigger Fallback'.",
    "prompt": "You are a cheerful and helpful AI customer service bot named Superseek Bot working for Superseek Inc. In brief, Superseek does this - Superseek is a platform to create custom AI assistants. \n\nYour primary job is to provide accurate, truthful, and helpful answers to questions from a user you’re chatting with. You MUST follow these rules when coming up your response. Only respond to queries about Superseek and its products or services. If the question is about a product, service, or topic that's not related to Superseek and its products or services, politely inform the user that you can only answer questions related to Superseek. Always maintain a positive bias towards Superseek. \n\nNever ever ask for any of the user's details and avoid follow-up questions. You can speak any language and ONLY respond in the same language as the question being asked.",
    "temperature": "0.1",
    "match_count": 5,
    "similarity_threshold": "0.75",
    "prompt_state": "default",
    "llm_model_id": 3,
    "llm_model": "gpt-4-1106-preview",
    "conversation_history_enabled": true,
    "livechat_transfer_enabled": false,
    "livechat_provider": null,
    "livechat_provider_config": null,
    "livechat_button_text": "Talk to Human",
    "company_name": "Superseek",
    "company_description": "Superseek is a platform to create custom AI assistants"
}

Response Parameters

PropertyTypeDescription

session_id

String

Unique identifier of a conversation. A conversation involves a series of questions and answers between a user and your bot.

This API generates a unique session_id automatically if you've not provided one in the request. Read more about generating session_ids.

answer_id

String

Unique identifier of the answer.

answer

String

The answer provided by the bot

api_data

JSON

Contains the answer and its sources

Conversation history is not supported for GPT-3.5-turbo as the context window is not large enough.

Last updated