Skip to main content

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

langchain_siliconflow-1.0.0.tar.gz (282.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_siliconflow-1.0.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_siliconflow-1.0.0.tar.gz.

File metadata

File hashes

Hashes for langchain_siliconflow-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9b3cdda0b9b76ee824fb1efa752433a761dae5c3f421a15cd790ae77ec288eca
MD5 c246d11be9eeb044d8ed8df7f61b859f
BLAKE2b-256 6f4612f8430cb9222812110030004c1d1db4ffd6d6996205c77e7e07000f890e

See more details on using hashes here.

File details

Details for the file langchain_siliconflow-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_siliconflow-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8d51a8fddcd1cec395079efde669b26cacd214fae90ebb37ab3ae31cb52d7798
MD5 6b285a62009be2bff311b142abc603a3
BLAKE2b-256 4e9a64e17e7ce3714d91942430c434de77e16e4446cb9d46ac99ed24e1205b1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page