> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# AI 助理

> 在編輯器中詢問與專案相關的問題，審閱助理建議的修改，並套用或拒絕。

助理會以你目前開啟的專案為對象。它會閱讀你的文件並建議修改，由你逐一套用或拒絕。截圖中的回答僅為範例：你得到的回答取決於你的站台所使用的模型。

> [!NOTE]
>
> 如果左側欄中沒有 **AI assistant**，請管理員參閱 [AI 整合](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/configuration/overleaf-toolkit/integrations/ai-integration.md)。

## 開始對話

**1. 開啟助理**

在編輯器左側欄中點擊 **AI assistant**。面板會在編輯器旁開啟。

**2. 接受條款**

第一次使用時，面板會顯示 AI 功能的條款。點擊 **Accept and continue**。此操作只需一次，且同樣適用於[錯誤助理](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/user-guide/users/error-assistant.md)。

![顯示條款與 Accept and continue 按鈕的 AI assistant 面板](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-consent.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=79becdeef84e44c498bf0419d8db25a7)

條款只顯示一次

**3. 提問**

在 **What would you like to do?** 中輸入內容並按 Enter，或點擊箭頭。你也可以點擊 **Start a chat** 下的建議。每次對話的建議都會不同；如果上次編譯有錯誤，還會出現 **Fix the compile errors**。

![顯示 Start a chat 下的建議與訊息框的面板](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-start.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=a11293cc7f7276ad452d7e8e85a804f0)

空白對話

**4. 閱讀回答**

助理執行的動作會以行的形式顯示在一個框中，例如 **Read line 15-16 of main.tex**，步驟完成後會帶有勾號。接著是回答。如果模型分享了推理過程，點擊 **Reasoned for 1 s** 即可查看。

![一個問題、包含 Reasoned for 1 s 與 Read line 15-16 of main.tex 的框，以及回答](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-answer.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=4f2054c3c112d83598c9577372f800d9)

一個問題及其回答

## 針對選取的行提問

在編輯器中選取若干行。訊息框上方會出現類似 `main.tex: 16` 的標籤，選取的文字會隨訊息一起送出。在空白對話中，建議會針對選取內容，例如 **Make it shorter**。

![編輯器中選取的一行、訊息框中的 main.tex: 16 標籤以及針對選取內容的建議](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-selection.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=67844d0ede72e0016cde010310b8c426)

選取的一行

## 審閱建議的修改

在你套用之前，修改不會進入文件。

**1. 閱讀建議**

名為 **Edit line 16** 的框會顯示原因、行號與修改內容：舊文字帶刪除線，新文字醒目標示。此時文件尚未改變。**Show result** 只顯示新文字，**Show diff** 則切換回來。

![帶有 Show result、Reject 與 Apply 的 Edit line 16 框，以及編輯器中未改變的行](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-edit.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=95bec4ca29c8fde20e7e0826984e2bf5)

等待你決定的修改

**2. 套用**

點擊 **Apply**。修改會出現在編輯器中，框上出現勾號，助理繼續工作。如果修改位於另一份文件，該文件會被開啟。

![帶勾號與 Undo 按鈕的 Edit line 16 框，以及編輯器中已修改的行](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-applied.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=bd52b0f9d5902d602af42fdb5c0e4522)

修改已套用

**3. 改變主意時復原**

**Undo** 會將修改從文件中撤回，**Apply** 會重新套用。助理不會得知這兩種操作。

### 拒絕修改

點擊 **Reject**。文件保持不變，框中顯示 **The user declined this edit.**，助理會在知道你已拒絕的情況下繼續工作。按鈕會消失，因此若要取回該修改，請重新提問。

如果你沒有做出決定而是送出新訊息，該修改不會被套用，框中會註明這一點。

![兩個標有叉號的 Edit line 13 框，一個被拒絕，一個未決定](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-rejected.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=094a0cb06812a6a927276f5369900d3d)

一個被拒絕的修改與一個未決定的修改

## 助理在專案中能做什麼

只有修改需要等待你的決定。其他步驟在助理執行時會立即執行。

