anthropics / anthropics/anthropic-sdk-python

Token counting is not supported in Bedrock yet

オープン
#1,103 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
3.9k
フォーク
853
平均マージ
1日 11時間
マージ済み PR(30日)
10

説明

```python
client = AnthropicBedrock(
aws_access_key=AWS_BEDROCK_ACCESS_KEY,
aws_secret_key=AWS_BEDROCK_SECRET_KEY,
)
client.messages.count_tokens(model="global.anthropic.claude-sonnet-4-5-20250929-v1:0", messages=[{"role": "user", "content": "test"}])
```

**anthropic.AnthropicError: Token counting is not supported in Bedrock yet**

---

The message I get from trying to count tokens using `AnthropicBedrock` is pretty clear. It's not supported.

But docs (https://platform.claude.com/docs/en/api/overview#third-party-platform-apis) says `Token counting` is supported on all 3rd party platform APIs.

That's a bit confusing.

Am I doing something wrong in the sdk?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。