Tiledesk Developer Hub
WebsiteCommunityTutorialsGet started
  • Introduction
  • Community
  • Ask for Support
  • Public Roadmap and Changelog
  • Tutorials
  • Widget
    • Widget SDK
    • Javascript API: Methods
    • Javascript API: Attributes
    • Javascript API: Listeners/Events
    • Widget Authentication
    • Widget Angular integration
    • Widget React integration
    • Widget for Android with WebView
    • Widget for iOS with WKWebView
    • Widget for Flutter with WebView
    • Widget for React with WebView
    • Widget for Wix Website platform
    • Tutorials
      • Hide widget
      • Show/Hide widget programmatically
      • Force widget loading without user interaction
      • Mobile positioning
      • Custom size (width/height)
      • Installing widget on selected pages
    • Conversation Embedded Apps
      • Payment App Tutorial
      • Prechat form App Tutorial
    • Advanced
      • Preset the Widget on a specific Department
      • Authentication Flow
      • Widget protocol specs
      • Prechat Form JSON specs
      • Prevent multiple conversations
      • Old versions
        • Web SDK v4
  • External Chatbot
    • Introduction
    • Hello World tutorial
    • Chatbot to Human handoff
    • Send Text Buttons
    • Advanced Tutorials
      • Introduction
      • Tutorial 1 - Dialogflow as external chatbot
      • Tutorial 2 - Buttons and images
      • Tutorial 3 - Automatic human handoff with fallback intent
      • Tutorial 4 - Explicit Human handoff with user intent
      • Tutorial 5 - Gracefully handling operating hours during handoff
      • Generate Dialogflow Google Credentials file
    • Rasa tutorials
      • Rasa Tutorial 1 - Rasa as external chatbot
  • Resolution bot
    • Introduction
    • Quickstart
    • Webhook service
    • Rich messages
    • Tutorials
      • Chatbot chooser (multilanguage)
      • Department chooser
      • Order info (webhook)
  • APIs
    • REST APIs
      • Introduction
      • Authentication
      • Requests
      • Leads
      • Messages
      • Activities
      • Projects
      • Team
      • User
      • Analytics
      • Canned responses
      • Tags
      • Events
      • Jwt
      • Labels
      • Images
      • Files
      • Segments
      • Chatbots
      • Knowledge Bases
        • Knowledge Base
        • Contents
        • Question & Answer
      • Management Api
        • Departments
        • Groups
    • NodeJS SDK
    • Webhooks
      • Subscriptions
    • Conversation Messages APIs tips
    • Realtime API
    • JWT Authentication
      • JWT Custom authentication Tutorial
    • Tutorials
      • REST API
        • Sending and receiving messages with Tiledesk APIs
        • PHP Tiledesk REST API example
        • Import multiple messages into Tiledesk using REST APIs from third party app
      • Webhooks
        • Custom Request assignment
        • Request transcript on close
  • Apps
    • Build Custom App - Quick start
    • External Channels integration flow diagram
    • Telegram integration tutorial
  • Dashboard & AgentChat SDK
    • Dashboard SDK
    • Agent Chat SDK
  • Architecture
    • Architecture overview
    • Components list
    • Bot Design diagram
    • Multi Channel Message Flow
  • Installation
    • Installation
    • Running Tiledesk using Docker Compose
    • Running Tiledesk with Kubernetes using Helm
    • Choosing Hardware
  • Configuration
    • Chat21 channel configuration
    • Email parameters and templates configuration
    • Configure the logging system
Powered by GitBook
On this page
  • The Knowledge Base model
  • Ask the Knowledge Base

Was this helpful?

  1. APIs
  2. REST APIs
  3. Knowledge Bases

Question & Answer

Allows to query the knowledge base using a specific AI model.

The Knowledge Base model

Key
Type
Description

id

String

The unique identifier for the knowledge base which is given by Tiledesk.

name

String

The knowledge base name.

id_project

String

The unique identifier of the project

preview_settings

Object

The settings for the knowledge base preview

default

Boolean

Specify if the knowledge base is the default one

Ask the Knowledge Base

POST https://api.tiledesk.com/v3/:project_id/kb/qa

