Prerequisites

Technical requirements;

  • Python >= 3.9

How to Install

pip install filtro

Basic Usage

Basic and modular usage, integrated with Langchain

from filtro import mask, clear

masked, mapping = mask(
    "Hi my name is Giovanni, I work at Google. What's up?"
) # Hi my name is Maria, I work at Marvel. What's up?

from langchain.llms import OpenAI
llm = OpenAI(temperature=0.9)
response = llm(masked) # Hi Maria! Im fine. Yourself?

cleared = clear(response, mapping) # Hi Giovanni! Im fine. Yourself?

OpenAI API

Our repository includes open-source adapters for OpenAI endpoints, enabling you to switch to our endpoints in your existing codebase without any modifications. This ensures compatibility with function signatures, allowing for a seamless transition with no code changes required.

Examples

Explore more examples