프롬프트 구조화
전달 채널을 구조로 설계한다 — 반드시 원문 그대로 도달해야 하는 내용은 send_to_user 같은 전용 도구 스키마로 분리한다.
지침 1건갱신 2026.07.07
send_to_user 도구로 실시간 메시지를 구조화하라
비동기 장기 실행 에이전트에서는 진행 상황 업데이트나 사용자 질문에 대한 직접 답변처럼
원문 그대로(verbatim) 전달돼야 하는 콘텐츠가 턴 중간에 생긴다. 해법은 전달 전용 도구를
만드는 것이다 — 도구 입력(input)은 요약되지 않으므로, 모델이 send_to_user를 호출하면
그 내용이 가공 없이 사용자에게 도달한다.
아래 공식 도구 스키마를 API 요청의 tools 배열에 추가한다:
{
"name": "send_to_user",
"description": "Display a message directly to the user. Use this for progress
updates, partial results, or content the user must see exactly as written
before the task finishes.",
"input_schema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"description": "The content to display to the user."
}
},
"required": ["message"]
}
}도구를 정의하는 것만으로는 부족하다 — 언제 써야 하는지 모르면 모델은 호출하지 않는다. 아래 사용 지시를 시스템 프롬프트에 함께 넣어야 실제로 호출된다:
Between tool calls, when you have content the user must read verbatim (a partial
deliverable, a direct answer to their question), call the send_to_user tool with
that content. Use send_to_user only for user-facing content, not for narration
or reasoning.DO
- 도구 정의 + 시스템 프롬프트 사용 지시를 세트로 배포
- 사용자 대면 콘텐츠(부분 산출물, 직접 답변)에만 사용하도록 한정
DON'T
- 도구만 정의하고 지시 없이 방치 — 호출되지 않는다
- 내레이션·추론 과정까지 send_to_user로 흘려보내기
출처:
Create a send-to-user tool