AI 助理
建立新 AI 助理
POST /api/v1/chatbots/
請求內容
{
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X POST "https://api.maiagent.ai/api/v1/chatbots/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 請求內容 (payload):
const data = {};
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
axios.post("https://api.maiagent.ai/api/v1/chatbots/", data, config)
.then(response => {
console.log('成功取得回應,以下是數據:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤,請檢查請求內容與 API Key:');
console.error(error.response?.data || error.message);
});
import requests
import json
url = "https://api.maiagent.ai/api/v1/chatbots/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {}
response = requests.post(url, json=data, headers=headers)
try:
print("成功取得回應,以下是返回數據:")
print(response.json())
except Exception as e:
print("請求出現錯誤,請檢查輸入參數與 API Key:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttpClient();
try {
$response = $client->post("https://api.maiagent.ai/api/v1/chatbots/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
// 請求內容 (payload) 已包含在請求中
'json' => {}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:
";
print_r($data);
} catch (Exception $e) {
echo '發生錯誤, 請檢查請求細節及 API Key: ' . $e->getMessage();
}
?>
回應內容
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workflow": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"apiWebChatId": "example_string",
"updatedAt": "pattern_example",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
取得 AI 助理列表
GET /api/v1/chatbots/
參數
參數名稱
必填
類型
說明
page
否
integer
A page number within the paginated result set.
pageSize
否
integer
Number of results to return per page.
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/chatbots/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭 (請替換 YOUR_API_KEY)
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/v1/chatbots/", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('發生錯誤,請檢查 API Key 與請求參數:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/v1/chatbots/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應,數據如下:")
print(response.json())
except Exception as e:
print("發生錯誤,請檢查 API 請求:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttpClient();
try {
$response = $client->get("https://api.maiagent.ai/api/v1/chatbots/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:
";
print_r($data);
} catch (Exception $e) {
echo '錯誤, 請確認 API Key 與請求配置: ' . $e->getMessage();
}
?>
回應內容
{
"count": 0,
"next": "example_string",
"previous": "example_string",
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"largeLanguageModel": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱"
},
"rag": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱"
},
"embeddingModel": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"isDefault": false
},
"rerankerModel": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"isDefault": false
},
"updatedAt": "pattern_example",
"enableChineseConversion": false
}
]
}
取得特定 AI 助理
GET /api/v1/chatbots/{id}/
參數
參數名稱
必填
類型
說明
id
是
string
A UUID string identifying this chatbot.
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭 (請替換 YOUR_API_KEY)
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('發生錯誤,請檢查 API Key 與請求參數:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應,數據如下:")
print(response.json())
except Exception as e:
print("發生錯誤,請檢查 API 請求:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttpClient();
try {
$response = $client->get("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:
";
print_r($data);
} catch (Exception $e) {
echo '錯誤, 請確認 API Key 與請求配置: ' . $e->getMessage();
}
?>
回應內容
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workflow": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"apiWebChatId": "example_string",
"updatedAt": "pattern_example",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
更新 AI 助理
PUT /api/v1/chatbots/{id}/
參數
參數名稱
必填
類型
說明
id
是
string
A UUID string identifying this chatbot.
請求內容
{
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 請求內容 (payload):
const data = {};
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
axios.put("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", data, config)
.then(response => {
console.log('成功取得回應,以下是數據:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤,請檢查請求內容與 API Key:');
console.error(error.response?.data || error.message);
});
import requests
import json
url = "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {}
response = requests.put(url, json=data, headers=headers)
try:
print("成功取得回應,以下是返回數據:")
print(response.json())
except Exception as e:
print("請求出現錯誤,請檢查輸入參數與 API Key:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttpClient();
try {
$response = $client->put("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
// 請求內容 (payload) 已包含在請求中
'json' => {}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:
";
print_r($data);
} catch (Exception $e) {
echo '發生錯誤, 請檢查請求細節及 API Key: ' . $e->getMessage();
}
?>
回應內容
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workflow": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"apiWebChatId": "example_string",
"updatedAt": "pattern_example",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
部分更新 AI 助理
PATCH /api/v1/chatbots/{id}/
參數
參數名稱
必填
類型
說明
id
是
string
A UUID string identifying this chatbot.
請求內容
{
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 請求內容 (payload):
const data = {};
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
axios.patch("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", data, config)
.then(response => {
console.log('成功取得回應,以下是數據:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤,請檢查請求內容與 API Key:');
console.error(error.response?.data || error.message);
});
import requests
import json
url = "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {}
response = requests.patch(url, json=data, headers=headers)
try:
print("成功取得回應,以下是返回數據:")
print(response.json())
except Exception as e:
print("請求出現錯誤,請檢查輸入參數與 API Key:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttpClient();
try {
$response = $client->patch("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
// 請求內容 (payload) 已包含在請求中
'json' => {}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:
";
print_r($data);
} catch (Exception $e) {
echo '發生錯誤, 請檢查請求細節及 API Key: ' . $e->getMessage();
}
?>
回應內容
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"workflow": "550e8400-e29b-41d4-a716-446655440000",
"name": "群組名稱",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "example_string",
"webhookUrl": "example_string",
"apiWebChatId": "example_string",
"updatedAt": "pattern_example",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "example_string",
"unanswerableTemplate": "example_string",
"totalWordsCount": 0,
"enableChineseConversion": false,
"outputFormat": null,
"databaseUrl": "example_string",
"databaseType": "example_string"
}
刪除 AI 助理
DELETE /api/v1/chatbots/{id}/
參數
參數名稱
必填
類型
說明
id
是
string
A UUID string identifying this chatbot.
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 請求內容 (payload):
const data = {};
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
axios.delete("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", data, config)
.then(response => {
console.log('成功取得回應,以下是數據:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤,請檢查請求內容與 API Key:');
console.error(error.response?.data || error.message);
});
import requests
import json
url = "https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {}
response = requests.delete(url, json=data, headers=headers)
try:
print("成功取得回應,以下是返回數據:")
print(response.json())
except Exception as e:
print("請求出現錯誤,請檢查輸入參數與 API Key:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttpClient();
try {
$response = $client->delete("https://api.maiagent.ai/api/v1/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
// 請求內容 (payload) 已包含在請求中
'json' => {}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:
";
print_r($data);
} catch (Exception $e) {
echo '發生錯誤, 請檢查請求細節及 API Key: ' . $e->getMessage();
}
?>
狀態碼
狀態碼
說明
204
No response body
Last updated
Was this helpful?