to the package langchain/chat_models in langchain# Install the packagepip install dashscope# Get a new token: https://help.aliyun.com/document_detail/611472.html?spm=a2c4g.2399481.0.0from getpass import getpassDASHSCOPE_API_KEY = getpass()     ¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑import osos.environ["DASHSCOPE_API_KEY"] = DASHSCOPE_API_KEYfrom langchain.chat_models.tongyi import ChatTongyifrom langchain.schema import HumanMessagechatLLM = ChatTongyi(    streaming=True,)res = chatLLM.stream([HumanMessage(content="hi")], streaming=True)for r in res:    print("chat resp:", r)    chat resp: content='Hello! How' additional_kwargs={} example=False    chat resp: content=' can I assist you today?' additional_kwargs={} example=Falsefrom langchain.schema import AIMessage, HumanMessage, SystemMessagemessages = [    SystemMessage(        content="You are a helpful assistant that translates English to French."    ),    HumanMessage(        content="Translate this sentence from English to French. I love programming."    ),]chatLLM(messages)    AIMessageChunk(content="J'aime programmer.", additional_kwargs={}, example=False)PreviousPromptLayer ChatOpenAINextvLLM ChatCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Tongyi Qwen is a large language model developed by Alibaba's Damo Academy. It is capable of understanding user intent through natural language understanding and semantic analysis, based on user input in natural language. It provides services and assistance to users in different domains and tasks. By providing clear and detailed instructions, you can obtain results that better align with your expectations.
Tongyi Qwen is a large language model developed by Alibaba's Damo Academy. It is capable of understanding user intent through natural language understanding and semantic analysis, based on user input in natural language. It provides services and assistance to users in different domains and tasks. By providing clear and detailed instructions, you can obtain results that better align with your expectations. ->: to the package langchain/chat_models in langchain# Install the packagepip install dashscope# Get a new token: https://help.aliyun.com/document_detail/611472.html?spm=a2c4g.2399481.0.0from getpass import getpassDASHSCOPE_API_KEY = getpass()     ¬∑¬∑¬∑¬∑¬∑¬∑¬∑¬∑import osos.environ["DASHSCOPE_API_KEY"] = DASHSCOPE_API_KEYfrom langchain.chat_models.tongyi import ChatTongyifrom langchain.schema import HumanMessagechatLLM = ChatTongyi(    streaming=True,)res = chatLLM.stream([HumanMessage(content="hi")], streaming=True)for r in res:    print("chat resp:", r)    chat resp: content='Hello! How' additional_kwargs={} example=False    chat resp: content=' can I assist you today?' additional_kwargs={} example=Falsefrom langchain.schema import AIMessage, HumanMessage, SystemMessagemessages = [    SystemMessage(        content="You are a helpful assistant that translates English to French."    ),    HumanMessage(        content="Translate this sentence from English to French. I love programming."    ),]chatLLM(messages)    AIMessageChunk(content="J'aime programmer.", additional_kwargs={}, example=False)PreviousPromptLayer ChatOpenAINextvLLM ChatCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.