| 對話中的行 | 作用 |
| - | - |
| **Read line 15-16 of main.tex** | 讀取文件中的若干行 |
| **Find “schedule” in main.tex** | 在文件中尋找文字 |
| **List the project files** | 列出專案檔案 |
| **Create appendix.tex** | 建立空白文件並開啟 |
| **Edit line 16** | 建議一處修改，見上文 |
| **Compile** | 編譯專案 |
| **Check the compile log** | 讀取上次編譯的錯誤與警告 |
| **Look at PDF page 1** | 在對話中顯示 PDF 的某一頁 |
| **Read the PDF structure** | 讀取 PDF 的結構 |
| **Switch to xelatex** | 變更專案的編譯器，與 **Settings** 中相同 |
| **Search the web for “...”** | 搜尋網路 |
| **Search the help pages for “...”** | 搜尋說明頁面 |

![Create appendix.tex 行、在編輯器中開啟的新檔案，以及一個等待決定的修改](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-new-file.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=a0f13a37ad174e18c47cf0ca22e11f62)

一個新檔案，然後是另一份文件中的修改

![Compile 與 Look at PDF page 1 行，以及在對話中顯示的頁面](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-compile.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=469c0083109baabb19934d17cca382a6)

一次編譯與 PDF 的一頁

搜尋行會顯示找到的結果數。點擊它即可列出結果。搜尋是否可用取決於你的站台，請參閱[選用搜尋服務](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/configuration/overleaf-toolkit/integrations/ai-integration.md#optional-search-services)。

![展開後顯示兩筆結果的 Search the web 行](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-search.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=009ac0a2b38ca77426211898c5cfcbe0)

搜尋結果

**Fix the compile errors** 建議會請助理檢查記錄並修正找到的問題。它的修正會以修改的形式交給你審閱。

## 附加圖片或 PDF

在訊息框中點擊圖片圖示 **Attach image or PDF**，然後選擇檔案。檔案名稱會顯示在你的文字上方。寫好訊息後送出。

![附加了 sketch.png 並寫有訊息的訊息框](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-attach.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=33dd1f32532bde887b07dc5d5115f69c)

附加到訊息的檔案

面板會以 **Only images and PDF files can be attached.** 拒絕其他檔案，並以 **Files must be smaller than 2 MB.** 拒絕過大的檔案。

## 停止助理

助理工作時，訊息框中的箭頭會變成 **Stop** 按鈕。點擊它。正在執行的步驟會以 **Stopped by the user.** 結束，在你再次送出訊息之前不會發生其他動作。

![帶有 Stop 按鈕的訊息框](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-stop.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=4837c5fda55d9ffa9b5af3a30987bf76)

Stop 按鈕

## 如果助理自行停止

助理針對一則訊息能執行的步驟數是有限的。達到上限時，面板會顯示 **The assistant used all the steps it may take for one message. Reply to let it carry on.** 回覆一下，例如 `Go on`，它就會繼續。

![提示助理已用完所有步驟的通知](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-step-limit.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=7509f3e5d5ffac6f2f51f54527e90738)

步驟上限

如果面板顯示 **Something’s gone wrong**，表示請求失敗。請重新送出訊息，或點擊 **Start new chat**。

## 移動面板與重新開始

面板頂部有以下按鈕：

* **Start new chat** 會清空面板。沒有先前對話的清單。重新載入頁面也會清空對話。
* **Move to the right** 會把面板移到 PDF 右側，在你使用檔案樹時它會保持開啟。**Move to the left** 會將其移回。對話會保留。
* **Close** 會隱藏面板。點擊左側欄中的 **AI assistant** 即可重新開啟，對話仍在。

![AI assistant 面板位於 PDF 右側的編輯器](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-right.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=fdc556fe305a6c625b8bfad2adc537d7)

位於右側的面板

## Token 用量

助理不會顯示你已使用多少 token。如果你的站台設定了限額且你已達到，下一則訊息將不會得到回答。面板會顯示 **Usage limit reached** 以及距離可以再次對話還需多久，訊息框會變灰。

![變灰的訊息框上方的 Usage limit reached 通知](https://mintcdn.com/ayakaleaf-pro/IsGnx0wnzqtV4hI8/images/on-premises/ai-assistant-usage-limit.png?fit=max\&auto=format\&n=IsGnx0wnzqtV4hI8\&q=85\&s=fcf261fc5ad7073bc725e24600c90de5)

已達到限額

新對話會顯示同樣的通知。重新載入後訊息框看起來恢復正常，但下一則訊息同樣會收到該通知。[錯誤助理](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/user-guide/users/error-assistant.md)與其共用同一限額，並會在記錄條目中顯示 **Usage limit reached**。

限額由管理員設定，請參閱[用量與重設](https://ayakaleaf-pro.mintlify.site/zh-TW/on-premises/configuration/overleaf-toolkit/integrations/ai-integration.md#usage-and-reset)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.