Loading...
  • 빌드
  • 관리
  • 모델 및 가격
  • 클라이언트 SDK
  • API 참조
Search...
⌘K
Log in
결과 정의
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
빌드/에이전트에 작업 위임

결과 정의

에이전트에게 '완료'가 무엇인지 알려주고, 그것을 달성할 때까지 반복하도록 하세요.

Outcomes는 Research Preview 기능입니다. 액세스 요청하여 시도해보세요.

outcome은 세션을 대화에서 작업으로 끌어올립니다. 최종 결과가 어떻게 보여야 하는지, 그리고 품질을 어떻게 측정할지 정의합니다. 에이전트는 그 목표를 향해 작업하며, 자체 평가하고 결과가 충족될 때까지 반복합니다.

결과를 정의하면, 하네스는 자동으로 아티팩트를 루브릭에 대해 평가할 채점자를 프로비저닝합니다. 메인 에이전트의 구현 선택에 영향을 받지 않도록 별도의 컨텍스트 윈도우를 활용합니다.

채점자는 기준별 분석을 반환합니다: 아티팩트가 루브릭을 만족하는지 확인하거나, 현재 작업과 요구사항 간의 구체적인 격차를 반환합니다. 그 피드백은 다음 반복을 위해 에이전트에게 전달됩니다.

모든 Managed Agents API 요청에는 managed-agents-2026-04-01 베타 헤더가 필요합니다. Research preview 기능은 추가로 managed-agents-2026-04-01-research-preview가 필요합니다. SDK는 이러한 베타 헤더를 자동으로 설정합니다.

루브릭 만들기

루브릭은 기준별 채점을 설명하는 마크다운 문서입니다. 루브릭은 필수입니다.

예제 루브릭:

# DCF 모델 루브릭

## 수익 예측
- 지난 5 회계연도의 역사적 수익 데이터 사용
- 최소 5년 이상 미래 수익 예측
- 성장률 가정이 명시적으로 표시되고 합리적임

## 비용 구조
- COGS 및 운영 비용이 별도로 모델링됨
- 마진이 역사적 추세와 일치하거나 편차가 정당화됨

## 할인율
- WACC가 자본 비용 및 부채 비용에 대한 명시된 가정으로 계산됨
- 베타, 무위험 이자율 및 주식 위험 프리미엄이 출처가 있거나 정당화됨

## 터미널 가치
- 영구성장 또는 출구 배수 방법 중 하나 사용 (어느 것인지 명시)
- 터미널 성장률이 장기 GDP 성장을 초과하지 않음

## 출력 품질
- 모든 수치가 명확하게 레이블이 지정된 시트가 있는 단일 .xlsx 파일에 있음
- 주요 가정이 별도의 "Assumptions" 시트에 있음
- WACC 및 터미널 성장률에 대한 민감도 분석이 포함됨

루브릭을 user.define_outcome에 인라인 텍스트로 전달하거나 (다음 섹션에 표시), 세션 전체에서 재사용하기 위해 Files API를 통해 업로드하세요:

베타 헤더 files-api-2025-04-14 필요.

from pathlib import Path

rubric = client.beta.files.upload(file=Path("/path/to/pr_review_rubric.md"))
print(f"Uploaded rubric: {rubric.id}")

결과를 포함한 세션 만들기

세션을 만든 후, user.define_outcome 이벤트를 보냅니다. 에이전트는 즉시 작업을 시작합니다. 추가 사용자 메시지 이벤트는 필요하지 않습니다.

# Create a session
session = client.beta.sessions.create(
    agent=agent.id,
    environment_id=environment.id,
    title="Financial analysis on Costco",
)

# Define the outcome — agent starts working on receipt
client.beta.sessions.events.send(
    session_id=session.id,
    events=[
        {
            "type": "user.define_outcome",
            "description": "Build a DCF model for Costco in .xlsx",
            "rubric": {"type": "text", "content": RUBRIC},
            # or: "rubric": {"type": "file", "file_id": rubric.id},
            "max_iterations": 5,  # optional; default 3, max 20
        }
    ],
)

결과 이벤트

