Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c5387e6

Browse files
committedFeb 24, 2025·
feat(api): add claude-3.7 + support for thinking
1 parent 1a21c6a commit c5387e6

File tree

68 files changed

+1375
-392
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1375
-392
lines changed
 

‎README.md

+19
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,25 @@ On timeout, an `APITimeoutError` is thrown.
515515

516516
Note that requests that time out are [retried twice by default](#retries).
517517

518+
### Long Requests
519+
520+
> [!IMPORTANT]
521+
> We highly encourage you use the streaming [Messages API](#streaming-responses) for longer running requests.
522+
523+
We do not recommend setting a large `max_tokens` values without using streaming.
524+
Some networks may drop idle connections after a certain period of time, which
525+
can cause the request to fail or [timeout](#timeouts) without receiving a response from Anthropic.
526+
527+
This SDK will also throw a `ValueError` if a non-streaming request is expected to be above roughly 10 minutes long.
528+
Passing `stream=True` or [overriding](#timeouts) the `timeout` option at the client or request level disables this error.
529+
530+
An expected request latency longer than the [timeout](#timeouts) for a non-streaming request
531+
will result in the client terminating the connection and retrying without receiving a response.
532+
533+
We set a [TCP socket keep-alive](https://tldp.org/HOWTO/TCP-Keepalive-HOWTO/overview.html) option in order
534+
to reduce the impact of idle connection timeouts on some networks.
535+
This can be [overriden](#Configuring-the-HTTP-client) by passing a `http_client` option to the client.
536+
518537
## Default Headers
519538

520539
We automatically send the `anthropic-version` header set to `2023-06-01`.

‎api.md

+25
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ from anthropic.types import (
4343
ImageBlockParam,
4444
InputJSONDelta,
4545
Message,
46+
MessageCountTokensTool,
4647
MessageDeltaEvent,
4748
MessageDeltaUsage,
4849
MessageParam,
@@ -60,17 +61,29 @@ from anthropic.types import (
6061
RawMessageStartEvent,
6162
RawMessageStopEvent,
6263
RawMessageStreamEvent,
64+
RedactedThinkingBlock,
65+
RedactedThinkingBlockParam,
66+
SignatureDelta,
6367
TextBlock,
6468
TextBlockParam,
6569
TextCitation,
6670
TextCitationParam,
6771
TextDelta,
72+
ThinkingBlock,
73+
ThinkingBlockParam,
74+
ThinkingConfigDisabled,
75+
ThinkingConfigEnabled,
76+
ThinkingConfigParam,
77+
ThinkingDelta,
6878
Tool,
79+
ToolBash20250124,
6980
ToolChoice,
7081
ToolChoiceAny,
7182
ToolChoiceAuto,
7283
ToolChoiceTool,
7384
ToolResultBlockParam,
85+
ToolTextEditor20250124,
86+
ToolUnion,
7487
ToolUseBlock,
7588
ToolUseBlockParam,
7689
Usage,
@@ -193,20 +206,32 @@ from anthropic.types.beta import (
193206
BetaRawMessageStartEvent,
194207
BetaRawMessageStopEvent,
195208
BetaRawMessageStreamEvent,
209+
BetaRedactedThinkingBlock,
210+
BetaRedactedThinkingBlockParam,
211+
BetaSignatureDelta,
196212
BetaTextBlock,
197213
BetaTextBlockParam,
198214
BetaTextCitation,
199215
BetaTextCitationParam,
200216
BetaTextDelta,
217+
BetaThinkingBlock,
218+
BetaThinkingBlockParam,
219+
BetaThinkingConfigDisabled,
220+
BetaThinkingConfigEnabled,
221+
BetaThinkingConfigParam,
222+
BetaThinkingDelta,
201223
BetaTool,
202224
BetaToolBash20241022,
225+
BetaToolBash20250124,
203226
BetaToolChoice,
204227
BetaToolChoiceAny,
205228
BetaToolChoiceAuto,
206229
BetaToolChoiceTool,
207230
BetaToolComputerUse20241022,
231+
BetaToolComputerUse20250124,
208232
BetaToolResultBlockParam,
209233
BetaToolTextEditor20241022,
234+
BetaToolTextEditor20250124,
210235
BetaToolUnion,
211236
BetaToolUseBlock,
212237
BetaToolUseBlockParam,

0 commit comments

Comments
 (0)
Please sign in to comment.