getContainer 的 input_paramters path 用法本設定文件將指導您如何設置和配置 MyChatbot,並使用特定的插件和工具來與 Cloud Infra API 整合,使系統管理員能夠通過自然語言查詢,高效地管理和監控容器服務及專案成員資訊,本次共會設定2個plugin與3個tool:
<aside> 💡 Plugin 是根據 API 群組(API group)來進行劃分的,每個 Plugin 都包含一組相關的 API,而每個 Tool 則對應一個特定的 API 調用。
</aside>
Cloudinfra_Service (Plugin):此 Plugin 旨在讓系統管理員使用 CloudInfra 的 Container Service API 來檢索不同專案中的容器服務資訊。
getContainer:此 Tool 允許系統管理員檢索指定專案中正在運行的容器服務的資訊。
Request:
curl -X GET '<http://192.168.0.1:31382/projects/4f753700>' \\
-H 'Authorization: Bearer <token>'
Response:
# 僅供參考
{
"id": 928,
"name": "ctr1706254819996",
"status": "Stopped",
"creator": "Brad",
"createdTime": "2024-01-26T07:41:13.973Z"
}
Cloudinfra_Project(Plugin):此 Plugin 旨在讓系統管理員使用 CloudInfra 的IAM API 來檢索不同專案中的成員(members)或是各專案資訊。
getMemberships:此 Tool 允許系統管理員檢索指定專案中的成員資訊。
curl -X GET '<http://192.168.0.1:31084/iam/api/v1/admin/membership/project/1>' \\
-H 'Authorization: Bearer <token>'
Response:
# 僅供參考
{
"membershipId": "dee71958-2154-4583-bbee-4077dbe9d89d",
"projectId": "15458ee2-9b05-4954-a5f5-cb0c1472ca1e",
"user": {
"account": "[email protected]",
"displayName": "Lai",
"createdAt": "2023-08-14T03:40:44Z"
},
"tenantRole": "TENANT_MEMBER"
}
getProjects:此 Tool 允許系統管理員檢索目前所有的專案資訊。
Request:
curl -X GET '<http://192.168.0.1:31084/iam/api/v1/admin/projects>' \\
-H 'Authorization: Bearer <token>'
Response:
# 僅供參考
{
"projectId": "0ee91b49-9b5f-4099-8756-82838db12f0c",
"displayName": "product-team",
"createdAt": "2023-03-15T02:58:48Z"
}
<aside> 💡 請注意:為了確保資訊安全,以下步驟中使用的所有 IP 和 Token 均為虛構。
</aside>
<aside> 💡 在設置 Plugin 或 Tool 時,其描述(Description)的撰寫至關重要,因為這會直接影響 LLM 對工具的理解和使用,請參考下文「撰寫 LLM 容易理解的英文描述 (Description)」裡的Prompt進行中文至英文的轉換與優化。
</aside>
<aside> 💡 Plugin 與 Tool 名稱的命名規則:
</aside>
首先,我們需要進入 Plugin 管理介面並創建新的 Plugin。
請按照以下步驟操作: