From 48101cf8d127bbf22d751c7df118a6ce357e2e27 Mon Sep 17 00:00:00 2001 From: wony617 <49024958+Jwaminju@users.noreply.github.com> Date: Sat, 10 Aug 2024 01:58:52 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90=20[i18n-KO]=20Translated=20`agent.?= =?UTF-8?q?md`=20to=20Korean=20(#32351)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: ko: main_classes/agent * feat: chatgpt draft * fix: manual edits * fix: resolve suggestions Co-authored-by: Woojun Jung <46880056+jungnerd@users.noreply.github.com> Co-authored-by: thsamaji <60818655+thsamajiki@users.noreply.github.com> Co-authored-by: SeungAhSon * fix: resolve suggestions * fix: resolve code line number --------- Co-authored-by: Woojun Jung <46880056+jungnerd@users.noreply.github.com> Co-authored-by: thsamaji <60818655+thsamajiki@users.noreply.github.com> Co-authored-by: SeungAhSon --- docs/source/ko/_toctree.yml | 4 +- docs/source/ko/main_classes/agent.md | 134 +++++++++++++++++++++++++++ 2 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 docs/source/ko/main_classes/agent.md diff --git a/docs/source/ko/_toctree.yml b/docs/source/ko/_toctree.yml index 7df493332..d463d29ad 100644 --- a/docs/source/ko/_toctree.yml +++ b/docs/source/ko/_toctree.yml @@ -266,8 +266,8 @@ title: (번역중) 개념 가이드 - sections: - sections: - - local: in_translation - title: (번역중) Agents and Tools + - local: main_classes/agent + title: 에이전트와 도구 - local: in_translation title: (번역중) Auto Classes - local: in_translation diff --git a/docs/source/ko/main_classes/agent.md b/docs/source/ko/main_classes/agent.md new file mode 100644 index 000000000..7e4a74090 --- /dev/null +++ b/docs/source/ko/main_classes/agent.md @@ -0,0 +1,134 @@ + + +# 에이전트 & 도구 [[agents-tools]] + + + +Transformers Agent는 실험 중인 API이므로 언제든지 변경될 수 있습니다. +API나 기반 모델이 자주 업데이트되므로, 에이전트가 제공하는 결과물은 달라질 수 있습니다. + + + +에이전트와 도구에 대해 더 알아보려면 [소개 가이드](../transformers_agents)를 꼭 읽어보세요. +이 페이지에는 기본 클래스에 대한 API 문서가 포함되어 있습니다. + +## 에이전트 [[agents]] + +우리는 기본 [`Agent`] 클래스를 기반으로 두 가지 유형의 에이전트를 제공합니다: +- [`CodeAgent`]는 한 번에 동작합니다. 작업을 해결하기 위해 코드를 생성한 다음, 바로 실행합니다. +- [`ReactAgent`]는 단계별로 동작하며, 각 단계는 하나의 생각, 하나의 도구 호출 및 실행으로 구성됩니다. 이 에이전트에는 두 가지 클래스가 있습니다: + - [`ReactJsonAgent`]는 도구 호출을 JSON으로 작성합니다. + - [`ReactCodeAgent`]는 도구 호출을 Python 코드로 작성합니다. + +### Agent [[agent]] + +[[autodoc]] Agent + +### CodeAgent [[codeagent]] + +[[autodoc]] CodeAgent + +### React agents [[react-agents]] + +[[autodoc]] ReactAgent + +[[autodoc]] ReactJsonAgent + +[[autodoc]] ReactCodeAgent + +## Tools [[tools]] + +### load_tool [[loadtool]] + +[[autodoc]] load_tool + +### Tool [[tool]] + +[[autodoc]] Tool + +### Toolbox [[toolbox]] + +[[autodoc]] Toolbox + +### PipelineTool [[pipelinetool]] + +[[autodoc]] PipelineTool + +### launch_gradio_demo [[launchgradiodemo]] + +[[autodoc]] launch_gradio_demo + +### ToolCollection [[toolcollection]] + +[[autodoc]] ToolCollection + +## 엔진 [[engines]] + +에이전트 프레임워크에서 사용할 수 있는 엔진을 자유롭게 만들고 사용할 수 있습니다. +이 엔진들은 다음과 같은 사양을 가지고 있습니다: +1. 입력(`List[Dict[str, str]]`)에 대한 [메시지 형식](../chat_templating.md)을 따르고 문자열을 반환해야 합니다. +2. 인수 `stop_sequences`에 시퀀스가 전달되기 *전에* 출력을 생성하는 것을 중지해야 합니다. + +### HfEngine [[hfengine]] + +편의를 위해, 위의 사항을 구현하고 대규모 언어 모델 실행을 위해 추론 엔드포인트를 사용하는 `HfEngine`을 추가했습니다. + +```python +>>> from transformers import HfEngine + +>>> messages = [ +... {"role": "user", "content": "Hello, how are you?"}, +... {"role": "assistant", "content": "I'm doing great. How can I help you today?"}, +... {"role": "user", "content": "No need to help, take it easy."}, +... ] + +>>> HfEngine()(messages, stop_sequences=["conversation"]) + +"That's very kind of you to say! It's always nice to have a relaxed " +``` + +[[autodoc]] HfEngine + + +## 에이전트 유형 [[agent-types]] + +에이전트는 도구 간의 모든 유형의 객체를 처리할 수 있습니다; 도구는 완전히 멀티모달이므로 텍스트, 이미지, 오디오, 비디오 등 다양한 유형을 수락하고 반환할 수 있습니다. +도구 간의 호환성을 높이고 ipython (jupyter, colab, ipython 노트북, ...)에서 이러한 +반환 값을 올바르게 렌더링하기 위해 이러한 유형을 중심으로 래퍼 클래스를 +구현합니다. + +래핑된 객체는 처음과 동일하게 작동해야 합니다; 텍스트 객체는 여전히 문자열로 작동해야 하며, +이미지 객체는 여전히 `PIL.Image`로 작동해야 합니다. + +이러한 유형에는 세 가지 특정 목적이 있습니다: + +- `to_raw`를 호출하면 기본 객체가 반환되어야 합니다. +- `to_string`을 호출하면 객체가 문자열로 반환되어야 합니다: +`AgentText`의 경우 문자열이 될 수 있지만, 다른 경우에는 객체의 직렬화된 버전의 경로일 수 있습니다. +- ipython 커널에서 표시할 때 객체가 올바르게 표시되어야 합니다. + +### AgentText [[agenttext]] + +[[autodoc]] transformers.agents.agent_types.AgentText + +### AgentImage [[agentimage]] + +[[autodoc]] transformers.agents.agent_types.AgentImage + +### AgentAudio [[agentaudio]] + +[[autodoc]] transformers.agents.agent_types.AgentAudio