-
Notifications
You must be signed in to change notification settings - Fork 2.1k
๐ [i18n-KO] Translated inspect_runs.md to Korean
#1747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+181
โ2
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
eb4a0c0
docs: translate to inspect_runs to ko
FacerAin 0301f00
Merge branch 'main' into ko-inspect-agents
FacerAin 459048a
Merge branch 'main' into ko-inspect-agents
FacerAin 7315daf
Fix Korean title for telemetry inspection tutorial
FacerAin 198b9b8
Fix typos in inspect_runs.md
FacerAin 057a478
Apply suggestions from code review
FacerAin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,179 @@ | ||
| # OpenTelemetry๋ก ์คํ ๊ฒ์ฌํ๊ธฐ[[inspecting-runs-with-opentelemetry]] | ||
|
|
||
| [[open-in-colab]] | ||
|
|
||
| > [!TIP] | ||
| > ์์ด์ ํธ ๊ตฌ์ถ์ด ์ฒ์์ด๋ผ๋ฉด ๋จผ์ [์์ด์ ํธ ์๊ฐ](../conceptual_guides/intro_agents)์ [์๋ด์](../guided_tour)๋ฅผ ์ฝ์ด๋ณด์ธ์. | ||
|
|
||
| ## ์์ด์ ํธ ์คํ์ ๋ก๊น ํ๋ ์ด์ ๋?[[why-log-your-agent-runs?]] | ||
|
|
||
| ์์ด์ ํธ ์คํ์ ๋๋ฒ๊น ํ๋ ๊ฒ์ ๋ณต์กํ ์์ ์ ๋๋ค. | ||
|
|
||
| ์คํ์ด ์ ๋๋ก ์งํ๋์๋์ง ํ์ธํ๊ธฐ ์ด๋ ต์ต๋๋ค. ์์ด์ ํธ ์ํฌํ๋ก์ฐ๋ ์ค๊ณ์ ์์ธก ๋ถ๊ฐ๋ฅํ๊ธฐ ๋๋ฌธ์ ๋๋ค(๋ง์ฝ ์์ธก ๊ฐ๋ฅํ๋ค๋ฉด ์ผ๋ฐ์ ์ธ ์ฝ๋๋ฅผ ์ฌ์ฉํ์ ๊ฒ์ ๋๋ค). | ||
|
|
||
| ์คํ ๊ณผ์ ์ ์ดํด๋ณด๋ ๊ฒ๋ ์ฝ์ง ์์ต๋๋ค. ๋ค๋จ๊ณ ์์ด์ ํธ๋ ์ฝ์์ ๋ก๊ทธ๋ก ๋น ๋ฅด๊ฒ ์ฑ์ฐ๋ ๊ฒฝํฅ์ด ์์ผ๋ฉฐ, ๋๋ถ๋ถ์ ์ค๋ฅ๋ ๋จ์ํ "LLM์ ์ค์" ์ ํ์ผ๋ก, LLM์ด ๋ค์ ๋จ๊ณ์์ ๋ ๋์ ์ฝ๋๋ ๋๊ตฌ ํธ์ถ์ ์์ฑํ์ฌ ์ค์ค๋ก ๊ต์ ํฉ๋๋ค. | ||
|
|
||
| ๋ฐ๋ผ์ ๋์ค์ ๊ฒ์ฌํ๊ณ ๋ชจ๋ํฐ๋งํ ์ ์๋๋ก ๊ณ์ธก์ ํตํด ์์ด์ ํธ ์คํ์ ๊ธฐ๋กํ๋ ๊ฒ์ด ํ๋ก๋์ ํ๊ฒฝ์์๋ ํ์์ ๋๋ค! | ||
|
|
||
| ์์ด์ ํธ ์คํ์ ๊ณ์ธกํ๊ธฐ ์ํด [OpenTelemetry](https://opentelemetry.io/) ํ์ค์ ๋์ ํ์ต๋๋ค. | ||
|
|
||
| ์ฆ, ๊ณ์ธก ์ฝ๋๋ฅผ ์คํํ ํ ์์ด์ ํธ๋ฅผ ํ์์ฒ๋ผ ์คํํ๋ฉด ๋ชจ๋ ๋ด์ฉ์ด ํ๋ซํผ์ ์๋์ผ๋ก ๋ก๊น ๋ฉ๋๋ค. ๋ค์ํ OpenTelemetry ๋ฐฑ์๋์์ ์ด๋ฅผ ๊ตฌํํ๋ ๋ฐฉ๋ฒ์ ์์๋ฅผ ์๋์ ์ ์ํฉ๋๋ค. | ||
|
|
||
| ํ๋ซํผ์์์ ์ค์ ๋ชจ์ต์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค: | ||
|
|
||
| <div class="flex justify-center"> | ||
| <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/smolagents/inspect_run_phoenix.gif"/> | ||
| </div> | ||
|
|
||
| ## Arize AI Phoenix๋ก ํ ๋ ๋ฉํธ๋ฆฌ ์ค์ [[setting-up-telemetry-with-arize-ai-phoenix]] | ||
|
|
||
| ๋จผ์ ํ์ํ ํจํค์ง๋ฅผ ์ค์นํ์ธ์. ์ฌ๊ธฐ์๋ ๋ก๊ทธ๋ฅผ ์์งํ๊ณ ๊ฒ์ฌํ๋ ์ข์ ์๋ฃจ์ ์ธ [Arize AI์ Phoenix](https://github.com/Arize-ai/phoenix)๋ฅผ ์ค์นํ์ง๋ง, ์ด ์์ง ๋ฐ ๊ฒ์ฌ ๋ถ๋ถ์ ์ฌ์ฉํ ์ ์๋ ๋ค๋ฅธ OpenTelemetry ํธํ ํ๋ซํผ๋ ์์ต๋๋ค. | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```shell | ||
| pip install 'smolagents[telemetry,toolkit]' | ||
| ``` | ||
|
|
||
| ๊ทธ ๋ค์ ๋ฐฑ๊ทธ๋ผ์ด๋์์ ์์ง๊ธฐ๋ฅผ ์คํํ์ธ์. | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```shell | ||
| python -m phoenix.server.main serve | ||
| ``` | ||
|
|
||
| ๋ง์ง๋ง์ผ๋ก `SmolagentsInstrumentor`๋ฅผ ์ค์ ํ์ฌ ์์ด์ ํธ๋ฅผ ์ถ์ ํ๊ณ Phoenix ๊ธฐ๋ณธ ์๋ํฌ์ธํธ๋ก ์ถ์ ์ ๋ณด๋ด์ธ์. | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```python | ||
| from phoenix.otel import register | ||
| from openinference.instrumentation.smolagents import SmolagentsInstrumentor | ||
|
|
||
| register() | ||
| SmolagentsInstrumentor().instrument() | ||
| ``` | ||
| ๊ทธ๋ฌ๋ฉด ์์ด์ ํธ๋ฅผ ์คํํ ์ ์์ต๋๋ค! | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```py | ||
| from smolagents import ( | ||
| CodeAgent, | ||
| ToolCallingAgent, | ||
| WebSearchTool, | ||
| VisitWebpageTool, | ||
| InferenceClientModel, | ||
| ) | ||
|
|
||
| model = InferenceClientModel() | ||
|
|
||
| search_agent = ToolCallingAgent( | ||
| tools=[WebSearchTool(), VisitWebpageTool()], | ||
| model=model, | ||
| name="search_agent", | ||
| description="This is an agent that can do web search.", | ||
| ) | ||
|
|
||
| manager_agent = CodeAgent( | ||
| tools=[], | ||
| model=model, | ||
| managed_agents=[search_agent], | ||
| ) | ||
| manager_agent.run( | ||
| "If the US keeps its 2024 growth rate, how many years will it take for the GDP to double?" | ||
| ) | ||
| ``` | ||
| ๋์ ๋๋ค! | ||
| ์ด์ `http://0.0.0.0:6006/projects/`๋ก ์ด๋ํ์ฌ ์คํ์ ๊ฒ์ฌํ ์ ์์ต๋๋ค! | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/smolagents/inspect_run_phoenix.png"> | ||
|
|
||
| CodeAgent๊ฐ ๊ด๋ฆฌํ๋ ToolCallingAgent๋ฅผ ํธ์ถํ์ฌ(์ฐธ๊ณ ๋ก ๊ด๋ฆฌ๋๋ ์์ด์ ํธ๋ CodeAgent๊ฐ ๋ ์๋ ์์ต๋๋ค) ๋ฏธ๊ตญ 2024๋ ์ฑ์ฅ๋ฅ ์ ์น์์ ๊ฒ์ํ๋๋ก ์์ฒญํ ๊ฒ์ ํ์ธํ ์ ์์ต๋๋ค. ์ดํ ๊ด๋ฆฌ๋๋ ์์ด์ ํธ๊ฐ ๊ฒฐ๊ณผ๋ฅผ ๋ณด๊ณ ํ๋ฉด, ๊ด๋ฆฌ์ ์์ด์ ํธ๊ฐ ์ด ์ ๋ณด๋ฅผ ํ์ฉํ์ฌ ๊ฒฝ์ ๋ฐฐ์ฆ ์๊ฐ์ ๊ณ์ฐํ์ต๋๋ค! ํฅ๋ฏธ๋กญ์ฃ ? | ||
|
|
||
| ## ๐ชข Langfuse๋ก ํ ๋ ๋ฉํธ๋ฆฌ ์ค์ [[setting-up-telemetry-with-๐ชข-langfuse]] | ||
|
|
||
| ์ด ๋ถ๋ถ์ `SmolagentsInstrumentor`๋ฅผ ์ฌ์ฉํ์ฌ **Langfuse**๋ก Hugging Face **smolagents**๋ฅผ ๋ชจ๋ํฐ๋งํ๊ณ ๋๋ฒ๊น ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค. | ||
|
|
||
| > **Langfuse๋?** [Langfuse](https://langfuse.com)๋ LLM ์์ง๋์ด๋ง์ ์ํ ์คํ์์ค ํ๋ซํผ์ ๋๋ค. AI ์์ด์ ํธ๋ฅผ ์ํ ์ถ์ ๋ฐ ๋ชจ๋ํฐ๋ง ๊ธฐ๋ฅ์ ์ ๊ณตํ์ฌ ๊ฐ๋ฐ์๊ฐ ์ ํ์ ๋๋ฒ๊น ํ๊ณ , ๋ถ์ํ๊ณ , ์ต์ ํํ ์ ์๋๋ก ๋์์ค๋๋ค. Langfuse๋ ๋ค์ดํฐ๋ธ ํตํฉ, OpenTelemetry, SDK๋ฅผ ํตํด ๋ค์ํ ๋๊ตฌ์ ํ๋ ์์ํฌ์ ํตํฉ๋ฉ๋๋ค. | ||
|
|
||
| ### 1๋จ๊ณ: ์์กด์ฑ ์ค์น[[step-1:-install-dependencies]] | ||
|
|
||
| ```python | ||
| %pip install langfuse 'smolagents[telemetry]' openinference-instrumentation-smolagents | ||
| ``` | ||
|
|
||
| ### 2๋จ๊ณ: ํ๊ฒฝ ๋ณ์ ์ค์ [[step-2:-set-up-environment-variables]] | ||
|
|
||
| Langfuse API ํค๋ฅผ ์ค์ ํ๊ณ Langfuse๋ก ์ถ์ ์ ๋ณด๋ด๋๋ก OpenTelemetry ์๋ํฌ์ธํธ๋ฅผ ๊ตฌ์ฑํ์ธ์. [Langfuse Cloud](https://cloud.langfuse.com)์ ๊ฐ์ ํ๊ฑฐ๋ [Langfuse๋ฅผ ์์ฒด ํธ์คํ ](https://langfuse.com/self-hosting)ํ์ฌ Langfuse API ํค๋ฅผ ์ป์ผ์ธ์. | ||
|
|
||
| ๋ํ [Hugging Face ํ ํฐ](https://huggingface.co/settings/tokens) (`HF_TOKEN`)์ ํ๊ฒฝ ๋ณ์๋ก ์ถ๊ฐํ์ธ์. | ||
|
|
||
| ```python | ||
| import os | ||
| # Get keys for your project from the project settings page: https://cloud.langfuse.com | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| os.environ["LANGFUSE_PUBLIC_KEY"] = "pk-lf-..." | ||
| os.environ["LANGFUSE_SECRET_KEY"] = "sk-lf-..." | ||
| os.environ["LANGFUSE_HOST"] = "https://cloud.langfuse.com" # ๐ช๐บ EU region | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| # os.environ["LANGFUSE_HOST"] = "https://us.cloud.langfuse.com" # ๐บ๐ธ US region | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # your Hugging Face token | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| os.environ["HF_TOKEN"] = "hf_..." | ||
| ``` | ||
|
|
||
| ํ๊ฒฝ ๋ณ์๊ฐ ์ค์ ๋๋ฉด ์ด์ Langfuse ํด๋ผ์ด์ธํธ๋ฅผ ์ด๊ธฐํํ ์ ์์ต๋๋ค. `get_client()`๋ ํ๊ฒฝ ๋ณ์์ ์ ๊ณต๋ ์๊ฒฉ ์ฆ๋ช ์ ์ฌ์ฉํ์ฌ Langfuse ํด๋ผ์ด์ธํธ๋ฅผ ์ด๊ธฐํํฉ๋๋ค. | ||
|
|
||
| ```python | ||
| from langfuse import get_client | ||
|
|
||
| langfuse = get_client() | ||
|
|
||
| # Verify connection | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if langfuse.auth_check(): | ||
| print("Langfuse client is authenticated and ready!") | ||
| else: | ||
| print("Authentication failed. Please check your credentials and host.") | ||
| ``` | ||
|
|
||
| ### 3๋จ๊ณ: `SmolagentsInstrumentor` ์ด๊ธฐํ[[step-3:-initialize-the-`smolagentsinstrumentor`]] | ||
|
|
||
| ์ ํ๋ฆฌ์ผ์ด์ ์ฝ๋ ์์์ `SmolagentsInstrumentor`๋ฅผ ์ด๊ธฐํํ์ธ์. | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```python | ||
| from openinference.instrumentation.smolagents import SmolagentsInstrumentor | ||
|
|
||
| SmolagentsInstrumentor().instrument() | ||
| ``` | ||
|
|
||
| ### 4๋จ๊ณ: smolagent ์คํ[[step-4:-run-your-smolagent]] | ||
|
|
||
| ```python | ||
| from smolagents import ( | ||
| CodeAgent, | ||
| ToolCallingAgent, | ||
| WebSearchTool, | ||
| VisitWebpageTool, | ||
| InferenceClientModel, | ||
| ) | ||
|
|
||
| model = InferenceClientModel( | ||
| model_id="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B" | ||
| ) | ||
|
|
||
| search_agent = ToolCallingAgent( | ||
| tools=[WebSearchTool(), VisitWebpageTool()], | ||
| model=model, | ||
| name="search_agent", | ||
| description="This is an agent that can do web search.", | ||
| ) | ||
|
|
||
| manager_agent = CodeAgent( | ||
| tools=[], | ||
| model=model, | ||
| managed_agents=[search_agent], | ||
| ) | ||
| manager_agent.run( | ||
| "How can Langfuse be used to monitor and improve the reasoning and decision-making of smolagents when they execute multi-step tasks, like dynamically adjusting a recipe based on user feedback or available ingredients?" | ||
| ) | ||
| ``` | ||
|
|
||
| ### 5๋จ๊ณ: Langfuse์์ ์ถ์ ๋ณด๊ธฐ[[step-5:-view-traces-in-langfuse]] | ||
|
|
||
| ์์ด์ ํธ๋ฅผ ์คํํ ํ Langfuse์์ smolagents ์ ํ๋ฆฌ์ผ์ด์ ์์ ์์ฑ๋ ์ถ์ ์ ๋ณด๋ฅผ ํ์ธํ ์ ์์ต๋๋ค. AI ์์ด์ ํธ ๋๋ฒ๊น ๊ณผ ์ต์ ํ์ ๋์์ด ๋๋ LLM ์ํธ์์ฉ์ ์์ธํ ๊ณผ์ ์ ์ดํด๋ณผ ์ ์์ต๋๋ค. | ||
FacerAin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|  | ||
|
|
||
| _[Langfuse์ ์ถ์ ์์](https://cloud.langfuse.com/project/cloramnkj0002jz088vzn1ja4/traces/ce5160f9bfd5a6cd63b07d2bfcec6f54?timestamp=2025-02-11T09%3A25%3A45.163Z&display=details)_ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.