Skip to content
On this page

Chatbots

Create a personalized AI chatbot trained on your unique content, knowledge base, files, and more. The chatbot can intelligently and automatically answer customer inquiries, providing a seamless customer experience that mirrors your brand voice and values.

The beauty of our service is the flexibility. You have the power to tailor your chatbot according to your specific needs, ensuring it aligns perfectly with your brand and business objectives. Whether it's adjusting the tone of responses, setting the level of creativity, or controlling response length, you can make the chatbot truly your own.

Embrace the power of AI and create a customer interaction platform that works for you, around the clock, and matches the unique requirements of your business.

Create a chatbot

shell
curl --request POST \
  --url https://api.gigachat.ai/chatbots \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
  --data '{
	"name": "first test",
	"response": {
		"n": 1,
		"top_p": 1,
		"stream": true,
		"max_tokens": 200,
		"memory_size": 0,
		"temperature": 0.7,
		"system_persona": "You are a friendly chatbot to help answer questions! Given the following sections from a website, answer the question using only that information. If you are unsure and the answer and it is not explicitly written in the context sections, say \"Sorry, I don't know how to help with that.\"",
		"presence_penalty": 0,
		"frequency_penalty": 0
	},
	"restrictions": {
		"hostnames": [],
		"ip_addresses": []
	},
	"documents": {
		"results": {
			"match_count": 3,
			"match_threshold": 0.78
		},
		"text_splitter": {
			"chunk_size": 1000,
			"chunk_overlap": 200
		}
	}
}'
Response 201
json
{
    "id": "8fb205e5-ff46-4bf6-9d7b-4d770935a486",
    "user_id": "4c4087f4-805f-4cf4-9957-0571faf82a4d",
    "name": "first test",
    "response": {
        "n": 1,
        "top_p": 1,
        "stream": true,
        "max_tokens": 200,
        "memory_size": 0,
        "temperature": 0.7,
        "system_persona": "You are a friendly chatbot to help answer questions! Given the following sections from a website, answer the question using only that information. If you are unsure and the answer and it is not explicitly written in the context sections, say \"Sorry, I don't know how to help with that.\"",
        "presence_penalty": 0,
        "frequency_penalty": 0
    },
    "restrictions": {
        "hostnames": [],
        "ip_addresses": []
    },
    "documents": {
        "results": {
            "match_count": 3,
            "match_threshold": 0.78
        },
        "text_splitter": {
            "chunk_size": 1000,
            "chunk_overlap": 200
        }
    }
}

Update a chatbot

shell
curl --request POST \
  --url https://api.gigachat.ai/chatbots/{chatbot_id} \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
  --data '{
	"id": "8fb205e5-ff46-4bf6-9d7b-4d770935a486",
	"user_id": "4c4087f4-805f-4cf4-9957-0571faf82a4d",
	"name": "first test",
	"response": {
		"n": 1,
		"top_p": 1,
		"stream": true,
		"max_tokens": 200,
		"memory_size": 3,
		"temperature": 0.7,
		"system_persona": "You are a friendly chatbot to help answer questions! Given the following sections from a website, answer the question using only that information. If you are unsure and the answer and it is not explicitly written in the context sections, say \"Sorry, I don't know how to help with that.\"",
		"presence_penalty": 0,
		"frequency_penalty": 0
	},
	"restrictions": {
		"hostnames": [],
		"ip_addresses": []
	},
	"documents": {
		"results": {
			"match_count": 3,
			"match_threshold": 0.78
		},
		"text_splitter": {
			"chunk_size": 1000,
			"chunk_overlap": 200
		}
	}
}'

The request accepts a JSON object with the name property being required. To see all available properties, see the chatbot schema.

Response 201
json
{
    "id": "8fb205e5-ff46-4bf6-9d7b-4d770935a486",
    "user_id": "4c4087f4-805f-4cf4-9957-0571faf82a4d",
    "name": "first test",
    "response": {
        "n": 1,
        "top_p": 1,
        "stream": true,
        "max_tokens": 200,
        "memory_size": 0,
        "temperature": 0.7,
        "system_persona": "You are a friendly chatbot to help answer questions! Given the following sections from a website, answer the question using only that information. If you are unsure and the answer and it is not explicitly written in the context sections, say \"Sorry, I don't know how to help with that.\"",
        "presence_penalty": 0,
        "frequency_penalty": 0
    },
    "restrictions": {
        "hostnames": [],
        "ip_addresses": []
    },
    "documents": {
        "results": {
            "match_count": 3,
            "match_threshold": 0.78
        },
        "text_splitter": {
            "chunk_size": 1000,
            "chunk_overlap": 200
        }
    }
}

