Skip to main content

An integration package connecting Moonshot AI and LangChain

Project description

langchain-moonshot

This package contains the LangChain integrations for MoonshotAI through the openai SDK.

Installation and Setup

  • Install the LangChain partner package
pip install langchain-moonshot
  • Get a Moonshot api key and set it as an environment variable (MOONSHOT_API_KEY)
  • Get a Moonshot base url and set it as an environment variable (MOONSHOT_API_BASE)

LLM

See a usage example.

from langchain_moonshot import OpenAI

Obsolete: If you are using a model hosted on Azure, you should use different wrapper for that:

from langchain_openai import AzureOpenAI

For a more detailed walkthrough of the Azure wrapper, see here

Chat model

See a usage example.

from langchain_moonshot import ChatOpenAI

Obsolete: If you are using a model hosted on Azure, you should use different wrapper for that:

from langchain_openai import AzureChatOpenAI

For a more detailed walkthrough of the Azure wrapper, see here

Text Embedding Model

See a usage example

from langchain_moonshot import OpenAIEmbeddings

Obsolete: If you are using a model hosted on Azure, you should use different wrapper for that:

from langchain_openai import AzureOpenAIEmbeddings

For a more detailed walkthrough of the Azure wrapper, see here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

langchain_moonshot-0.0.7-py3-none-any.whl (33.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page