An integration package connecting SiliconFlow and LangChain
Project description
langchain-siliconflow
This package contains the LangChain integration with SiliconFlow
Installation
pip install -U langchain-siliconflow
And you should configure credentials by setting the following environment variables:
export SILICONFLOW_API_KEY="your-api-key"
You can set the following environment variable to use the .cn endpoint:
export SILICONFLOW_BASE_URL="https://api.siliconflow.cn/v1"
Chat Models
ChatSiliconFlow class exposes chat models from SiliconFlow.
from langchain_siliconflow import ChatSiliconFlow
llm = ChatSiliconFlow()
llm.invoke("Sing a ballad of LangChain.")
Embeddings
SiliconFlowEmbeddings class exposes embeddings from SiliconFlow.
from langchain_siliconflow import SiliconFlowEmbeddings
embeddings = SiliconFlowEmbeddings()
embeddings.embed_query("What is the meaning of life?")
LLMs
SiliconFlowLLM class exposes LLMs from SiliconFlow.
from langchain_siliconflow import SiliconFlowLLM
llm = SiliconFlowLLM()
llm.invoke("The meaning of life is")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_siliconflow-1.0.0.tar.gz.
File metadata
- Download URL: langchain_siliconflow-1.0.0.tar.gz
- Upload date:
- Size: 282.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b3cdda0b9b76ee824fb1efa752433a761dae5c3f421a15cd790ae77ec288eca
|
|
| MD5 |
c246d11be9eeb044d8ed8df7f61b859f
|
|
| BLAKE2b-256 |
6f4612f8430cb9222812110030004c1d1db4ffd6d6996205c77e7e07000f890e
|
File details
Details for the file langchain_siliconflow-1.0.0-py3-none-any.whl.
File metadata
- Download URL: langchain_siliconflow-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d51a8fddcd1cec395079efde669b26cacd214fae90ebb37ab3ae31cb52d7798
|
|
| MD5 |
6b285a62009be2bff311b142abc603a3
|
|
| BLAKE2b-256 |
4e9a64e17e7ce3714d91942430c434de77e16e4446cb9d46ac99ed24e1205b1f
|