langchain/libs/partners/openai/langchain_openai
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
..
chat_models anthropic[major]: support python 3.13 (#27916) 2024-11-12 14:31:07 -05:00
embeddings openai[patch]: Release 0.2.4 (#27652) 2024-10-25 20:26:21 +00:00
llms partners/openai + community: Async Azure AD token provider support for Azure OpenAI (#27488) 2024-10-22 21:43:06 +00:00
output_parsers langchain[patch], core[patch], openai[patch], fireworks[minor]: ChatFireworks.with_structured_output (#18078) 2024-02-26 12:46:39 -08:00
__init__.py infra: add more formatter rules to openai (#23189) 2024-06-19 11:39:58 -07:00
py.typed