Dewy LangChain Plugin
This package provides Dewy integration for LangChain.
Example:
from langchain_core.runnables import RunnableParallel, RunnablePassthrough
from langchain_core.output_parsers import StrOutputParser
from langchain_core.prompts import ChatPromptTemplate
from dewy_langchain import DewyRetriever
retriever = DewyRetriever.for_collection("main", base_url="http://localhost:8000")
prompt = ChatPromptTemplate.from_messages(
[
(
"system",
"""
You're a helpful AI assistant. Given a user question and some retrieved content, answer the user question.
If none of the articles answer the question, just say you don't know.
Here is the retrieved content:
{context}
""",
),
("human", "{question}"),
]
)
def format_chunks(chunks):
return "\n\n".join([d.page_content for d in chunks])
chain = (
{ "context": retriever | format_chunks, "question": RunnablePassthrough() }
| prompt
| llm
| StrOutputParser()
)
Metadata
Release files for dewy-langchain 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dewy_langchain-0.3.0.tar.gz | 2.0 kB | Without provenance | Details for dewy_langchain-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dewy_langchain-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for dewy_langchain-0.3.0-py3-none-any.whl |
Total release size: 4.6 kB
Release files / dewy_langchain-0.3.0.tar.gz
| Download URL | dewy_langchain-0.3.0.tar.gz |
|---|---|
| Size | 2.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37110deb5d7c6358a419f57e316ae71cdd8ee1b81849ad932876e0bba2035f0c
|
|
BLAKE2b-256 checksum How to use checksums |
e0d87574529bb82ef2beb897bee85adb6b62bc3ecb61ca8b5b07bf463721df92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Release files / dewy_langchain-0.3.0-py3-none-any.whl
| Download URL | dewy_langchain-0.3.0-py3-none-any.whl |
|---|---|
| Size | 2.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b7519509ca1f8404935271b02c6da701179d845dd587509b818f4610c0bb56e
|
|
BLAKE2b-256 checksum How to use checksums |
0dfb76570af4e1d3f806619364d94ccb8a021b5fcef6a7f4ffc47480233f2950
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.8
|
Security for dewy-langchain 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.