결과 지향 세션의 진행 상황은 이벤트 스트림에 표시됩니다.

  • agent.* 이벤트 (메시지, 도구 사용 등)는 결과를 향한 진행 상황을 보여줍니다.
  • span.outcome_evaluation_* 이벤트는 결과 지향 세션에서만 발생하며 반복 루프의 수와 채점자의 피드백 프로세스를 보여줍니다.
  • 결과 지향 세션에 user.message 이벤트를 보내서 에이전트의 작업을 진행 중에 지시할 수도 있지만, 이것이 반드시 필요한 것은 아닙니다. 에이전트는 반복을 소진하거나 결과를 달성할 때까지 작업하도록 알고 있습니다.
  • user.interrupt 이벤트는 현재 결과에 대한 작업을 일시 중지하고 span.outcome_evaluation_end.result를 interrupted로 표시하여 새로운 결과를 시작할 수 있게 합니다.
  • 최종 결과 평가 후, 세션을 대화형 세션으로 계속하거나 새로운 결과를 시작할 수 있습니다. 세션은 이전 결과의 기록을 유지합니다.

결과 정의 사용자 이벤트

한 번에 하나의 결과만 지원되지만, 결과를 순서대로 연결할 수 있습니다. 이를 수행하려면 이전 결과의 터미널 이벤트 후에 새로운 user.define_outcome 이벤트를 보냅니다.

이것은 결과를 시작하기 위해 보내는 이벤트입니다. 수신 시 processed_at 타임스탬프와 outcome_id를 포함하여 에코백됩니다.

{
  "type": "user.define_outcome",
  "description": "Build a DCF model for Costco in .xlsx",
  "rubric": { "type": "file", "file_id": "file_01..." },
  "max_iterations": 5
}

결과 평가 시작

채점자가 하나의 반복 루프에 대한 평가를 시작하면 발생합니다. iteration 필드는 0부터 시작하는 수정 카운터입니다: 0은 첫 번째 평가, 1은 첫 번째 수정 후 재평가 등입니다.

{
  "type": "span.outcome_evaluation_start",
  "id": "sevt_01def...",
  "outcome_id": "outc_01a...",
  "iteration": 0,
  "processed_at": "2026-03-25T14:01:45Z"
}

결과 평가 진행 중

채점자가 실행되는 동안 발생하는 하트비트입니다. 채점자의 내부 추론은 불투명합니다: 그것이 작업 중인 것은 보이지만 무엇을 생각하고 있는지는 보이지 않습니다.

{
  "type": "span.outcome_evaluation_ongoing",
  "id": "sevt_01ghi...",
  "outcome_id": "outc_01a...",
  "processed_at": "2026-03-25T14:02:10Z"
}

결과 평가 종료

채점자가 하나의 반복 평가를 완료한 후 발생합니다. result 필드는 다음에 무엇이 일어나는지를 나타냅니다.

결과다음
satisfied세션이 idle로 전환됩니다.
needs_revision에이전트가 새로운 반복 사이클을 시작합니다.
max_iterations_reached추가 평가 사이클이 없습니다. 에이전트는 세션이 idle로 전환되기 전에 최종 수정을 실행할 수 있습니다.
failed세션이 idle로 전환됩니다. 루브릭이 기본적으로 작업과 일치하지 않을 때 반환됩니다. 예를 들어 설명과 루브릭이 서로 모순되는 경우입니다.
interruptedoutcome_evaluation_start가 인터럽트 전에 이미 발생한 경우에만 발생합니다.
{
  "type": "span.outcome_evaluation_end",
  "id": "sevt_01jkl...",
  "outcome_evaluation_start_id": "sevt_01def...",
  "outcome_id": "outc_01a...",
  "result": "satisfied",
  "explanation": "All 12 criteria met: revenue projections use 5 years of historical data, WACC assumptions are stated, sensitivity table is included...",
  "iteration": 0,
  "usage": {
    "input_tokens": 2400,
    "output_tokens": 350,
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 1800
  },
  "processed_at": "2026-03-25T14:03:00Z"
}

결과 상태 확인

이벤트 스트림에서 span.outcome_evaluation_end를 수신하거나, GET /v1/sessions/:id를 폴링하고 outcome_evaluations[].result를 읽을 수 있습니다:

session = client.beta.sessions.retrieve(session.id)

for outcome in session.outcome_evaluations:
    print(f"{outcome.outcome_id}: {outcome.result}")
    # outc_01a...: satisfied

결과물 검색

에이전트는 출력 파일을 컨테이너 내의 /mnt/session/outputs/에 씁니다. 세션이 유휴 상태가 되면, 세션으로 범위가 지정된 Files API를 통해 가져옵니다:

files = client.beta.files.list(scope_id=session.id)
for f in files.data:
    print(f"{f.id}: {f.filename} ({f.size_bytes} bytes)")

content = client.beta.files.download(files.data[0].id)
content.write_to_file("costco_dcf.xlsx")

Was this page helpful?