Skip to content

docs: add completion receipt example#965

Open
aDragon0707 wants to merge 1 commit into
anthropics:mainfrom
aDragon0707:examples/completion-receipt
Open

docs: add completion receipt example#965
aDragon0707 wants to merge 1 commit into
anthropics:mainfrom
aDragon0707:examples/completion-receipt

Conversation

@aDragon0707
Copy link
Copy Markdown

Summary

Adds a small example showing how to request a structured completion receipt from the Python SDK.

The example uses the existing ClaudeAgentOptions.output_format JSON schema support and reads the receipt from ResultMessage.structured_output. It separates:

  • agent claims
  • supporting evidence
  • unsupported or unverified claims
  • next owner
  • human approval boundaries

Motivation

Agent final answers can include operational claims such as task completed, tests passed, branch ready to merge, or deployment ready.

Those claims may need evidence from tool outputs, logs, traces, file diffs, command output, or human approval before a workflow treats the task as complete.

This example keeps the receipt as typed structured output rather than requiring downstream code to parse free-form final text.

Notes

  • Example-only change.
  • No runtime dependency.
  • No behavior change.
  • Safety-oriented guidance for final output review.

Verification

  • python -m py_compile examples/completion_receipt.py
  • git diff --check --cached
  • Not run: python -m ruff check examples/completion_receipt.py because ruff is not installed in this local environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant