An integration package connecting Moonshot AI and LangChain
Project description
langchain-openai
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for langchain_moonshot-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de57a23e545dc8fc4a8217214728d2e08118118fb835cc24a2cc6889281a000a |
|
MD5 | cc75efabf449ea2ff73c2d825afab3b0 |
|
BLAKE2b-256 | 16bac6352f1e6ff671643927180671deec2d28d65b6bb4a0032168244a809d1e |