Metadata-Version: 2.3
Name: langchain-siliconflow
Version: 0.1.0
Summary: An integration package connecting SiliconFlow and LangChain
License: MIT
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: langchain-core (>=0.3.15,<0.4.0)
Requires-Dist: openai (>=1.98.0,<2.0.0)
Project-URL: Repository, https://github.com/langchain-ai/langchain
Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22siliconflow%3D%3D0%22&expanded=true
Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/partners/siliconflow
Description-Content-Type: text/markdown

# langchain-siliconflow

This package contains the LangChain integration with SiliconFlow

## Installation

```bash
pip install -U langchain-siliconflow
```

And you should configure credentials by setting the following environment variables:

```bash
export SILICONFLOW_API_KEY="your-api-key"
```

You can set the following environment variable to use the `.cn` endpoint:

```bash
export SILICONFLOW_BASE_URL="https://api.siliconflow.cn/v1"
```

## Chat Models

`ChatSiliconFlow` class exposes chat models from SiliconFlow.

```python
from langchain_siliconflow import ChatSiliconFlow

llm = ChatSiliconFlow()
llm.invoke("Sing a ballad of LangChain.")
```

## Embeddings

`SiliconFlowEmbeddings` class exposes embeddings from SiliconFlow.

```python
from langchain_siliconflow import SiliconFlowEmbeddings

embeddings = SiliconFlowEmbeddings()
embeddings.embed_query("What is the meaning of life?")
```

## LLMs
`SiliconFlowLLM` class exposes LLMs from SiliconFlow.

```python
from langchain_siliconflow import SiliconFlowLLM

llm = SiliconFlowLLM()
llm.invoke("The meaning of life is")
```

