AI Agents 入門
Adel Nehme
VP of AI Curriculum, DataCamp
| Thought | Example |
|---|---|
| Planning | 「為了幫他們搬家,我需要找搬家公司、比較價格,並確認他們日期的可用性」 |
| Thought | Example |
|---|---|
| Planning | 「為了幫他們搬家,我需要找搬家公司、比較價格,並確認他們日期的可用性」 |
| Analysis | 「看他們的消費模式,他們為很少使用的訂閱付了太多錢」 |
| Thought | Example |
|---|---|
| Planning | 「為了幫他們搬家,我需要找搬家公司、比較價格,並確認他們日期的可用性」 |
| Analysis | 「看他們的消費模式,他們為很少使用的訂閱付了太多錢」 |
| Decision-making | 「因為他們明天就需要,我應該建議選快遞運送,雖然會多一些費用」 |
| Thought | Example |
|---|---|
| Planning | 「為了幫他們搬家,我需要找搬家公司、比較價格,並確認他們日期的可用性」 |
| Analysis | 「看他們的消費模式,他們為很少使用的訂閱付了太多錢」 |
| Decision-making | 「因為他們明天就需要,我應該建議選快遞運送,雖然會多一些費用」 |
| Problem-solving | 「要最佳化這段程式碼,我應先進行 profiling 找出瓶頸」 |
| Thought | Example |
|---|---|
| Memory integration | 「他們上週提到乳糖不耐,所以我會把乳製品排除在這些食譜建議之外」 |
| Thought | Example |
|---|---|
| Memory integration | 「他們上週提到乳糖不耐,所以我會把乳製品排除在這些食譜建議之外」 |
| Self-reflection | 「我剛剛的說明太技術了——我來用日常比喻把它簡化」 |
| Thought | Example |
|---|---|
| Memory integration | 「他們上週提到乳糖不耐,所以我會把乳製品排除在這些食譜建議之外」 |
| Self-reflection | 「我剛剛的說明太技術了——我來用日常比喻把它簡化」 |
| Goal-setting | 「在規劃他們的運動菜單之前,我需要先了解他們的體能程度與可用時間」 |
| Thought | Example |
|---|---|
| Memory integration | 「他們上週提到乳糖不耐,所以我會把乳製品排除在這些食譜建議之外」 |
| Self-reflection | 「我剛剛的說明太技術了——我來用日常比喻把它簡化」 |
| Goal-setting | 「在規劃他們的運動菜單之前,我需要先了解他們的體能程度與可用時間」 |
| Prioritization | 「應該先訂機票再訂飯店,因為機票漲得比較快」 |

Chain of thought prompting
[Prompt...]。逐步思考。
Chain of thought prompting
[Prompt...]。逐步思考。
Thought > Action > Observation 範例
[Prompt...]。請依此格式:
- Thought: [先想要計算什麼]
- Action: [執行計算]
- Observation: [計算結果]
- ...視需要重複...
- Final Answer: [完整解答]

$$
若我買 3 台筆電,每台 $899,享 15% 折扣並加 8% 銷售稅,請計算總金額
$$
$2475.85

使用的 Prompt
若我買 3 台筆電,每台 $899,享 15% 折扣並加 8% 銷售稅,請計算總金額。只回傳答案。

使用的 Prompt
Calculate the total cost if I buy 3 laptops at $899
each with a 15% discount and 8% sales tax. Think step by step.
Follow this format:
Thought: [Think about what to calculate first]
Action: [Perform calculation]
Observation: [Result of calculation]
...repeat as needed...
Final Answer: [Complete solution]
Example:
Thought: Calculate base cost first
Action: 2 × $50 = $100
Thought: Apply 10% discount
Action: $100 - ($100 × 0.10) = $90
Final Answer: Total is $90

正確答案 $2475.85
ChatGPT 回答: $2,776.63

正確答案 $2475.85
ChatGPT 回答: $2475.85

ReAct 是模型系統提示的一部分
System prompt 是一組隱藏指令,指示模型在整段對話中的行為方式。
$$
$$ 推理模型範例

AI Agents 入門