분할 정복: 전문 에이전트 만들기
여러분은 여동생의 컴퓨터 과학 프로그램 지원을 돕고 있어요. 학교 조사, 프로그램 비교, 설득력 있는 에세이 작성까지 챙길 일이 많죠.
과정을 더 수월하게 만들기 위해 두 가지 전문 에이전트를 만들기로 했습니다:
- 대학교와 지원 요건을 조사하는 에이전트
- 매력적인 지원 에세이를 작성하도록 돕는 에이전트
여러분에게는 CodeAgent와 WebSearchTool 클래스, 그리고 미리 구성된 model이 제공됩니다.
이 연습은 강의의 일부입니다
Hugging Face smolagents로 AI 에이전트 만들기
연습 안내
- 첫 번째 에이전트에서
tools매개변수에WebSearchTool을 포함하세요. - 역시 첫 번째 에이전트에서, 학교 조사 에이전트임을 식별할 수 있도록
name문자열을 제공하세요. - 두 번째 에이전트에서
model매개변수에 제공된 모델 변수를 사용하세요. - 마지막으로, 두 번째 에이전트의 목적을 요약하도록
description을 완성하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# School research specialist
school_agent = CodeAgent(
# Assign a list of tools the agent can use
____=[WebSearchTool()],
model=model,
# Set the agent's unique name identifier
____="school_research_agent",
description="Expert in researching universities, programs, and admission requirements"
)
# Essay writing specialist
essay_agent = CodeAgent(
tools=[WebSearchTool()],
# Provide the model used to generate responses
____=model,
name="essay_writing_agent",
# Write a short description of the agent's area of expertise
____="Expert in crafting compelling college application essays and personal statements"
)