langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint¶
class langchain.chat_models.baidu_qianfan_endpoint.QianfanChatEndpoint[source]¶
Bases: BaseChatModel
Baidu Qianfan chat models.
To use, you should have the qianfan python package installed, and
the environment variable qianfan_ak and qianfan_sk set with your
API key and Secret Key.
ak, sk are required parameters
which you could get from  https://cloud.baidu.com/product/wenxinworkshop
Example
from langchain.chat_models import QianfanChatEndpoint
qianfan_chat = QianfanChatEndpoint(model="ERNIE-Bot",
    endpoint="your_endpoint", qianfan_ak="your_ak", qianfan_sk="your_sk")
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param cache: Optional[bool] = None¶
Whether to cache the response.
param callback_manager: Optional[BaseCallbackManager] = None¶
Callback manager to add to the run trace.
param callbacks: Callbacks = None¶
Callbacks to add to the run trace.
param client: Any = None¶
param endpoint: Optional[str] = None¶
Endpoint of the Qianfan LLM, required if custom model used.
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model: str = 'ERNIE-Bot-turbo'¶
Model name.
you could get from https://cloud.baidu.com/doc/WENXINWORKSHOP/s/Nlks5zkzu
preset models are mapping to an endpoint.
model will be ignored if endpoint is set
param model_kwargs: Dict[str, Any] [Optional]¶