Skip to main content

Eunomia SDK for LangChain

This project has been archived.

The maintainers of this project have marked this project as archived. No new releases are expected.

Project description

Eunomia SDK for LangChain

This package allows to stream LangChain's loaders resources and their metadata to the Eunomia server for an easier policy configuration process.

Installation

Install the eunomia-sdk-langchain package via pip:

pip install eunomia-sdk-langchain

Usage

The EunomiaLoader class is a wrapper around any loader class from LangChain.

Assume you want to use the CSVLoader, you can do the following:

from eunomia_sdk_langchain import EunomiaLoader
from langchain_community.document_loaders.csv_loader import CSVLoader

loader = CSVLoader(...)
wrapped_loader = EunomiaLoader(loader, server_url="http://localhost:8000")

You can then call any of the load methods:

# Synchronous loading
docs = wrapped_loader.load()

# Synchronous lazy loading
docs = []
for doc in wrapped_loader.lazy_load():
    docs.append(doc)

# Asynchronous loading
import asyncio

asyncio.run(wrapped_loader.aload())

# Asynchronous lazy loading
docs = []
async for doc in wrapped_loader.alazy_load():
    docs.append(doc)

All loaded documents will be automatically sent to the Eunomia server which will assign an identifier to each document and store their metadata. The identifiers and metadata can then be used to configure policies in the Eunomia server.

Documentation

For detailed usage, check out the SDK's documentation.

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

eunomia_sdk_langchain-0.2.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

eunomia_sdk_langchain-0.2.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file eunomia_sdk_langchain-0.2.2.tar.gz.

File metadata

File hashes

Hashes for eunomia_sdk_langchain-0.2.2.tar.gz
Algorithm Hash digest
SHA256 4c693f17965c17bfeb954101c1f147e3e4b4687019dcdd2e591c9be362216847
MD5 7eb1f6b3ecf1bcb730c225d5c9009f68
BLAKE2b-256 2642d97637a7a19703a1fc7909b0e5579d1751aeeb45fd89a0f95d08106af688

See more details on using hashes here.

File details

Details for the file eunomia_sdk_langchain-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for eunomia_sdk_langchain-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1302711aad76418664a6445f9eb37e8e3cf17f8c7953251c33d68364edf6eb3e
MD5 2216119e4f40e2767b1ae5774f872c1f
BLAKE2b-256 d4027e29d1eb1e3a64b75257325019cbc0de31065fb2e5f31b02303c11bde9e5

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