LogoLogo
註冊/登入
  • 使用者手冊
  • 技術人員手冊
  • API 文件
  • AI 助理市集
  • 首頁
  • AI 助理
  • 附件與檔案
  • 知識庫
  • 對話與訊息
  • 組織與成員
  • 角色與權限
Powered by GitBook
On this page
  • 建立新 AI 助理
  • 列出 AI 助理有的設定項目
  • 取得 AI 助理列表
  • 取得特定 AI 助理
  • 更新 AI 助理
  • 部分更新 AI 助理
  • 刪除 AI 助理

Was this helpful?

AI 助理

建立新 AI 助理

POST /api/chatbots/

請求內容

請求參數

欄位
類型
必填
說明

name

string

是

模型名稱

largeLanguageModel

string (uuid)

是

大型語言模型的唯一識別碼

rag

string (uuid)

是

RAG的唯一識別碼

embeddingModel

string (uuid)

否

embeddingModel的唯一識別碼

rerankerModel

string (uuid)

否

rerankerModel的唯一識別碼

instructions

string

否

角色指令

organization

string (uuid)

否

組織的唯一識別碼

builtInWorkflow

string (uuid)

否

內建工作流的唯一識別碼

replyMode

object

否

定義回應模式

template

string

否

用於生成回應內容的模板字串

unanswerableTemplate

string

否

當查詢無法回答時所使用的預設回應模板

totalWordsCount

integer (int64)

否

累積的使用總字數

enableChineseConversion

boolean

否

是否啟用中文轉換功能

outputMode

object

否

定義輸出模式,可設定為純文字、JSON 格式

outputFormat

object

否

定義輸出格式,如格式化選項或樣式

databaseUrl

string

否

資料庫連接的 URL,指定數據庫的位置

databaseType

string

否

資料庫的類型,例如 PostgreSQL 或 MySQL

groups

array[Group]

否

被分配到的群組清單

請求結構範例

{
  "name": string
  "largeLanguageModel": string (uuid)
  "rag": string (uuid)
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
    }
  ]
}

請求範例值

{
  "name": "request_string",
  "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": "request_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": null,
  "template": "request_string",
  "unanswerableTemplate": "request_string",
  "totalWordsCount": 123,
  "enableChineseConversion": true,
  "outputMode": null,
  "outputFormat": null,
  "databaseUrl": "request_string",
  "databaseType": "request_string",
  "groups": [
    {}
  ]
}

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X POST "https://api.maiagent.ai/api/chatbots/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "request_string",
    "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": "request_string",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
    "replyMode": null,
    "template": "request_string",
    "unanswerableTemplate": "request_string",
    "totalWordsCount": 123,
    "enableChineseConversion": true,
    "outputMode": null,
    "outputFormat": null,
    "databaseUrl": "request_string",
    "databaseType": "request_string",
    "groups": [
      {}
    ]
  }'

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// 請求內容 (payload)
const data = {
    "name": "request_string",
    "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": "request_string",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
    "replyMode": null,
    "template": "request_string",
    "unanswerableTemplate": "request_string",
    "totalWordsCount": 123,
    "enableChineseConversion": true,
    "outputMode": null,
    "outputFormat": null,
    "databaseUrl": "request_string",
    "databaseType": "request_string",
    "groups": [
      {}
    ]
  };

axios.post("https://api.maiagent.ai/api/chatbots/", data, config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/chatbots/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# 請求內容 (payload)
data = {
      "name": "request_string",
      "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": "request_string",
      "organization": "550e8400-e29b-41d4-a716-446655440000",
      "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
      "replyMode": null,
      "template": "request_string",
      "unanswerableTemplate": "request_string",
      "totalWordsCount": 123,
      "enableChineseConversion": true,
      "outputMode": null,
      "outputFormat": null,
      "databaseUrl": "request_string",
      "databaseType": "request_string",
      "groups": [
        {}
      ]
    }

response = requests.post(url, json=data, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->post("https://api.maiagent.ai/api/chatbots/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "request_string",
            "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": "request_string",
            "organization": "550e8400-e29b-41d4-a716-446655440000",
            "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
            "replyMode": null,
            "template": "request_string",
            "unanswerableTemplate": "request_string",
            "totalWordsCount": 123,
            "enableChineseConversion": true,
            "outputMode": null,
            "outputFormat": null,
            "databaseUrl": "request_string",
            "databaseType": "request_string",
            "groups": [
                {}
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 201

回應結構範例

{
  "id": string (uuid)
  "name": string
  "largeLanguageModel": string (uuid)
  "rag": string (uuid)
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "updatedAt": string (timestamp)
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
      "id": string (uuid)
      "name": string
    }
  ]
}

回應範例值

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "response_string",
  "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": "response_string",
  "updatedAt": "response_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": {},
  "template": "response_string",
  "unanswerableTemplate": "response_string",
  "totalWordsCount": 456,
  "enableChineseConversion": false,
  "outputMode": {},
  "outputFormat": null,
  "databaseUrl": "response_string",
  "databaseType": "response_string",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "response_string"
    }
  ]
}

