langchain-ragie
Ragie (https://ragie.ai) integration for LangChain
Install
pip install langchain-ragie
Usage
If you need asyncio, see this example..
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_core.runnables import RunnablePassthrough
import langchain_ragie
template = """Answer the question based only on the following context:
{context}
Question: {question}
"""
prompt = ChatPromptTemplate.from_template(template)
model = ChatOpenAI()
retriever = langchain_ragie.RagieRetriever()
def format_docs(docs):
return "\n\n".join([d.page_content for d in docs])
chain = (
{"context": retriever | format_docs, "question": RunnablePassthrough()}
| prompt
| model
| StrOutputParser()
)
response = chain.invoke("What do the besties think about Davos?")
print(response)
License
Distributed under the MIT License. See LICENSE.txt for more information.
Metadata
Release files for langchain-ragie 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_ragie-0.3.2.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_ragie-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / langchain_ragie-0.3.2.tar.gz
| Download URL | langchain_ragie-0.3.2.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
52b17d118da021e1bcfc581fc7987a0a006a0c2cdfd0a6501083d15325081982
|
|
BLAKE2b-256 checksum How to use checksums |
7e6973f1bfbded0ba94b89c19540aaaf2e37d1628145b00357a6b466725aaa7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/24.4.0
|
Release files / langchain_ragie-0.3.2-py3-none-any.whl
| Download URL | langchain_ragie-0.3.2-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8499ce2051cfd6af7fe477e9874d31a519f660a9c81e001fa2461b0acc1d9da9
|
|
BLAKE2b-256 checksum How to use checksums |
adfd9e7e688256798040ceb39f47f466f9fff531f4700600e41166ba39ae14fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.12.2 Darwin/24.4.0
|