Metadata-Version: 2.4
Name: lc-moonshot
Version: 0.1.0
Summary: An integration package connecting Moonshot AI and LangChain
Project-URL: Homepage, https://github.com/saikijoshuke/lc-moonshot
Project-URL: Repository, https://github.com/saikijoshuke/lc-moonshot
License: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <4.0.0,>=3.10.0
Requires-Dist: langchain-core<2.0.0,>=1.4.7
Requires-Dist: langchain-openai<2.0.0,>=1.1.0
Description-Content-Type: text/markdown

# langchain-moonshot

This package contains the LangChain integration with [Moonshot AI](https://moonshot.cn).

## Installation

```bash
pip install -U langchain-moonshot
```

## Chat Models

`ChatMoonshot` exposes Moonshot AI's large language models through LangChain's
`BaseChatModel` interface.

```python
from langchain_moonshot import ChatMoonshot

model = ChatMoonshot(model="moonshot-v1-8k")
model.invoke("Hello!")
```

### Tool calling

```python
from pydantic import BaseModel, Field

class GetWeather(BaseModel):
    """Get the current weather in a given location"""

    location: str = Field(..., description="The city and state, e.g. San Francisco, CA")


model_with_tools = model.bind_tools([GetWeather])
```

## Environment Variables

- `MOONSHOT_API_KEY` — Moonshot API key (required)
- `MOONSHOT_API_BASE` — Custom API base URL (optional, defaults to `https://api.moonshot.cn/v1`)

For more information see the [Moonshot AI API documentation](https://platform.moonshot.cn/docs).