列出 AI 助理有的設定項目

GET /api/chatbot-settings/

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/chatbot-settings/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/chatbot-settings/", config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/chatbot-settings/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/chatbot-settings/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 200

回應結構範例

[
  {
    "id": string (uuid)
    "name": string
    "llms": [ // 獲取與此 RAG 相容的 LLMs。
如果是 MAIAGENT 類型,則返回所有 LLMs。
如果是 OPENAI 類型,則只返回 OPENAI provider 的 LLMs。
      object
    ]
    "isDefault"?: boolean // 非必填
    "isSearchSelectable": string
    "isRerankerModelSelectable": string
    "isEmbeddingModelSelectable": string
  }
]

回應範例值

[
  [
    {
      "id": "8f92a7e5-d136-4c2a-9b45-7e31d8f06a12",
      "name": "MaiAgent RAG",
      "llms": [
        {
          "id": "2c48d91f-b537-4e8a-a259-1f83e6b8c73d",
          "name": "GPT-4 Turbo",
          "context_window": 128000,
          "is_default": true,
          "icon": "https://xxx.png",
          "is_multi_modal_support": true,
          "is_functional_calling_available": true,
          "is_template_available": true,
          "is_output_format_available": true,
          "reply_mode": [
            "NORMAL",
            "TEMPLATE",
            "HYBRID",
            "TEXT_TO_SQL",
            "WORKFLOW"
          ],
          "output_mode": [
            "TEXT",
            "JSON_SCHEMA"
          ]
        },
        {
          "id": "7a31e85b-2c49-4d7a-9f06-e482b5d1c03a",
          "name": "Claude 3 Opus",
          "context_window": 200000,
          "is_default": false,
          "icon": "https://xxx.png",
          "is_multi_modal_support": true,
          "is_functional_calling_available": true,
          "is_template_available": true,
          "is_output_format_available": true,
          "reply_mode": [
            "NORMAL",
            "TEMPLATE",
            "HYBRID",
            "TEXT_TO_SQL",
            "WORKFLOW"
          ],
          "output_mode": [
            "TEXT",
            "JSON_SCHEMA"
          ]
        }
      ],
      "is_default": true,
      "is_search_selectable": true,
      "is_reranker_model_selectable": true,
      "is_embedding_model_selectable": true
    },
    {
      "id": "6d3c9e2a-f517-48b9-a30d-e742b5f1d38c",
      "name": "OpenAI RAG",
      "llms": [
        {
          "id": "1a4b7c3d-e5f2-49a8-b0c6-d3e2f1a4b5c6",
          "name": "GPT-4 Turbo",
          "context_window": 128000,
          "is_default": true,
          "icon": "https://xxx.png",
          "is_multi_modal_support": true,
          "is_functional_calling_available": true,
          "is_template_available": false,
          "is_output_format_available": true,
          "reply_mode": [
            "NORMAL"
          ],
          "output_mode": [
            "TEXT",
            "JSON_SCHEMA"
          ]
        }
      ],
      "is_default": false,
      "is_search_selectable": false,
      "is_reranker_model_selectable": false,
      "is_embedding_model_selectable": false
    }
  ]
]

取得 AI 助理列表

GET /api/chatbots/

參數

參數名稱
必填
類型
說明

page

❌

integer

A page number within the paginated result set.

pageSize

❌

integer

Number of results to return per page.

pagination

❌

string

是否分頁 (true/false)

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/chatbots/?page=1&pageSize=1&pagination=example" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/chatbots/?page=1&pageSize=1&pagination=example", config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/chatbots/?page=1&pageSize=1&pagination=example"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.get(url, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/chatbots/?page=1&pageSize=1&pagination=example", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 200

回應結構範例

