Home / Function/ main() — anthropic-sdk-python Function Reference

main() — anthropic-sdk-python Function Reference

Architecture documentation for the main() function in text_completions_demo_sync.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  7c19ad66_f468_ec93_fd97_b8cf54634d2d["main()"]
  c92a4371_65da_f91b_de51_0ed21038c4f6["text_completions_demo_sync.py"]
  7c19ad66_f468_ec93_fd97_b8cf54634d2d -->|defined in| c92a4371_65da_f91b_de51_0ed21038c4f6
  style 7c19ad66_f468_ec93_fd97_b8cf54634d2d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

examples/text_completions_demo_sync.py lines 7–15

def main() -> None:
    client = Anthropic()

    res = client.completions.create(
        model="claude-sonnet-4-5-20250929",
        prompt=f"{anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court? {anthropic.AI_PROMPT}",
        max_tokens_to_sample=1000,
    )
    print(res.completion)

Subdomains

Frequently Asked Questions

What does main() do?
main() is a function in the anthropic-sdk-python codebase, defined in examples/text_completions_demo_sync.py.
Where is main() defined?
main() is defined in examples/text_completions_demo_sync.py at line 7.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free