Home / Class/ Completion Class — anthropic-sdk-python Architecture

Completion Class — anthropic-sdk-python Architecture

Architecture documentation for the Completion class in completion.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  64848efc_cb91_a8cb_d3ef_c23d6a0890a8["Completion"]
  17ce5647_6f06_0676_a4a5_e378a3f57cb1["BaseModel"]
  64848efc_cb91_a8cb_d3ef_c23d6a0890a8 -->|extends| 17ce5647_6f06_0676_a4a5_e378a3f57cb1
  07dcc765_e19a_d5e3_7bde_91136b3fb277["completion.py"]
  64848efc_cb91_a8cb_d3ef_c23d6a0890a8 -->|defined in| 07dcc765_e19a_d5e3_7bde_91136b3fb277

Relationship Graph

Source Code

src/anthropic/types/completion.py lines 12–43

class Completion(BaseModel):
    id: str
    """Unique object identifier.

    The format and length of IDs may change over time.
    """

    completion: str
    """The resulting completion up to and excluding the stop sequences."""

    model: Model
    """
    The model that will complete your prompt.\n\nSee
    [models](https://docs.anthropic.com/en/docs/models-overview) for additional
    details and options.
    """

    stop_reason: Optional[str] = None
    """The reason that we stopped.

    This may be one the following values:

    - `"stop_sequence"`: we reached a stop sequence — either provided by you via the
      `stop_sequences` parameter, or a stop sequence built into the model
    - `"max_tokens"`: we exceeded `max_tokens_to_sample` or the model's maximum
    """

    type: Literal["completion"]
    """Object type.

    For Text Completions, this is always `"completion"`.
    """

Extends

Frequently Asked Questions

What is the Completion class?
Completion is a class in the anthropic-sdk-python codebase, defined in src/anthropic/types/completion.py.
Where is Completion defined?
Completion is defined in src/anthropic/types/completion.py at line 12.
What does Completion extend?
Completion extends BaseModel.

Analyze Your Own Codebase

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

Try Supermodel Free