HF Agents Course Day5 실습 파일 (본편 01)
포함 파일
day5_first_agent_smolagents.py
sample_tasks_day5.json
requirements.txt
1) 설치
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
2) 도구 동작 셀프체크
python day5_first_agent_smolagents.py --mode selfcheck
3) 단일 요청 실행
python day5_first_agent_smolagents.py --mode single --provider auto --task "31과 14를 더한 뒤 2를 곱해줘"
4) 배치 평가
python day5_first_agent_smolagents.py --mode eval --provider auto --input sample_tasks_day5.json
성공 판정
- selfcheck 결과:
"tools_ok": true
- eval 결과:
"pass": true 또는 "score" >= 0.66
- key 누락 시
OPENAI_API_KEY 또는 HF_TOKEN을 .env에 설정