MoonshotChat
Moonshot 是一家为企业和个人提供大型语言模型服务的中国初创公司。
本示例介绍了如何使用 LangChain 与 Moonshot 进行交互。
<!--IMPORTS:[{"imported": "Moonshot", "source": "langchain_community.llms.moonshot", "docs": "https://python.langchain.com/api_reference/community/llms/langchain_community.llms.moonshot.Moonshot.html", "title": "MoonshotChat"}]-->
from langchain_community.llms.moonshot import Moonshot
import os
# Generate your api key from: https://platform.moonshot.cn/console/api-keys
os.environ["MOONSHOT_API_KEY"] = "MOONSHOT_API_KEY"
llm = Moonshot()
# or use a specific model
# Available models: https://platform.moonshot.cn/docs
# llm = Moonshot(model="moonshot-v1-128k")
# Prompt the model
llm.invoke("What is the difference between panda and bear?")