Chat API Integration

If you prefer to build your own user interface, chat functionality integration via API key is available.

1. Retrieving API Key

once you have created your knowledge base, you can get the API key through :

  1. Knowledge Base list menu (API Key Column)

  1. Edit Knowledge Base (Under API Key section)

2. Creating API Request

Request

  • make your request (method: POST) to this endpoint : https://api.temaninsight.com/api/public/partners/knowledgebases/ask

  • message : input your question that you want to send

  • session_id (Optional) : this is a chatroom identifier.

    • In the beginning of conversation you might not need to include this.

    • However, once you receive your first response from API , you will get session_id.

    • If you want the AI to be able to get the context within the same conversation (chatroom) , you need to include this session_id when you sending request

Response

  • answer : this is the answer from the AI

  • embeddings : array of strings contains images that are retrieved by the AI. This value is null if you turn this off on Knowledge Base edit page. please note that this field is still in beta

  • session_id : use this value if you want to make the AI answering your question with existing conversation as a context

Last updated