Agent API
Agent service API Documentation
Version: 1.0.6
HOME SCREEN OF CREATE BOT
Paths
Health check API -
/aiwb/bot/api/v1/healthz
- Method: GET
- Summary: Health
- Description: Return Health Status. :return:
- Responses:
- 200:
- Description: Successful Response
- Content-Type: application/json
- 200:
List Chat Bots API
/aiwb/bot/api/v1/
Method:
GET
Summary: List Chat Bots
Description: The List Chat Bots API provides functionality to retrieve a list of available chat bots. This API allows users to obtain information about multiple chat bots, such as their names, descriptions, versions, and other relevant metadata.
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"page_no":1,
"page_size":10,
"filter":"String",
"is_published":"True/False",
"order":"asc/desc"
}
response = requests.get(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": "200",
"total_bot_count": 2,
"chat_bots": [
{
"chat_bot_id": "d781c0f9-3b95-45b4-8de5-dede1521c4dd",
"chatbotName": "George Washington",
"creation_time": "2023-12-18T03:29:39",
"chatbotDescription": "This Bot is Capable of addressing queries about George Washington",
"modelId": "Anthropic"
},
{
"chat_bot_id": "2d1e5624-46d6-49f6-bf7c-fa6f16c0f693",
"chatbotName": "Summarization",
"creation_time": "2023-12-18T17:35:56",
"chatbotDescription": "This Bot is Capable of Summarizing the Texts",
"modelId": "1"
}
]
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Bots Listed Successfully | application/json |
400 | Bad Request | application/json |
404 | Resource Not Found | application/json |
500 | Internal Server Error | application/json |
422 | Validation Error | application/json |
Create Chat Bot API
/aiwb/bot/api/v1/
Method:
POST
Summary: Create Chat Bot
Description: This API empowers users to design and configure a chat bot according to specific requirements.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
Query Parameter | chatbotName | The name of the chat bot | string | mandatory |
Query Parameter | chatbotDescription | The description of the chat bot | string | optional |
Query Parameter | folder_ids | List of folder IDs associated with the chat bot | array of strings | optional |
Query Parameter | object_ids | List of object IDs associated with the chat bot | array of strings | optional |
Query Parameter | modelId | Model ID for the chat bot (OpenAI, Palm) | string | mandatory |
Query Parameter | modelVersion | Model version for GPT (e.g., "gpt-35-turbo", "gpt-4") or for Palm (e.g., "chat-bison@001") | string | optional |
Query Parameter | context | Context for chat generation | string | optional |
Query Parameter | temperature | Controls the level of randomness or 'creativity' in the generated text | number (float) | optional |
Query Parameter | max_tokens | Maximum length that the model is allowed to generate | integer | optional |
Query Parameter | top_p | Manages the randomness of the output text | number (float) | optional |
Query Parameter | top_k | Signifies sampling from k most likely next tokens at each step | integer | optional |
Query Parameter | frequency_penalty | Ensures that the model does not repeat the same words or phrases too frequently | number (float) | optional |
Query Parameter | presence_penalty | Ensures that the model includes a diverse range of tokens in the output text | number (float) | optional |
Query Parameter | best_of | Number of completions to generate and return the best one | integer | optional |
Query Parameter | guard_rail | List of guard rail conditions | array | optional |
Query Parameter | examples | List of example prompts for the chatbot | array | optional |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbotName": "string",
"chatbotDescription": "string",
"folder_ids": [],
"object_ids": [],
"modelId": "string",
"modelVersion": "string",
"context": "string",
"temperature": 2,
"max_tokens": 1,
"top_p": 1,
"top_k": 1,
"frequency_penalty": 2,
"presence_penalty": 2,
"best_of": 1,
"guard_rail": [],
"examples": []
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": 201,
"message": "string",
"chat_bot_id": "string"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
201 | Bot Created Successfully | application/json |
400 | Bad Request | application/json |
409 | Conflict - Bot Already Present | application/json |
500 | Internal Server Error | application/json |
422 | Validation Error | application/json |
Get Chat Bot By Id API
/aiwb/bot/api/v1/{chatbot_global_id}
- Method:
GET
- Summary: Get Chat Bot By Id
- Description: This API allows users to fetch a specific chat bot using its unique ID (
chatbot_global_id
). It is useful for retrieving detailed information about a particular chat bot.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbot_global_id":"string"
}
response = requests.get(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": 200,
"message_id": 1,
"message": "Hello"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Bot Get | application/json |
400 | Bad Request | application/json |
403 | Forbidden | application/json |
404 | Resource Not Found | application/json |
500 | Internal Server Error | application/json |
422 | Validation Error | application/json |
Update Chat Bot By Id API
/aiwb/bot/api/v1/{chatbot_global_id}
- Method:
PUT
- Summary: Update Chat Bot By Id
- Description: This API enables users to modify and enhance an existing chat bot.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
Query Parameter | chatbotName | The name of the chat bot | string | mandatory |
Query Parameter | chatbotDescription | The description of the chat bot | string | optional |
Query Parameter | folder_ids | List of folder IDs associated with the chat bot | array of strings | optional |
Query Parameter | object_ids | List of object IDs associated with the chat bot | array of strings | optional |
Query Parameter | modelId | Model ID for the chat bot (OpenAI, Palm) | string | mandatory |
Query Parameter | modelVersion | Model version for GPT (e.g., "gpt-35-turbo", "gpt-4") or for Palm (e.g., "chat-bison@001") | string | optional |
Query Parameter | context | Context for chat generation | string | optional |
Query Parameter | temperature | Controls the level of randomness or 'creativity' in the generated text | number (float) | optional |
Query Parameter | max_tokens | Maximum length that the model is allowed to generate | integer | optional |
Query Parameter | top_p | Manages the randomness of the output text | number (float) | optional |
Query Parameter | top_k | Signifies sampling from k most likely next tokens at each step | integer | optional |
Query Parameter | frequency_penalty | Ensures that the model does not repeat the same words or phrases too frequently | number (float) | optional |
Query Parameter | presence_penalty | Ensures that the model includes a diverse range of tokens in the output text | number (float) | optional |
Query Parameter | best_of | Number of completions to generate and return the best one | integer | optional |
Query Parameter | guard_rail | List of guard rail conditions | array | optional |
Query Parameter | examples | List of example prompts for the chatbot | array | optional |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbot_global_id":"string"
}
response = requests.put(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": "200",
"message": "Bot Update : Bot Updated Successfully"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Bot Updated Successfully | application/json |
400 | Bad Request | application/json |
403 | Forbidden | application/json |
404 | Resource Not Found | application/json |
409 | Conflict | application/json |
500 | Internal Server Error | application/json |
422 | Validation Error | application/json |
Delete Chat Bot By Id API
/aiwb/bot/api/v1/{chatbot_global_id}
- Method:
DELETE
- Summary: Delete Chat Bot By Id
- Description: This API allows you to permanently remove a chat bot.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbot_global_id":"string"
}
response = requests.delete(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": "200",
"message": "Successfully deleted Chat Sessions and all it's associated data such as Guard Rails, Examples, User Query & bot Response !!"
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Bot Deleted Successfully | application/json |
400 | Bad Request | application/json |
403 | Forbidden | application/json |
422 | Validation Error | application/json |
Publish Chat Bot API
/aiwb/bot/api/v1/publish/{chatbot_global_id}
- Method:
POST
- Summary: Publish Chat Bot
- Description: This API publishes a chat bot using the specified
chatbot_global_id
.
Parameters:
chatbot_global_id
: UUID
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/publish/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbot_global_id":"string"
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": 200,
"message": "Bot has been published successfully."
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
422 | Validation Error | application/json |
Get Embed Credentials API
/aiwb/bot/api/v1/embed/get_credentials/{chatbot_global_id}
- Method:
GET
- Summary: Get Embed Credentials
- Description: Get Embed Credentials for a specified chat bot.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/embed/get_credentials/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbot_global_id":"string"
}
response = requests.get(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": 200,
"message": "Successfully fetched embedding parameters for chatbot Bot123.",
"data": {
"token_url": "https://api-xyz.co/auth/api/v1/oauth/connect/token",
"refresh_url": "https://api-xyz.co/auth/api/v1/oauth/connect/refresh",
"chat_url": "https://api-xyz.co/aiwb/chat/api/v2/994548a0-c910-4fa0-b2e2-58ea7dbd3abc?ext_user_id_ref=<user_id of bot user>",
"client_id": "58842435-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"client_secret": "090458109309240AB420480a01a1eb7f7af761afa290"
}
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successfully fetched | application/json |
400 | Bot unavailable | application/json |
401 | Unauthorized | application/json |
500 | Internal Server Error | application/json |
422 | Validation Error | application/json |
Generate Embed Credentials API
/aiwb/bot/api/v1/embed/generate_credentials/{chatbot_global_id}
- Method:
POST
- Summary: Generate Embed Credentials
- Description: Generate Embed Credentials for a specified chat bot.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
Parameter | chatbot_global_id | ID of the chat bot | string (UUID) | mandatory |
query_Parameter | target | Target application for which the credentials are generated. Default is empty string. Maximum length is 100 characters and minimum length is 3 characters | string (UUID) | mandatory |
query_Parameter | access_token_lifespan | Access token lifespan in seconds. Default is 3600 seconds and maximum is 7200 seconds | string (UUID) | mandatory |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/embed/generate_credentials/{chatbot_global_id}"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
params={
"chatbot_global_id":"string"
}
response = requests.post(URL, headers=headers,params=params)
print(response)
Example Response value -
{
"status_code": 200,
"message": "Successfully generated client credentials for chatbot Bot123.",
"data": {
"client_id": "53a81240-xxxx-xxxx-xxxxxxxxxxxx",
"client_secret": "599a7b7d1969623B6631F81D11a90a0909241204482A",
"target": "KadalTest"
}
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successfully fetched | application/json |
400 | Bot unavailable or target not supported | application/json |
401 | Unauthorized | application/json |
500 | Internal Server Error | application/json |
422 | Validation Error | application/json |
Get Models Details API
/aiwb/bot/api/v1/models/
- Method:
GET
- Summary: Get Models Details
- Description: Pulls the model details with all required parameters needed to define a bot.
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/models/"
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
response = requests.get(URL, headers=headers)
print(response)
Example Response value -
{
"platform": {
"OpenAI": {
"model_type": {
"Chat": {
"Temperature": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 4000,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Frequency Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model does not repeat the same words or phrases too frequently within the output text"
},
"Presence Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model includes a diverse range of tokens in the output text"
}
},
"Text": {
"Temperature": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 4000,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Frequency Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model does not repeat the same words or phrases too frequently within the output text"
},
"Presence Penalty": {
"min": 0,
"max": 2,
"step": 0.1,
"default": 0.5,
"description": "Ensures that the model includes a diverse range of tokens in the output text"
},
"Best Of": {
"min": 1,
"max": 20,
"step": 1,
"default": 10,
"description": "Generates best_of completions server-side and returns the “best”"
}
}
},
"model_versions": [
"gpt-35-turbo",
"gpt-4"
]
},
"Palm": {
"model_type": {
"Chat": {
"Temperature": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 1024,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Top-k": {
"min": 1,
"max": 40,
"step": 1,
"default": 20,
"description": "Signifies sampling from k most likely next tokens at each step"
}
},
"Text": {
"Temperature": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Controls the level of randomness or 'creativity' in the generated text with higher temperature settings generating more creative and less predictable texts and vice versa"
},
"Max Tokens": {
"min": 1,
"max": 1024,
"step": 1,
"default": 256,
"description": "Maximum length that model is allowed to generate"
},
"Top-p": {
"min": 0,
"max": 1,
"step": 0.1,
"default": 0.5,
"description": "Manages the randomness of the output text by establishing a probability threshold and then selecting tokens for predicting the next words"
},
"Top-k": {
"min": 1,
"max": 40,
"step": 1,
"default": 20,
"description": "Signifies sampling from k most likely next tokens at each step"
}
}
},
"model_versions": [
"chat-bison@001",
"chat-bison@002",
"text-bison",
"gemini-pro"
]
}
}
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
Get Target API
/aiwb/bot/api/v1/targets/
Method:
GET
Summary: Get Target
Description: Get Targets.
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/targets/
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
response = requests.get(URL, headers=headers)
print(response)
Example Response value -
{
"status_code": 200,
"message": "Successfully fetched supported targets.",
"data": [
{
"1": "Application1",
"2": "Application2",
"3": "Application3"
}
]
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
Create Target API
- Method:
POST
- Summary: Delete Target
- Description: Delete a Target with the specified
target_id
.
Request Payload:
Type | Parameter | Description | Data Type | is_optional |
---|---|---|---|---|
query_parameter | target_id | Name of the target | string | Mandatory |
Sample code
import requests
URL = "https://api.kadal.ai/aiwb/bot/api/v1/targets/
# sample python code
headers = { "Authorization ": "Bearer 1234567890" }
response = requests.post(URL, headers=headers)
print(response)
Example Response value -
{
"status_code": 200,
"message": "Successfully deleted target."
}
Responses:
Status Code | Description | Content-Type |
---|---|---|
200 | Successful Response | application/json |
422 | Validation Error | application/json |
Components
Schemas
BotGenerateCredentials
- Type: object
- Description: Schema for generating bot credentials.
- Properties:
- target:
- Type: string
- Description: Target application for which the credentials are generated. (3-100 characters)
- access_token_lifespan:
- Type: integer
- Description: Access token lifespan in seconds. (Default: 3600, Max: 7200)
- target:
Chat Bot Create schema and details
- Type: object
- Description: Schema for creating a chat bot.
- Properties:
- chatbotName:
- Type: string
- Description: Name of the chat bot.
- chatbotDescription:
- Type: string
- Description: Description of the chat bot.
- folder_ids:
- Type: array
- Description: List of folder IDs associated with the chat bot.
- object_ids:
- Type: array
- Description: List of object IDs associated with the chat bot.
- modelId:
- Type: string
- Description: Model ID for the chat bot (OpenAI, Palm).
- modelVersion:
- Type: string
- Description: Version of the model used.
- context:
- Type: string
- Description: Context of the chat bot.
- temperature:
- Type: number
- Description: Level of creativity in the generated text.
- max_tokens:
- Type: integer
- Description: Maximum length of generated text.
- top_p:
- Type: number
- Description: Probability threshold for token selection.
- top_k:
- Type: number
- Description: Sampling from k most likely next tokens.
- frequency_penalty:
- Type: number
- Description: Avoiding repetition in output text.
- presence_penalty:
- Type: number
- Description: Ensuring diversity in output text.
- best_of:
- Type: integer
- Description: Number of best outputs to return.
- guard_rail:
- Type: array
- Description: Guard rail settings for the chat bot.
- examples:
- Type: array
- Description: Examples for the chat bot.
- chatbotName:
Create Target schema and details
- Type: object
- Description: Schema for creating a target application.
- Properties:
- target_name:
- Type: string
- Description: Name of the target application. (3-100 characters)
- target_name:
Example
- Type: object
- Description: Example schema.
- Properties:
- question:
- Type: string
- answer:
- Type: string
- question:
HTTPValidationError
- Type: object
- Description: Validation error schema.
- Properties:
- detail:
- Type: array
- detail:
Msg
- Type: object
- Description: Message schema.
- Properties:
- msg:
- Type: string
- msg:
Order
- Type: string
- Description: An enumeration.
ResponseBotCommon
- Type: object
- Description: Common response schema.
- Properties:
- status_code:
- Type: integer
- message:
- Type: string
- status_code:
ResponseBotCreate
- Type: object
- Description: Response schema for chat bot creation.
- Properties:
- status_code:
- Type: integer
- message:
- Type: string
- chat_bot_id:
- Type: string
- status_code:
ResponseBotGet
- Type: object
- Description: Response schema for fetching chat bot details.
- Properties:
- status_code:
- Type: integer
- chat_bot_id:
- Type: string
- data:
- status_code:
ResponseBotList
- Type: object
- Description: Response schema for listing chat bots.
- Properties:
- status_code:
- Type: integer
- message:
- Type: string
- total_bot_count:
- Type: integer
- chat_bots:
- status_code:
ValidationError
- Type: object
- Description: Validation error schema.
- Properties:
- loc:
- Type: array
- msg:
- Type: string
- type:
- Type: string
- loc: