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

main() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

examples/text_completions_demo_async.py lines 9–17

async def main() -> None:
    client = AsyncAnthropic()

    res = await 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_async.py.
Where is main() defined?
main() is defined in examples/text_completions_demo_async.py at line 9.

Analyze Your Own Codebase

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

Try Supermodel Free