Skip to content

Commit

Permalink
add api tools
Browse files Browse the repository at this point in the history
  • Loading branch information
wu0up committed Dec 3, 2024
1 parent 7a86647 commit efa1795
Show file tree
Hide file tree
Showing 24 changed files with 235 additions and 0 deletions.
Binary file removed docs/agentfabric_create_plan.mp4
Binary file not shown.
129 changes: 129 additions & 0 deletions docs/example_data/openapi_tool_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"openapi": "3.1.0",
"info": {
"title": "時間轉換器",
"description": "時間轉換器將透過傳入的資料(時間數值、單位等等),將需要進行轉換的資料,轉換成指定的單位並且回傳(預設為毫秒)。",
"version": "1.0"
},
"servers": [
{
"url": "https://superiorapis-creator.cteam.com.tw"
}
],
"paths": {
"/manager/feature/proxy/e975799c3585215abad6f673afe8445439/pub_93fa3a1a6150ec54a6745877c25700": {
"post": {
"operationId": "timeConverter",
"summary": "時間轉換",
"description": "時間轉換器將透過傳入的資料(時間數值與單位等等),將需要進行轉換的資料,轉換成指定的單位並且回傳(預設為毫秒)。需要進行轉換的單位 | day: 0, hour: 1, minute: 2, second: 3, millisecond: 4;",
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"original": {
"type": "object",
"description": "轉換前的時間條件",
"properties": {
"unit": {
"type": "string",
"description": "需要進行轉換的單位 | day: 0, hour: 1, minute: 2, second: 3, millisecond: 4",
"enum": ["0", "1", "2", "3", "4"]
},
"value": {
"type": "number",
"description": "需要進行轉換之數值"
}
},
"required": ["unit", "value"]
},
"converted": {
"type": "object",
"description": "轉換後的時間條件(預設為毫秒)",
"properties": {
"unit": {
"type": "string",
"description": "轉換後的單位(預設為毫秒) | day: 0, hour: 1, minute: 2, second: 3, millisecond: 4",
"enum": ["0", "1", "2", "3", "4"]
}
},
"required": ["unit"]
},
"round": {
"type": "integer",
"description": "小數點位數"
}
},
"required": ["original", "converted"]
},
"examples": {
"example1": {
"value": {
"original": {
"unit": "1",
"value": 1
},
"converted": {
"unit": "3"
},
"round": 2
}
}
}
}
}
},
"responses": {
"200": {
"description": "轉換成功",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"unit": {
"type": "string",
"description": "轉換後單位"
},
"converted_value": {
"type": "number",
"description": "轉換後數值"
}
},
"required": ["unit", "converted_value"],
"example": {
"unit": "3",
"converted_value": 86400
}
}
}
}
},
"400": {
"description": "轉換失敗",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error_msg": {
"type": "string",
"description": "錯誤訊息"
}
},
"required": ["error_msg"],
"example": {
"error_msg": "Invalid input data"
}
}
}
}
}
},
"deprecated": false
}
}
}
}
50 changes: 50 additions & 0 deletions docs/example_meeting_arr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 會議安排團隊
**會議安排團隊的主要目的是幫助辦公室有效地預約會議,節省時間,並減少線下協商場地的需求。透過自動化的流程,團隊能夠快速找到合適的會議時間和地點,提升工作效率。

「User_available_time_check Agent」會使用api tools-/user_info,查詢使用者提到的人員的時間表。「meeting_room_available_time_check Agent」會使用api tools-/room_info,查詢使用者提到的時間區間的會議室狀況。「meeting_arrangement Agent」,當收到人員的calendar安排時間,找到空閒的時間(沒有標示在calendar上的時段);針對使用者空閒的時間,確認會議室的預約資料是否有空;提供三個時段及對應的會議室,符合:所有人員時間表有空閒且會議室有空的時段。**

