Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8dce458
docs: ko: bonus-unit1/what-is-function-calling.mdx
xhaktm Aug 5, 2025
ebb91b2
feat: gpt draft
xhaktm Aug 5, 2025
ad855ae
docs: ko: what-is-function-calling.mdx
xhaktm Aug 26, 2025
5174a7b
feat: gpt draft
xhaktm Aug 26, 2025
a59be64
fix: manual edits
xhaktm Aug 26, 2025
85534f7
Update what-is-function-calling.mdx
xhaktm00 Aug 26, 2025
0ccf9ca
Update what-is-function-calling.mdx
xhaktm00 Aug 26, 2025
e896df9
Merge branch 'main' into ko-bonus-unit1/what-is-function-calling.mdx
xhaktm00 Aug 28, 2025
3e7d67b
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
cfc4119
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
0b589fa
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
ed8bd8b
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
c1c4fe7
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
7b25315
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
ff01bad
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
52b3aa7
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
24fd538
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
2f84643
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
efadc50
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
ea78fb5
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
562b4fb
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
8b6955d
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
bc4da71
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
86093fd
Update units/ko/bonus-unit1/what-is-function-calling.mdx
xhaktm00 Oct 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion units/ko/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@
- title: Bonus Unit 1. Fine-tuning an LLM for Function-calling
sections:
- local: bonus-unit1/introduction
title: Introduction
title: Introduction
- local: bonus-unit1/what-is-function-calling
title: What is Function Calling?
76 changes: 76 additions & 0 deletions units/ko/bonus-unit1/what-is-function-calling.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# ํ•จ์ˆ˜ ํ˜ธ์ถœ์ด๋ž€ ๋ฌด์—‡์ธ๊ฐ€[[what-is-function-calling]]