{
  "count": integer
  "next"?: string (uri) // 非必填
  "previous"?: string (uri) // 非必填
  "results": [
    {
      "id": string (uuid)
      "name": string
      "largeLanguageModel":  // LLM 的基礎序列化器,只包含基本字段
      {
        "id": string (uuid)
        "name": string
      }
      "rag":  // RAG 的基礎序列化器
      {
        "id": string (uuid)
        "name": string
      }
      "embeddingModel": 
      {
        "id": string (uuid)
        "name": string
        "isDefault"?: boolean // 非必填
      }
      "rerankerModel": 
      {
        "id": string (uuid)
        "name": string
        "isDefault"?: boolean // 非必填
      }
      "updatedAt": string (timestamp)
      "enableChineseConversion"?: boolean // 非必填
      "groups": [
        {
          "id": string (uuid)
          "name": string
        }
      ]
    }
  ]
}

回應範例值

{
  "count": 123,
  "next": "http://api.example.org/accounts/?page=4",
  "previous": "http://api.example.org/accounts/?page=2",
  "results": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "response_string",
      "largeLanguageModel": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "response_string"
      },
      "rag": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "response_string"
      },
      "embeddingModel": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "response_string",
        "isDefault": false
      },
      "rerankerModel": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "name": "response_string",
        "isDefault": false
      },
      "updatedAt": "response_string",
      "enableChineseConversion": false,
      "groups": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "name": "response_string"
        }
      ]
    }
  ]
}

取得特定 AI 助理

GET /api/chatbots/{id}/

參數

參數名稱
必填
類型
說明

id

✅

string

A UUID string identifying this chatbot.

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

axios.get("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/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("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->get("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 200

回應結構範例

{
  "id": string (uuid)
  "name": string
  "largeLanguageModel": string (uuid)
  "rag": string (uuid)
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "updatedAt": string (timestamp)
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
      "id": string (uuid)
      "name": string
    }
  ]
}

回應範例值

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "response_string",
  "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": "response_string",
  "updatedAt": "response_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": {},
  "template": "response_string",
  "unanswerableTemplate": "response_string",
  "totalWordsCount": 456,
  "enableChineseConversion": false,
  "outputMode": {},
  "outputFormat": null,
  "databaseUrl": "response_string",
  "databaseType": "response_string",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "response_string"
    }
  ]
}

更新 AI 助理

PUT /api/chatbots/{id}/

參數

參數名稱
必填
類型
說明

id

✅

string

A UUID string identifying this chatbot.

請求內容

請求參數

欄位
類型
必填
說明

name

string

是

模型名稱

largeLanguageModel

string (uuid)

是

大型語言模型的唯一識別碼

rag

string (uuid)

是

RAG的唯一識別碼

embeddingModel

string (uuid)

否

embeddingModel的唯一識別碼

rerankerModel

string (uuid)

否

rerankerModel的唯一識別碼

instructions

string

否

角色指令

organization

string (uuid)

否

組織的唯一識別碼

builtInWorkflow

string (uuid)

否

內建工作流的唯一識別碼

replyMode

object

否

定義回應模式

template

string

否

用於生成回應內容的模板字串

unanswerableTemplate

string

否

當查詢無法回答時所使用的預設回應模板

totalWordsCount

integer (int64)

否

累積的使用總字數

enableChineseConversion

boolean

否

是否啟用中文轉換功能

outputMode

object

否

定義輸出模式,可設定為純文字、JSON 格式

outputFormat

object

否

定義輸出格式,如格式化選項或樣式

databaseUrl

string

否

資料庫連接的 URL,指定數據庫的位置

databaseType

string

否

資料庫的類型,例如 PostgreSQL 或 MySQL

groups

array[Group]

否

被分配到的群組清單

請求結構範例

{
  "name": string
  "largeLanguageModel": string (uuid)
  "rag": string (uuid)
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
    }
  ]
}

請求範例值

{
  "name": "request_string",
  "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": "request_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": null,
  "template": "request_string",
  "unanswerableTemplate": "request_string",
  "totalWordsCount": 123,
  "enableChineseConversion": true,
  "outputMode": null,
  "outputFormat": null,
  "databaseUrl": "request_string",
  "databaseType": "request_string",
  "groups": [
    {}
  ]
}

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "request_string",
    "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": "request_string",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
    "replyMode": null,
    "template": "request_string",
    "unanswerableTemplate": "request_string",
    "totalWordsCount": 123,
    "enableChineseConversion": true,
    "outputMode": null,
    "outputFormat": null,
    "databaseUrl": "request_string",
    "databaseType": "request_string",
    "groups": [
      {}
    ]
  }'

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// 請求內容 (payload)
const data = {
    "name": "request_string",
    "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": "request_string",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
    "replyMode": null,
    "template": "request_string",
    "unanswerableTemplate": "request_string",
    "totalWordsCount": 123,
    "enableChineseConversion": true,
    "outputMode": null,
    "outputFormat": null,
    "databaseUrl": "request_string",
    "databaseType": "request_string",
    "groups": [
      {}
    ]
  };

