ChatAnyscale()Get the namespace of the langchain object.
Build extra kwargs from additional params that were passed in.
Use tenacity to retry the completion call.
Get the tokens present in the text with tiktoken package.
Bind functions (and other objects) to this chat model.
Calculate num tokens with tiktoken package. Official documentation: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb
Anyscale Chat large language models.
See https://www.anyscale.com/ for information about Anyscale.
To use, you should have the openai python package installed, and the
environment variable ANYSCALE_API_KEY set with your API key.
Alternatively, you can use the anyscale_api_key keyword argument.
Any parameters that are valid to be passed to the openai.create call can be passed
in, even if not explicitly saved on this class.
Example:
.. code-block:: python
from langchain_community.chat_models import ChatAnyscale chat = ChatAnyscale(model_name="meta-llama/Llama-2-7b-chat-hf")