Home / File/ completion.py — anthropic-sdk-python Source File

completion.py — anthropic-sdk-python Source File

Architecture documentation for completion.py, a python file in the anthropic-sdk-python codebase. 4 imports, 1 dependents.

File python AnthropicClient 4 imports 1 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  07dcc765_e19a_d5e3_7bde_91136b3fb277["completion.py"]
  aa80407b_6ce3_389a_8463_fe4caf9aa0bd["model.py"]
  07dcc765_e19a_d5e3_7bde_91136b3fb277 --> aa80407b_6ce3_389a_8463_fe4caf9aa0bd
  699c911a_fb78_b883_732f_5ac6bf31d4a3["_models"]
  07dcc765_e19a_d5e3_7bde_91136b3fb277 --> 699c911a_fb78_b883_732f_5ac6bf31d4a3
  89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875["typing"]
  07dcc765_e19a_d5e3_7bde_91136b3fb277 --> 89ddcdd7_3ae1_4c7b_41bb_9f1e25f16875
  37c05070_ca59_d596_7250_de9d1939227f["typing_extensions"]
  07dcc765_e19a_d5e3_7bde_91136b3fb277 --> 37c05070_ca59_d596_7250_de9d1939227f
  2eb1aa7f_c778_4d68_0a26_a102fadd9638["__init__.py"]
  2eb1aa7f_c778_4d68_0a26_a102fadd9638 --> 07dcc765_e19a_d5e3_7bde_91136b3fb277
  style 07dcc765_e19a_d5e3_7bde_91136b3fb277 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

from .model import Model
from .._models import BaseModel

__all__ = ["Completion"]


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"`.
    """

Classes

Dependencies

Frequently Asked Questions

What does completion.py do?
completion.py is a source file in the anthropic-sdk-python codebase, written in python. It belongs to the AnthropicClient domain.
What does completion.py depend on?
completion.py imports 4 module(s): _models, model.py, typing, typing_extensions.
What files import completion.py?
completion.py is imported by 1 file(s): __init__.py.
Where is completion.py in the architecture?
completion.py is located at src/anthropic/types/completion.py (domain: AnthropicClient, directory: src/anthropic/types).

Analyze Your Own Codebase

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

Try Supermodel Free