Get all chatbot

shell
curl --request GET \
  --url https://api.gigachat.ai/chatbots \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
Response 200
json
[
	{
		"id": "8fb205e5-ff46-4bf6-9d7b-4d770935a486",
		"user_id": "4c4087f4-805f-4cf4-9957-0571faf82a4d",
		"name": "first test",
		"response": {
			"n": 1,
			"top_p": 1,
			"stream": true,
			"max_tokens": 200,
			"memory_size": 0,
			"temperature": 0.7,
			"system_persona": "You are a friendly chatbot to help answer questions! Given the following sections from a website, answer the question using only that information. If you are unsure and the answer and it is not explicitly written in the context sections, say \"Sorry, I don't know how to help with that.\"",
			"presence_penalty": 0,
			"frequency_penalty": 0
		},
		"restrictions": {
			"hostnames": [],
			"ip_addresses": []
		},
		"documents": {
			"results": {
				"match_count": 3,
				"match_threshold": 0.78
			},
			"text_splitter": {
				"chunk_size": 1000,
				"chunk_overlap": 200
			}
		}
	}
]

Get chatbot by ID

shell
curl --request GET \
  --url https://api.gigachat.ai/chatbots/{chatbot_id} \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
Response 200
json
{
    "id": "8fb205e5-ff46-4bf6-9d7b-4d770935a486",
    "user_id": "4c4087f4-805f-4cf4-9957-0571faf82a4d",
    "name": "first test",
    "response": {
        "n": 1,
        "top_p": 1,
        "stream": true,
        "max_tokens": 200,
        "memory_size": 0,
        "temperature": 0.7,
        "system_persona": "You are a friendly chatbot to help answer questions! Given the following sections from a website, answer the question using only that information. If you are unsure and the answer and it is not explicitly written in the context sections, say \"Sorry, I don't know how to help with that.\"",
        "presence_penalty": 0,
        "frequency_penalty": 0
    },
    "restrictions": {
        "hostnames": [],
        "ip_addresses": []
    },
    "documents": {
        "results": {
            "match_count": 3,
            "match_threshold": 0.78
        },
        "text_splitter": {
            "chunk_size": 1000,
            "chunk_overlap": 200
        }
    }
}

Delete chatbot by ID

shell
curl --request DELETE \
  --url https://api.gigachat.ai/chatbots/{chatbot_id} \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <API_KEY>' \
Response 204

No content

Request Properties

Gain substantial control over the behavior of the AI model when generating responses. You can specify the number of responses the AI should produce, adjust the degree of randomness in the AI's output, and determine whether the AI should deliver responses all at once or gradually over time.

These configurations also let you manage the maximum length of responses, define how much past interaction the model should remember, and set the creativity level in the output. You can further establish a consistent character for your model and discourage the model from using or repeating certain words or phrases. In essence, these settings enable you to tailor the AI's behavior to suit your specific application needs.

Table 1: Main Properties

PropertyDescriptionRequiredDefault Value
nameThe name of the testYes
responseAn object containing properties related to the responseNo
restrictionsAn object containing restrictions for the requestNo
documentsAn object containing properties related to the documentsNo

Table 2: Response Properties

PropertyDescriptionRequiredDefault Value
nSpecifies the number of responses to generateNo1
top_pDetermines the subset of probable tokens the model should considerNoNone
streamSpecifies whether the response should be streamedNoFalse
max_tokensSets the maximum number of tokens in the responseNoNone
memory_sizeDefines the memory size for the requestNoNone
temperatureControls the creativity of the responsesNoNone
system_personaSets the personality of the chatbotNoNone
presence_penaltyPenalizes certain tokens from appearing in the responseNoNone
frequency_penaltyPenalizes the repetition of certain tokens in the responseNoNone

Table 3: Restrictions Properties

PropertyDescriptionRequiredDefault Value
hostnamesAn array containing restricted hostnamesNo
ip_addressesAn array containing restricted IP addressesNo

Table 4: Documents Properties

PropertyDescriptionRequiredDefault Value
resultsAn object with properties related to the resultsNo
text_splitterAn object with properties for splitting the textNo

Table 5: Results Properties

PropertyDescriptionRequiredDefault Value
match_countThe count of matchesNo
match_thresholdThe threshold for considering a matchNo

Table 6: Text Splitter Properties

PropertyDescriptionRequiredDefault Value
chunk_sizeThe size of each text chunkNo
chunk_overlapThe overlap between each text chunkNo