Here we implement a set of parameters that LangChain is standardizing on to simplify integrations with various LLM monitoring platforms (such as Langsmith). These include standard keys for providers, model names, temperature, stop sequences, etc.
ChatCohere is somewhat distinct in that the .model attribute can be None. Because we always require a string for the model name parameter, I also add a property .model_name that will cache the result of ._get_default_model() if .model is None. I took this from the get_num_tokens method and refactored get_num_tokens to use it. I don't actually know if this is the model that is used behind the scenes when model=None!
Note that we will generally now be calling ._get_default_model() (which makes an additional network call) whenever we first invoke ChatCohere after it's instantiated with no value for model.
We also bump langchain-core to 0.2.0. This is needed to support the new parameters. There are no breaking changes in langchain-core from 0.1 to 0.2, but let me know if you think we'd need to update langchain-cohere to 0.2 as well due to this (we have not been doing this in other integration packages).
Here we implement a set of parameters that LangChain is standardizing on to simplify integrations with various LLM monitoring platforms (such as Langsmith). These include standard keys for providers, model names, temperature, stop sequences, etc.
ChatCohere
is somewhat distinct in that the.model
attribute can be None. Because we always require a string for the model name parameter, I also add a property.model_name
that will cache the result of._get_default_model()
if.model
is None. I took this from theget_num_tokens
method and refactoredget_num_tokens
to use it. I don't actually know if this is the model that is used behind the scenes whenmodel=None
!Note that we will generally now be calling
._get_default_model()
(which makes an additional network call) whenever we first invoke ChatCohere after it's instantiated with no value formodel
.We also bump langchain-core to 0.2.0. This is needed to support the new parameters. There are no breaking changes in langchain-core from 0.1 to 0.2, but let me know if you think we'd need to update langchain-cohere to 0.2 as well due to this (we have not been doing this in other integration packages).