Skip to content

Commit

Permalink
refactor(api): mark completions API as legacy (#346)
Browse files Browse the repository at this point in the history
This has been replaced by the messages API which is now GA.
  • Loading branch information
stainless-bot authored Feb 14, 2024
1 parent 3323883 commit 2bb25a1
Showing 1 changed file with 66 additions and 12 deletions.
78 changes: 66 additions & 12 deletions src/anthropic/resources/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,17 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = 600,
) -> Completion:
"""
Create a Text Completion
"""[Legacy] Create a Text Completion.
The Text Completions API is a legacy API.
We recommend using the
[Messages API](https://docs.anthropic.com/claude/reference/messages_post) going
forward.
Future models and features will not be compatible with Text Completions. See our
[migration guide](https://docs.anthropic.com/claude/reference/migrating-from-text-completions-to-messages)
for guidance in migrating from Text Completions to Messages.
Args:
max_tokens_to_sample: The maximum number of tokens to generate before stopping.
Expand Down Expand Up @@ -147,8 +156,17 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = 600,
) -> Stream[Completion]:
"""
Create a Text Completion
"""[Legacy] Create a Text Completion.
The Text Completions API is a legacy API.
We recommend using the
[Messages API](https://docs.anthropic.com/claude/reference/messages_post) going
forward.
Future models and features will not be compatible with Text Completions. See our
[migration guide](https://docs.anthropic.com/claude/reference/migrating-from-text-completions-to-messages)
for guidance in migrating from Text Completions to Messages.
Args:
max_tokens_to_sample: The maximum number of tokens to generate before stopping.
Expand Down Expand Up @@ -243,8 +261,17 @@ def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = 600,
) -> Completion | Stream[Completion]:
"""
Create a Text Completion
"""[Legacy] Create a Text Completion.
The Text Completions API is a legacy API.
We recommend using the
[Messages API](https://docs.anthropic.com/claude/reference/messages_post) going
forward.
Future models and features will not be compatible with Text Completions. See our
[migration guide](https://docs.anthropic.com/claude/reference/migrating-from-text-completions-to-messages)
for guidance in migrating from Text Completions to Messages.
Args:
max_tokens_to_sample: The maximum number of tokens to generate before stopping.
Expand Down Expand Up @@ -393,8 +420,17 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = 600,
) -> Completion:
"""
Create a Text Completion
"""[Legacy] Create a Text Completion.
The Text Completions API is a legacy API.
We recommend using the
[Messages API](https://docs.anthropic.com/claude/reference/messages_post) going
forward.
Future models and features will not be compatible with Text Completions. See our
[migration guide](https://docs.anthropic.com/claude/reference/migrating-from-text-completions-to-messages)
for guidance in migrating from Text Completions to Messages.
Args:
max_tokens_to_sample: The maximum number of tokens to generate before stopping.
Expand Down Expand Up @@ -489,8 +525,17 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = 600,
) -> AsyncStream[Completion]:
"""
Create a Text Completion
"""[Legacy] Create a Text Completion.
The Text Completions API is a legacy API.
We recommend using the
[Messages API](https://docs.anthropic.com/claude/reference/messages_post) going
forward.
Future models and features will not be compatible with Text Completions. See our
[migration guide](https://docs.anthropic.com/claude/reference/migrating-from-text-completions-to-messages)
for guidance in migrating from Text Completions to Messages.
Args:
max_tokens_to_sample: The maximum number of tokens to generate before stopping.
Expand Down Expand Up @@ -585,8 +630,17 @@ async def create(
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = 600,
) -> Completion | AsyncStream[Completion]:
"""
Create a Text Completion
"""[Legacy] Create a Text Completion.
The Text Completions API is a legacy API.
We recommend using the
[Messages API](https://docs.anthropic.com/claude/reference/messages_post) going
forward.
Future models and features will not be compatible with Text Completions. See our
[migration guide](https://docs.anthropic.com/claude/reference/migrating-from-text-completions-to-messages)
for guidance in migrating from Text Completions to Messages.
Args:
max_tokens_to_sample: The maximum number of tokens to generate before stopping.
Expand Down

0 comments on commit 2bb25a1

Please sign in to comment.