-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bump anthropic from 0.37.1 to 0.39.0 #355
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,10 +24,11 @@ def test_chat_openai_messages(session, openai_model): | |
_LogAssertion(completion_id=session.last_completion_id(), message_content=content).assert_chat_response() | ||
|
||
|
||
@pytest.mark.skip(reason="Anthropic API removed count_tokens in 0.39.0, langchain_community not updated") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. error in langchain-community:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. discussed offline that the test will be enabled with a follow up to upgrade the langchain anthropic 0.3. |
||
@pytest.mark.chat | ||
def test_chat_anthropic_messages(session, anthropic_legacy_model): | ||
def test_chat_anthropic_messages(session, anthropic_model): | ||
log10(anthropic) | ||
llm = ChatAnthropic(model=anthropic_legacy_model, temperature=0.7) | ||
llm = ChatAnthropic(model=anthropic_model, temperature=0.7) | ||
messages = [SystemMessage(content="You are a ping pong machine"), HumanMessage(content="Ping?")] | ||
completion = llm.predict_messages(messages) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anthropic 0.39.0 removed "legacy client.count_tokens() method". We only call create_tokens_usage for message using legacy completion model, like claude-2.1. Tried to use a new API
beta.messages.count_tokens
but got 400 error from the API.https://github.com/anthropics/anthropic-sdk-python/releases
Consider the rare usage of legacy models, I set the token to 0 and we could discuss if we want to deprecate the support in future.