axios.put("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# 請求內容 (payload)
data = {
      "name": "request_string",
      "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": "request_string",
      "organization": "550e8400-e29b-41d4-a716-446655440000",
      "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
      "replyMode": null,
      "template": "request_string",
      "unanswerableTemplate": "request_string",
      "totalWordsCount": 123,
      "enableChineseConversion": true,
      "outputMode": null,
      "outputFormat": null,
      "databaseUrl": "request_string",
      "databaseType": "request_string",
      "groups": [
        {}
      ]
    }

response = requests.put(url, json=data, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->put("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "request_string",
            "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": "request_string",
            "organization": "550e8400-e29b-41d4-a716-446655440000",
            "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
            "replyMode": null,
            "template": "request_string",
            "unanswerableTemplate": "request_string",
            "totalWordsCount": 123,
            "enableChineseConversion": true,
            "outputMode": null,
            "outputFormat": null,
            "databaseUrl": "request_string",
            "databaseType": "request_string",
            "groups": [
                {}
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 200

回應結構範例

{
  "id": string (uuid)
  "name": string
  "largeLanguageModel": string (uuid)
  "rag": string (uuid)
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "updatedAt": string (timestamp)
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
      "id": string (uuid)
      "name": string
    }
  ]
}

回應範例值

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "response_string",
  "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": "response_string",
  "updatedAt": "response_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": {},
  "template": "response_string",
  "unanswerableTemplate": "response_string",
  "totalWordsCount": 456,
  "enableChineseConversion": false,
  "outputMode": {},
  "outputFormat": null,
  "databaseUrl": "response_string",
  "databaseType": "response_string",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "response_string"
    }
  ]
}

部分更新 AI 助理

PATCH /api/chatbots/{id}/

參數

參數名稱
必填
類型
說明

id

✅

string

A UUID string identifying this chatbot.

請求內容

請求參數

欄位
類型
必填
說明

name

string

否

模型名稱

largeLanguageModel

string (uuid)

否

大型語言模型的唯一識別碼

rag

string (uuid)

否

RAG的唯一識別碼

embeddingModel

string (uuid)

否

embeddingModel的唯一識別碼

rerankerModel

string (uuid)

否

rerankerModel的唯一識別碼

instructions

string

否

角色指令

organization

string (uuid)

否

組織的唯一識別碼

builtInWorkflow

string (uuid)

否

內建工作流的唯一識別碼

replyMode

object

否

定義回應模式

template

string

否

用於生成回應內容的模板字串

unanswerableTemplate

string

否

當查詢無法回答時所使用的預設回應模板

totalWordsCount

integer (int64)

否

累積的使用總字數

enableChineseConversion

boolean

否

是否啟用中文轉換功能

outputMode

object

否

定義輸出模式,可設定為純文字、JSON 格式

outputFormat

object

否

定義輸出格式,如格式化選項或樣式

databaseUrl

string

否

資料庫連接的 URL,指定數據庫的位置

databaseType

string

否

資料庫的類型,例如 PostgreSQL 或 MySQL

groups

array[Group]

否

被分配到的群組清單

請求結構範例

{
  "name"?: string // 非必填
  "largeLanguageModel"?: string (uuid) // 非必填
  "rag"?: string (uuid) // 非必填
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
    }
  ]
}

請求範例值

{
  "name": "request_string",
  "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": "request_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": null,
  "template": "request_string",
  "unanswerableTemplate": "request_string",
  "totalWordsCount": 123,
  "enableChineseConversion": true,
  "outputMode": null,
  "outputFormat": null,
  "databaseUrl": "request_string",
  "databaseType": "request_string",
  "groups": [
    {}
  ]
}

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "request_string",
    "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": "request_string",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
    "replyMode": null,
    "template": "request_string",
    "unanswerableTemplate": "request_string",
    "totalWordsCount": 123,
    "enableChineseConversion": true,
    "outputMode": null,
    "outputFormat": null,
    "databaseUrl": "request_string",
    "databaseType": "request_string",
    "groups": [
      {}
    ]
  }'

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
};

