> For the complete documentation index, see [llms.txt](https://training.onedoggo.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://training.onedoggo.com/tech-sharing/gong-zuo-fang/hwdc2024/prepare-colab-environment.md).

# Google Colab 環境準備

### 2. 準備 Google Colab 的環境

#### 2.1 複製 Colab Notebook 並且設定 Secret

**a. 先將這次工作坊的 Python Notebook 複製到你的 Google Drive**

請點選這份 [Colab Notebook](https://colab.research.google.com/drive/1vYvop3r9IjOpSwYJguVzBjEbqeTyRSRn?usp=sharing) 並且複製到自己的 Google Drive。

{% embed url="<https://colab.research.google.com/drive/1vYvop3r9IjOpSwYJguVzBjEbqeTyRSRn>" %}

請先複製到自己的 Google Drive，才能保存後續你所有的修改內容。

![image](https://hackmd.io/_uploads/rkK0na0hC.png)

**b. 設定 `ELASTIC_CLOUD_ID` 與 `ELASTIC_API_KEY` Secret**

:::info 後續在 Colab 中進行 **1. 準備環境** 時，會需要透過這些設定，存取你的 Elasticsearch。 :::

![image](https://hackmd.io/_uploads/SyDUT5ChR.png)

#### 2.2 執行 Colab Notebook 中的 `1. 準備環境`

將 `1. 準備環境` 裡面的每個步驟都先執行過，準備機器與安裝相依性套件。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://training.onedoggo.com/tech-sharing/gong-zuo-fang/hwdc2024/prepare-colab-environment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
