Skip to main content
Open In ColabOpen on GitHub

MoonshotChat

Moonshot 是一家中国初创公司,为企业和个人提供LLM服务。

本示例介绍了如何使用LangChain与Moonshot进行交互。

from langchain_community.llms.moonshot import Moonshot
API Reference: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?")

这个页面有帮助吗?