Allows to query the knowledge base using a specific AI model.

Path Parameters

Name
Type
Description

project_id

string

The Project Id is a unique code assigned to your project when you create it in Tiledesk.

Headers

Name
Type
Description

Authorization

string

Authorization token. Basic Auth or JWT

Request Body

Name
Type
Description

question

string

The question submitted

namespace

string

The id of the Knowledge Base in which to search for the answer

model

string

The model to use to generate the response (e.g. gpt-4o)

system_context

string

(Optional) The context to give to the AI ​​to shape its behavior in generating the response.

max_tokens

Number

The maximum number of tokens that can be consumed to generate the response

temperature

Number

defines creativity in generating responses (low values ​​determine more specific and predictable responses)

max_tokens

Number

The number of nearby chunks to use to generate the response

{
    "answer": "To create an AI assistant using OpenAI, you can follow these steps:\n\n1. **Visit OpenAI**: Navigate to the OpenAI website.\n2. **Access the API Section**:\n   - Go to ‘Products’, then select ‘API’.\n   - Log in and select ‘API’.\n3. **Navigate to Assistant Creation**:\n   - Ensure you are on the Dashboard.\n   - Click on ‘Assistant’ from the left sidebar menu.\n4. **Create the Assistant**:\n   - Click the green ‘Create’ button in the top right corner.\n   - Name your assistant and provide context in the ‘Instructions’ section to fine-tune its responses.\n5. **Select the Model**:\n   - For this example, you can use GPT-4o.\n6. **Handle File Formats**:\n   - If uploading a CSV file, use a Code interpreter.\n   - For PDF or text files, use the File Search feature.\n7. **Integrate with Tiledesk**:\n   - Copy the assistant ID.\n   - Go to the Tiledesk dashboard, click on the block where the ChatGPT Assistant is placed.\n   - In the right-side menu, paste the assistant ID into the “Assign GPT Assistant” field.\n\nIf you need",
    "success": true,
    "namespace": "66a897133eaa7f0013632c5b",
    "id": "66b6268722af86ab6a739cb6",
    "ids": [
        "66b6268722af86ab6a739cb6"
    ],
    "source": "https://gethelp.tiledesk.com/articles/create-an-ai-assistant-in-openai/",
    "sources": [
        "https://gethelp.tiledesk.com/articles/create-an-ai-assistant-in-openai/"
    ],
    "content_chunks": null,
    "prompt_token_size": 1185,
    "error_message": null,
    "chat_history_dict": {
        "0": {
            "question": "how can i create an AI assistant?",
            "answer": "To create an AI assistant using OpenAI, you can follow these steps:\n\n1. **Visit OpenAI**: Navigate to the OpenAI website.\n2. **Access the API Section**:\n   - Go to ‘Products’, then select ‘API’.\n   - Log in and select ‘API’.\n3. **Navigate to Assistant Creation**:\n   - Ensure you are on the Dashboard.\n   - Click on ‘Assistant’ from the left sidebar menu.\n4. **Create the Assistant**:\n   - Click the green ‘Create’ button in the top right corner.\n   - Name your assistant and provide context in the ‘Instructions’ section to fine-tune its responses.\n5. **Select the Model**:\n   - For this example, you can use GPT-4o.\n6. **Handle File Formats**:\n   - If uploading a CSV file, use a Code interpreter.\n   - For PDF or text files, use the File Search feature.\n7. **Integrate with Tiledesk**:\n   - Copy the assistant ID.\n   - Go to the Tiledesk dashboard, click on the block where the ChatGPT Assistant is placed.\n   - In the right-side menu, paste the assistant ID into the “Assign GPT Assistant” field.\n\nIf you need"
        }
    }
}

Example

curl -v -X GET -u giovanni@tiledesk.com:password -d {"question":"how can i create an AI assistant?","namespace":"66a897133eaa7f0013632c5b","model":"gpt-4o","temperature":0.7,"max_tokens":256,"top_k":4,"system_context":null} https://api.tiledesk.com/v3/63ad512e70d5ed0012ad6286/kb/qa

PreviousContentsNextManagement Api

Last updated 7 months ago

Was this helpful?