此Agents掛載一個行事曆查詢的API工具,文件參考如下:
[OpenAPI JSON 文件](https://fake-meeting-room.datafabric.iii-ei-stack.com/openapi.json)



## 操作指導

1. **點選紅框編輯**
![本地圖片](./images/a1.png "本地圖片示例")

2. **點選筆的符號**
![本地圖片](./images/a2.png "本地圖片示例")
3. **編輯第一個代理 (Agent)**

- **名稱**: `User_available_time_check`
- **描述**: 你非常會使用 API tools 回復使用者問題。
- **任務**: 使用 API tools 查詢使用者提到的人員的時間表。
- **操作**:
1. 編輯名稱、描述和任務。
2. 選擇工具並加入 `#fake_demo./user_info`,新增請參考API工具使用指南。
3. 按「送出」並儲存。
![本地圖片](./images/a3.png "本地圖片示例")
4. **編輯第二個代理 (Agent)**

- **名稱**: `meeting_room_available_time_check`
- **描述**: 你非常會使用 API tools 回復使用者問題。
- **任務**: 使用 API tools 查詢使用者提到的時間區間的會議室狀況。
- **操作**:
1. 編輯名稱、描述和任務。
2. 選擇工具並加入 `#fake_demo./room_info`,新增請參考API工具使用指南。
3. 按「送出」並儲存。
![本地圖片](./images/a4.png "本地圖片示例")
5. **編輯第三個代理 (Agent)**

- **名稱**: `meeting_arrangement`
- **描述**: 你會評估人員的日曆安排時間,搭配會議室的預約資料,提供會議時間建議給使用者。
- **任務**: 收到人員的日曆安排時間後﹑找到空閒時間(未標示在日曆上的時段)、確認會議室預約資料是否有空、提供三個時段及對應的會議室,需符合所有人員和會議室的空閒條件。
- **操作**:
1. 編輯名稱、描述和任務。
2. 按「送出」並儲存。
![本地圖片](./images/a5.png "本地圖片示例")
6. **使用操作**
- 點選「會議安排團隊工作室」。
- 輸入會議人員、日期等信息以產出結果。
![本地圖片](./images/a6.png "本地圖片示例")
Binary file added docs/images/222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/2222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/22222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/222222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/2222222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/22222222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/222222222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/2222222222.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/666.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/777.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ZZ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ZZZ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/ZZZZ.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/a6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions docs/tools.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# API 工具使用指南
此API工具支援有金鑰和無金鑰的API串接

## 無金鑰操作流程

1. 點選 API 工具使用的編輯。
![本地圖片](./images/ZZ.png "本地圖片示例")
2. 點選筆的符號。
![本地圖片](./images/2222222.png "本地圖片示例")
3. 編輯紅框中的Agent名稱、描述、任務:
- **名稱**`User_available_time_check`
- **描述**:你非常會使用 API tools 回復使用者問題。今年是 2024 年,你會使用 API tools。
- **任務**:查詢使用者提到的人員的時間表。
![本地圖片](./images/ZZZZ.png "本地圖片示例")


4. 這個Agent是要掛載一個行事曆查詢的API工具,此API無須授權認證,
API文件參考如下:
[OpenAPI JSON 文件](https://fake-meeting-room.datafabric.iii-ei-stack.com/openapi.json)
![本地圖片](./images/222.png "本地圖片示例")
工具新增方式:
點選 `+新增工具`
- **名稱**:工具名稱,可以自行填寫
- **金鑰**:不用認證,不用填
- **內容**:支援json,url,yaml
- 勾選藍色框的列表,按送出。
- 儲存
![本地圖片](./images/666.png "本地圖片示例")
5. 測試 API 功能,輸入指令「Alice Wang 2024/12/8~12/13 的行事曆資料」,即可驗證結果。
![本地圖片](./images/22222.png "本地圖片示例")
---

## 有金鑰操作流程

1. 點選 API 工具使用的編輯。
![本地圖片](./images/222222.png "本地圖片示例")
2. 點選筆的符號。
![本地圖片](./images/2222222.png "本地圖片示例")
3. 編輯紅框中的Agent名稱、描述、任務:
- **名稱**`User_available_time_check`
- **描述**:你非常會使用 API tools 回復使用者問題。今年是 2024 年,你會使用 API tools。
- **任務**:查詢使用者提到的人員的時間表。
![本地圖片](./images/22222222.png "本地圖片示例")
4. 這個Agent是要掛載一個時間單位轉換的API工具,此API須授權認證,
工具新增方式:
點選 `+新增工具`,並輸入以下內容:
- **名稱**:工具名稱,可以自行填寫
- **金鑰**`{token: eyJ0eXAiOiJK...}`
- **內容**:支援json,url,yaml,[下載 JSON 配置文件](.\example_data\openapi_tool_example.json)
- 選紅色框的列表,按送出。
- 儲存
![本地圖片](./images/777.png "本地圖片示例")
5. 測試 API 功能,輸入指令「請將 2 天轉換成分鐘」,紅框為驗證輸出的結果。
![本地圖片](./images/2222222222.png "本地圖片示例")
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ nav:
- 知識庫: kdb.md
- 工作室: wks.md
- 工作室串接: wks_deploy.md
- 工具的使用: tools.md
- 範例:
- 如何使用知識庫_長照法規 AGENT 的創建: examples_rag.md
- 如何使用語音轉文字功能_語音轉文字_會議記錄小幫手: example_record.md
- 如何創建讀取圖片的服務_營養師團隊: example_nutri.md
- 如何使用API工具_會議室安排團隊: example_meeting_arr.md

0 comments on commit efa1795

Please sign in to comment.