ํ•จ์ˆ˜ ํ˜ธ์ถœ์€ **LLM์ด ํ™˜๊ฒฝ๊ณผ ์ƒํ˜ธ์ž‘์šฉํ•˜์—ฌ ๋™์ž‘์„ ์ˆ˜ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•**์ž…๋‹ˆ๋‹ค. ์ฒ˜์Œ์—๋Š” [GPT-4์—์„œ ๋„์ž…๋˜์—ˆ์œผ๋ฉฐ](https://openai.com/index/function-calling-and-other-api-updates/), ์ดํ›„ ๋‹ค๋ฅธ ๋ชจ๋ธ์—์„œ๋„ ๊ตฌํ˜„๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์—์ด์ „ํŠธ์˜ ๋„๊ตฌ์ฒ˜๋Ÿผ, ํ•จ์ˆ˜ ํ˜ธ์ถœ์€ ๋ชจ๋ธ์—๊ฒŒ **์ฃผ์–ด์ง„ ํ™˜๊ฒฝ์—์„œ ๋™์ž‘์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ์—ญ๋Ÿ‰**์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ๋‹ค๋งŒ ํ•จ์ˆ˜ ํ˜ธ์ถœ ์—ญ๋Ÿ‰์€ **๋ชจ๋ธ์ด ํ•™์Šต์„ ํ†ตํ•ด ๋‚ด์žฌํ™”ํ•œ ๊ฒƒ์ด๋ฉฐ**, ๋‹ค๋ฅธ ์—์ด์ „ํŠธ ๊ธฐ๋ฒ•๋“ค๋ณด๋‹ค **ํ”„๋กฌํ”„ํŠธ์— ์˜์กดํ•˜๋Š” ์ •๋„๊ฐ€ ๋‚ฎ์Šต๋‹ˆ๋‹ค.**

Unit 1์—์„œ๋Š” ์—์ด์ „ํŠธ๊ฐ€ **๋„๊ตฌ๋ฅผ ํ•™์Šตํ•ด์„œ ์‚ฌ์šฉํ•œ ๊ฒƒ์€ ์•„๋‹ˆ๋ฉฐ**, ์šฐ๋ฆฌ๋Š” ๋‹จ์ง€ ๋„๊ตฌ ๋ชฉ๋ก์„ ์ œ๊ณตํ–ˆ๊ณ , ๋ชจ๋ธ์ด **์ด ๋„๊ตฌ๋“ค์„ ํ™œ์šฉํ•ด ๊ณ„ํš์„ ์ผ๋ฐ˜ํ™”ํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ์ **์— ์˜์กดํ–ˆ์Šต๋‹ˆ๋‹ค.

์—ฌ๊ธฐ์„œ๋Š” **ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ํ†ตํ•ด ์—์ด์ „ํŠธ๊ฐ€ ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋„๋ก ๋ฏธ์„ธ ์กฐ์ •(ํ•™์Šต)**ํ•ฉ๋‹ˆ๋‹ค.

## ๋ชจ๋ธ์€ ๋™์ž‘ ์ˆ˜ํ–‰์„ ์–ด๋–ป๊ฒŒ "ํ•™์Šต"ํ• ๊นŒ์š”?[[how-does-the-model-learn-to-take-an-action]]

Unit 1์—์„œ๋Š” ์—์ด์ „ํŠธ์˜ ์ผ๋ฐ˜์ ์ธ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‚ดํŽด๋ณด์•˜์Šต๋‹ˆ๋‹ค. ์‚ฌ์šฉ์ž๊ฐ€ ์—์ด์ „ํŠธ์— ๋„๊ตฌ๋ฅผ ์ œ๊ณตํ•˜๊ณ  ์งˆ์˜๋ฅผ ์ „๋‹ฌํ•˜๋ฉด, ๋ชจ๋ธ์€ ๋‹ค์Œ ๊ณผ์ •์„ ์ˆœํ™˜ํ•ฉ๋‹ˆ๋‹ค:

1. *Think* : ๋ชฉํ‘œ๋ฅผ ๋‹ฌ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ์–ด๋–ค ๋™์ž‘์„ ์ˆ˜ํ–‰ํ•ด์•ผ ํ• ์ง€ ๊ณ ๋ฏผํ•ฉ๋‹ˆ๋‹ค.
2. *Act* : ์˜ฌ๋ฐ”๋ฅธ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋™์ž‘์„ ํฌ๋งทํ•˜๊ณ  ์ƒ์„ฑ์„ ์ค‘๋‹จํ•ฉ๋‹ˆ๋‹ค.
3. *Observe* : ์‹คํ–‰ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ›์•„์˜ต๋‹ˆ๋‹ค.

API๋ฅผ ํ†ตํ•œ โ€œ์ผ๋ฐ˜์ ์ธโ€ ๋Œ€ํ™”์—์„œ๋Š”, ์•„๋ž˜์™€ ๊ฐ™์ด "user"์™€ "assistant" ๋ฉ”์‹œ์ง€๊ฐ€ ๋ฒˆ๊ฐˆ์•„ ๋‚˜ํƒ€๋‚ฉ๋‹ˆ๋‹ค.

```python
conversation = [
{"role": "user", "content": "I need help with my order"},
{"role": "assistant", "content": "I'd be happy to help. Could you provide your order number?"},
{"role": "user", "content": "It's ORDER-123"},
]
```

ํ•จ์ˆ˜ ํ˜ธ์ถœ์€ ๋Œ€ํ™”์— **์ƒˆ๋กœ์šด ์—ญํ• **์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค!

1. **Action**์„ ์œ„ํ•œ ์ƒˆ๋กœ์šด ์—ญํ• 
2. **Observation**์„ ์œ„ํ•œ ์ƒˆ๋กœ์šด ์—ญํ• 

[Mistral API](https://docs.mistral.ai/capabilities/function_calling/)๋ฅผ ์˜ˆ๋กœ ๋“ค๋ฉด, ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

```python
conversation = [
{
"role": "user",
"content": "What's the status of my transaction T1001?"
},
{
"role": "assistant",
"content": "",
"function_call": {
"name": "retrieve_payment_status",
"arguments": "{\"transaction_id\": \"T1001\"}"
}
},
{
"role": "tool",
"name": "retrieve_payment_status",
"content": "{\"status\": \"Paid\"}"
},
{
"role": "assistant",
"content": "Your transaction T1001 has been successfully paid."
}
]
```
> ...ํ•˜์ง€๋งŒ ํ•จ์ˆ˜ ํ˜ธ์ถœ์— ์ƒˆ๋กœ์šด ์—ญํ• ์ด ์žˆ๋‹ค๊ณ  ํ–ˆ๋‚˜์š”?

**๊ทธ๋ ‡๊ธฐ๋„ ํ•˜๊ณ  ์•„๋‹ˆ๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค.** ์ด ๊ฒฝ์šฐ๋ฅผ ๋น„๋กฏํ•ด ๋งŽ์€ API์—์„œ, ๋ชจ๋ธ์€ ์ˆ˜ํ–‰ํ•  ๋™์ž‘์„ "assistant" ๋ฉ”์‹œ์ง€๋กœ ํฌ๋งทํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„ ์ฑ„ํŒ… ํ…œํ”Œ๋ฆฟ์€ ์ด๋ฅผ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ์œ„ํ•œ **ํŠน์ˆ˜ ํ† ํฐ**์œผ๋กœ ํ‘œํ˜„ํ•ฉ๋‹ˆ๋‹ค.

- `[AVAILABLE_TOOLS]` โ€“ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋„๊ตฌ ๋ชฉ๋ก ์‹œ์ž‘
- `[/AVAILABLE_TOOLS]` โ€“ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋„๊ตฌ ๋ชฉ๋ก ์ข…๋ฃŒ
- `[TOOL_CALLS]` โ€“ ๋„๊ตฌ๋ฅผ ํ˜ธ์ถœ(์ฆ‰, **Action** ์ˆ˜ํ–‰)
- `[TOOL_RESULTS]` โ€“ ๋™์ž‘ ๊ฒฐ๊ณผ(โ€œObserveโ€)
- `[/TOOL_RESULTS]` โ€“ ๊ด€์ฐฐ ์ข…๋ฃŒ(๋ชจ๋ธ์ด ๋‹ค์‹œ ๋””์ฝ”๋”ฉํ•  ์ˆ˜ ์žˆ์Œ)

๊ฐ•์˜์—์„œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์„ ๋‹ค์‹œ ๋‹ค๋ฃจ๊ฒ ์ง€๋งŒ, ๋” ๊นŠ์ด ์‚ดํŽด๋ณด๊ณ  ์‹ถ๋‹ค๋ฉด [์ด ๋ฌธ์„œ ์„น์…˜](https://docs.mistral.ai/capabilities/function_calling/)์„ ์ฐธ๊ณ ํ•˜์„ธ์š”.

---
์ด์ œ ํ•จ์ˆ˜ ํ˜ธ์ถœ์ด ๋ฌด์—‡์ด๊ณ  ์–ด๋–ป๊ฒŒ ์ž‘๋™ํ•˜๋Š”์ง€ ๋ฐฐ์› ์œผ๋‹ˆ, ์•„์ง ํ•ด๋‹น ๊ธฐ๋Šฅ์ด ์—†๋Š” ๋ชจ๋ธ์— **ํ•จ์ˆ˜ ํ˜ธ์ถœ ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค**: [google/gemma-2-2b-it](https://huggingface.co/google/gemma-2-2b-it). ์ƒˆ๋กœ์šด ํŠน์ˆ˜ ํ† ํฐ์„ ๋ชจ๋ธ์— ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค.

์ด๋ฅผ ์œ„ํ•ด์„œ๋Š” **๋จผ์ € ๋ฏธ์„ธ ์กฐ์ •๊ณผ LoRA**๋ฅผ ์ดํ•ดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.