langchain/libs/community/langchain_community
ccurme 1538ee17f9
anthropic[major]: support python 3.13 (#27916)
Last week Anthropic released version 0.39.0 of its python sdk, which
enabled support for Python 3.13. This release deleted a legacy
`client.count_tokens` method, which we currently access during init of
the `Anthropic` LLM. Anthropic has replaced this functionality with the
[client.beta.messages.count_tokens()
API](https://github.com/anthropics/anthropic-sdk-python/pull/726).

To enable support for `anthropic >= 0.39.0` and Python 3.13, here we
drop support for the legacy token counting method, and add support for
the new method via `ChatAnthropic.get_num_tokens_from_messages`.

To fully support the token counting API, we update the signature of
`get_num_tokens_from_message` to accept tools everywhere.

---------

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
2024-11-12 14:31:07 -05:00
..
adapters community: [fix] add missing tool_calls kwargs of delta message in openai adapter (#27492) 2024-10-31 14:07:17 -04:00
agent_toolkits Community: Google Books API Tool (#27307) 2024-11-07 15:29:35 -08:00
agents docs: Add OpenAIAssistantV2Runnable docstrings (#27402) 2024-10-30 15:35:51 +00:00
callbacks community: Added anthropic.claude-3-5-sonnet-20241022-v2:0 cost detials (#27728) 2024-10-30 14:01:01 +00:00
chains multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
chat_loaders Improvement[Community] Improve methods in IMessageChatLoader (#25746) 2024-08-26 14:20:22 -04:00
chat_message_histories docs: Add docstrings for CassandraChatMessageHistory class and package namespace function. (#24222) 2024-08-23 15:49:41 +00:00
chat_models anthropic[major]: support python 3.13 (#27916) 2024-11-12 14:31:07 -05:00
cross_encoders multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
docstore infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
document_compressors community: add InfinityRerank (#27043) 2024-11-06 17:26:30 -08:00
document_loaders community: bytes as a source to AzureAIDocumentIntelligenceLoader (#26618) 2024-11-07 03:40:21 +00:00
document_transformers all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
embeddings Improvement[Community]Improve Embeddings API (#28038) 2024-11-12 13:57:35 -05:00
example_selectors multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
graph_vectorstores community: fixed bug in GraphVectorStoreRetriever (#27846) 2024-11-04 20:27:17 +00:00
graphs all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
indexes community[patch]: restore compatibility with SQLAlchemy 1.x (#22546) 2024-06-19 17:58:57 +00:00
llms community: Fix a validation error for MoonshotChat (#27801) 2024-10-31 14:00:16 -04:00
memory all: test 3.13 ci (#27197) 2024-10-25 12:56:58 -07:00
output_parsers multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
query_constructors add neo4j query constructor for self query (#25288) 2024-08-30 14:54:33 +00:00
retrievers multiple: update docs urls to latest 2 (#26837) 2024-09-30 17:37:07 -07:00
storage Fixed typo in llibs/community/langchain_community/storage/sql.py (#27029) 2024-10-08 17:51:26 +00:00
tools Community: Google Books API Tool (#27307) 2024-11-07 15:29:35 -08:00
utilities Community: Google Books API Tool (#27307) 2024-11-07 15:29:35 -08:00
utils multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
vectorstores community[patch]: Added type hinting to OpenSearch clients (#27946) 2024-11-08 11:04:57 -08:00
__init__.py infra: update mypy 1.10, ruff 0.5 (#23721) 2024-07-03 10:33:27 -07:00
cache.py community: Memcached LLM Cache Integration (#27323) 2024-11-07 03:07:59 +00:00
py.typed community[major], core[patch], langchain[patch], experimental[patch]: Create langchain-community (#14463) 2023-12-11 13:53:30 -08:00