Skip to content

Commit a095733

Browse files
committed
New Anthropic tokenizer.json URL
1 parent 1bc3940 commit a095733

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

haystack/nodes/prompt/invocation_layer/anthropic_claude.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
# Taken from:
2323
# https://github.com/anthropics/anthropic-sdk-python/blob/main/anthropic/tokenizer.py#L7
2424
# This is a JSON config to load the tokenizer used for Anthropic Claude.
25-
CLAUDE_TOKENIZER_REMOTE_FILE = (
26-
"https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/main/src/anthropic/tokenizer.json"
27-
)
25+
# Anthropic removed tokenizer.json from their repo (https://github.com/anthropics/anthropic-sdk-python/pull/726),
26+
# we need to use the commit from the latest version of the SDK that still
27+
# has it, i.e. 0.38.0 and commit hash 14afc93ffd809e60666a267763a57a328184c5e4.
28+
CLAUDE_TOKENIZER_REMOTE_FILE = "https://raw.githubusercontent.com/anthropics/anthropic-sdk-python/14afc93ffd809e60666a267763a57a328184c5e4/src/anthropic/tokenizer.json"
2829

2930

3031
class AnthropicClaudeInvocationLayer(PromptModelInvocationLayer):

0 commit comments

Comments
 (0)