Python
Integrate with the MiniMaxChat chat model using LangChain Python.
import os os.environ["MINIMAX_GROUP_ID"] = "MINIMAX_GROUP_ID" os.environ["MINIMAX_API_KEY"] = "MINIMAX_API_KEY"
from langchain_community.chat_models import MiniMaxChat from langchain.messages import HumanMessage
chat = MiniMaxChat( # base_url="https://api.minimaxi.com/v1/text/chatcompletion_v2" use this base_url if you are in China )
chat( [ HumanMessage( content="Translate this sentence from English to French. I love programming." ) ] )
Was this page helpful?