mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-20 01:49:51 +00:00
docs(langchain): create SiliconFlow provider entry (#32342)
SiliconFlow's provider integration will be maintained at https://github.com/siliconflow/langchain-siliconflow This PR introduce the basic instruction to make use of the pip package
This commit is contained in:
parent
7932e1edd1
commit
f4f919768e
43
docs/docs/integrations/providers/siliconflow.mdx
Normal file
43
docs/docs/integrations/providers/siliconflow.mdx
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# 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?")
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user