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.1.tar.gz (2.8 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.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for eunomia_sdk_langchain-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5f3da1d647fc1a9e605b351fc700231e06163242f07c049210ac5cef659c23ab
MD5 3c2e2d47d86b52adc99ab9acd8482613
BLAKE2b-256 2cb5ca465cd7992a9171ae89002d3a9327db4924c14f6304584ce85ce3a01b8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for eunomia_sdk_langchain-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c2d9c8aa769a1f133eb90cf02f22474f1d104d6e6b81ea9a61f10d8ad7d1632
MD5 1235a5c28c858417bb4be06a2160372c
BLAKE2b-256 455a6ae8edab1549a100b80c3b88409bbd08a7b77340bc5dbbcc1f264a0a6c3d

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