Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 0.34.0 #634

Merged
merged 4 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.33.1"
".": "0.34.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-4769b27b6e13acc458cc71fbadd8676ea8074d76f91e37b96eaa97464c4e97af.yml
configured_endpoints: 3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/anthropic-fb94a03f85580f7eacef034518becfb463502e6d74b0f7932f6153239de23a5b.yml
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.34.0 (2024-08-14)

Full Changelog: [v0.33.1...v0.34.0](https://github.com/anthropics/anthropic-sdk-python/compare/v0.33.1...v0.34.0)

### Features

* **api:** add prompt caching beta ([3978411](https://github.com/anthropics/anthropic-sdk-python/commit/397841125164a2420d5abf8f45d47f2467e36cd9))
* **client:** add streaming helpers for prompt caching ([98a0a7b](https://github.com/anthropics/anthropic-sdk-python/commit/98a0a7b9c679539c98d212b12c0a9a950fd6371d))


### Chores

* **examples:** minor formatting changes ([#633](https://github.com/anthropics/anthropic-sdk-python/issues/633)) ([20487ea](https://github.com/anthropics/anthropic-sdk-python/commit/20487ea0080969511e7c41f199387b87a84f6ab4))

## 0.33.1 (2024-08-12)

Full Changelog: [v0.33.0...v0.33.1](https://github.com/anthropics/anthropic-sdk-python/compare/v0.33.0...v0.33.1)
Expand Down
28 changes: 28 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,31 @@ Methods:

- <code title="post /v1/messages">client.messages.<a href="./src/anthropic/resources/messages.py">create</a>(\*\*<a href="src/anthropic/types/message_create_params.py">params</a>) -> <a href="./src/anthropic/types/message.py">Message</a></code>
- <code>client.messages.<a href="./src/anthropic/resources/messages.py">stream</a>(\*args) -> MessageStreamManager[MessageStream] | MessageStreamManager[MessageStreamT]</code>

# Beta

## PromptCaching

### Messages

Types:

```python
from anthropic.types.beta.prompt_caching import (
PromptCachingBetaCacheControlEphemeral,
PromptCachingBetaImageBlockParam,
PromptCachingBetaMessage,
PromptCachingBetaMessageParam,
PromptCachingBetaTextBlockParam,
PromptCachingBetaTool,
PromptCachingBetaToolResultBlockParam,
PromptCachingBetaToolUseBlockParam,
PromptCachingBetaUsage,
RawPromptCachingBetaMessageStartEvent,
RawPromptCachingBetaMessageStreamEvent,
)
```

Methods:

- <code title="post /v1/messages?beta=prompt_caching">client.beta.prompt_caching.messages.<a href="./src/anthropic/resources/beta/prompt_caching/messages.py">create</a>(\*\*<a href="src/anthropic/types/beta/prompt_caching/message_create_params.py">params</a>) -> <a href="./src/anthropic/types/beta/prompt_caching/prompt_caching_beta_message.py">PromptCachingBetaMessage</a></code>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "anthropic"
version = "0.33.1"
version = "0.34.0"
description = "The official Python library for the anthropic API"
dynamic = ["readme"]
license = "MIT"
Expand Down
8 changes: 8 additions & 0 deletions src/anthropic/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
class Anthropic(SyncAPIClient):
completions: resources.Completions
messages: resources.Messages
beta: resources.Beta
with_raw_response: AnthropicWithRawResponse
with_streaming_response: AnthropicWithStreamedResponse

Expand Down Expand Up @@ -136,6 +137,7 @@ def __init__(

self.completions = resources.Completions(self)
self.messages = resources.Messages(self)
self.beta = resources.Beta(self)
self.with_raw_response = AnthropicWithRawResponse(self)
self.with_streaming_response = AnthropicWithStreamedResponse(self)

Expand Down Expand Up @@ -320,6 +322,7 @@ def _make_status_error(
class AsyncAnthropic(AsyncAPIClient):
completions: resources.AsyncCompletions
messages: resources.AsyncMessages
beta: resources.AsyncBeta
with_raw_response: AsyncAnthropicWithRawResponse
with_streaming_response: AsyncAnthropicWithStreamedResponse

Expand Down Expand Up @@ -398,6 +401,7 @@ def __init__(

self.completions = resources.AsyncCompletions(self)
self.messages = resources.AsyncMessages(self)
self.beta = resources.AsyncBeta(self)
self.with_raw_response = AsyncAnthropicWithRawResponse(self)
self.with_streaming_response = AsyncAnthropicWithStreamedResponse(self)

Expand Down Expand Up @@ -583,24 +587,28 @@ class AnthropicWithRawResponse:
def __init__(self, client: Anthropic) -> None:
self.completions = resources.CompletionsWithRawResponse(client.completions)
self.messages = resources.MessagesWithRawResponse(client.messages)
self.beta = resources.BetaWithRawResponse(client.beta)


class AsyncAnthropicWithRawResponse:
def __init__(self, client: AsyncAnthropic) -> None:
self.completions = resources.AsyncCompletionsWithRawResponse(client.completions)
self.messages = resources.AsyncMessagesWithRawResponse(client.messages)
self.beta = resources.AsyncBetaWithRawResponse(client.beta)


class AnthropicWithStreamedResponse:
def __init__(self, client: Anthropic) -> None:
self.completions = resources.CompletionsWithStreamingResponse(client.completions)
self.messages = resources.MessagesWithStreamingResponse(client.messages)
self.beta = resources.BetaWithStreamingResponse(client.beta)


class AsyncAnthropicWithStreamedResponse:
def __init__(self, client: AsyncAnthropic) -> None:
self.completions = resources.AsyncCompletionsWithStreamingResponse(client.completions)
self.messages = resources.AsyncMessagesWithStreamingResponse(client.messages)
self.beta = resources.AsyncBetaWithStreamingResponse(client.beta)


Client = Anthropic
Expand Down
2 changes: 1 addition & 1 deletion src/anthropic/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "anthropic"
__version__ = "0.33.1" # x-release-please-version
__version__ = "0.34.0" # x-release-please-version
6 changes: 6 additions & 0 deletions src/anthropic/lib/streaming/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@
MessageStreamManager as MessageStreamManager,
AsyncMessageStreamManager as AsyncMessageStreamManager,
)
from ._prompt_caching_beta_messages import (
PromptCachingBetaMessageStream as PromptCachingBetaMessageStream,
AsyncPromptCachingBetaMessageStream as AsyncPromptCachingBetaMessageStream,
PromptCachingBetaMessageStreamManager as PromptCachingBetaMessageStreamManager,
AsyncPromptCachingBetaMessageStreamManager as AsyncPromptCachingBetaMessageStreamManager,
)
Loading
Loading