// 請求內容 (payload)
const data = {
    "name": "request_string",
    "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": "request_string",
    "organization": "550e8400-e29b-41d4-a716-446655440000",
    "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
    "replyMode": null,
    "template": "request_string",
    "unanswerableTemplate": "request_string",
    "totalWordsCount": 123,
    "enableChineseConversion": true,
    "outputMode": null,
    "outputFormat": null,
    "databaseUrl": "request_string",
    "databaseType": "request_string",
    "groups": [
      {}
    ]
  };

axios.patch("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY",
    "Content-Type": "application/json"
}

# 請求內容 (payload)
data = {
      "name": "request_string",
      "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": "request_string",
      "organization": "550e8400-e29b-41d4-a716-446655440000",
      "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
      "replyMode": null,
      "template": "request_string",
      "unanswerableTemplate": "request_string",
      "totalWordsCount": 123,
      "enableChineseConversion": true,
      "outputMode": null,
      "outputFormat": null,
      "databaseUrl": "request_string",
      "databaseType": "request_string",
      "groups": [
        {}
      ]
    }

response = requests.patch(url, json=data, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->patch("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY',
            'Content-Type' => 'application/json'
        ],
        'json' => {
            "name": "request_string",
            "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": "request_string",
            "organization": "550e8400-e29b-41d4-a716-446655440000",
            "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
            "replyMode": null,
            "template": "request_string",
            "unanswerableTemplate": "request_string",
            "totalWordsCount": 123,
            "enableChineseConversion": true,
            "outputMode": null,
            "outputFormat": null,
            "databaseUrl": "request_string",
            "databaseType": "request_string",
            "groups": [
                {}
            ]
        }
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼: 200

回應結構範例

{
  "id": string (uuid)
  "name": string
  "largeLanguageModel": string (uuid)
  "rag": string (uuid)
  "embeddingModel"?: string (uuid) // 非必填
  "rerankerModel"?: string (uuid) // 非必填
  "instructions"?: string // 非必填
  "updatedAt": string (timestamp)
  "organization"?: string (uuid) // 非必填
  "builtInWorkflow"?: string (uuid) // 非必填
  "replyMode"?: object // 非必填
  "template"?: string // 非必填
  "unanswerableTemplate"?: string // 非必填
  "totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
  "enableChineseConversion"?: boolean // 非必填
  "outputMode"?: object // 非必填
  "outputFormat"?: object // 非必填
  "databaseUrl"?: string // 非必填
  "databaseType"?: string // 非必填
  "groups"?: [ // 非必填
    {
      "id": string (uuid)
      "name": string
    }
  ]
}

回應範例值

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "response_string",
  "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": "response_string",
  "updatedAt": "response_string",
  "organization": "550e8400-e29b-41d4-a716-446655440000",
  "builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
  "replyMode": {},
  "template": "response_string",
  "unanswerableTemplate": "response_string",
  "totalWordsCount": 456,
  "enableChineseConversion": false,
  "outputMode": {},
  "outputFormat": null,
  "databaseUrl": "response_string",
  "databaseType": "response_string",
  "groups": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "response_string"
    }
  ]
}

刪除 AI 助理

DELETE /api/chatbots/{id}/

參數

參數名稱
必填
類型
說明

id

✅

string

A UUID string identifying this chatbot.

程式碼範例

# 呼叫 API 示例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/" \
  -H "Authorization: Api-Key YOUR_API_KEY"

# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');

// 設定請求標頭
const config = {
  headers: {
    'Authorization': 'Api-Key YOUR_API_KEY'
  }
};

// 請求內容 (payload)
const data = null;

axios.delete("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", data, config)
  .then(response => {
    console.log('成功取得回應:');
    console.log(response.data);
  })
  .catch(error => {
    console.error('請求發生錯誤:');
    console.error(error.response?.data || error.message);
  });
import requests

url = "https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
    "Authorization": "Api-Key YOUR_API_KEY"
}


response = requests.delete(url, headers=headers)
try:
    print("成功取得回應:")
    print(response.json())
except Exception as e:
    print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';

$client = new GuzzleHttp\Client();

try {
    $response = $client->delete("https://api.maiagent.ai/api/chatbots/550e8400-e29b-41d4-a716-446655440000/", [
        'headers' => [
            'Authorization' => 'Api-Key YOUR_API_KEY'
        ]
    ]);
    
    $data = json_decode($response->getBody(), true);
    echo "成功取得回應:\n";
    print_r($data);
} catch (Exception $e) {
    echo '請求發生錯誤: ' . $e->getMessage();
}
?>

回應內容

狀態碼
說明

204

No response body


Previous首頁Next附件與檔案

Last updated 1 month ago

Was this helpful?