Skip to main content

AMPLIFAI

Overview

This package allows to extract information from unstructured data and turns this extracted information into structured data.

Features

  • Creates LLM powered extraction and structuration logic
  • Define your data structure using Pydantic models
  • Use any supported LLM provider
  • Extract structured data from unstructured text with a single method call
  • Type-safe results with Pydantic validation

Requirements

Requires python > 3.10 and relies on langchain and pydantic See the requirements file for more details

Installation

You can install the package via pip by running the following command:

pip install amplifai

Alternatively, you can use any of the numerous python package managers such as poetry and uv.

Usage

Here's a simple example of how to use AMPLIFAI to extract structured information from text:

from pydantic import BaseModel
from langchain_openai import ChatOpenAI
from amplifai import Amplifier

# Define your data model
class Person(BaseModel):
    name: str
    age: int
    phone_number: str | None = None
    email_adress: str | None = None

# Initialize the LLM and Amplifier
llm = ChatOpenAI(api_key="your-api-key", model="gpt-4")
amplifier = Amplifier[ChatOpenAI, Person](llm=llm)

# Extract structured data from text
text = "John Doe is 25 years old. He lives in Paris and can be reached at +33 6 12 34 56 78 or at firstname.name@gmail.com"
person = amplifier.denoise(text=text)

# Access the structured data
print(f"Name: {person.name}")
print(f"Age: {person.age}")
print(f"Phone: {person.phone_number}")
print(f"Email: {person.email_adress}")

The package also supports other LLM providers like MistralAI:

from langchain_mistralai import ChatMistralAI

llm = ChatMistralAI(api_key="your-api-key", model="mistral-large-latest")
amplifier = Amplifier[ChatMistralAI, Person](llm=llm)

In fact, you can use any LLM provider that is supported by langchain. However, you will need to first install the corresponding langchain integration.

Assuming you use pip:

pip install langchain-<provider>

Contributing

We love contributions from the community! There are many ways you can help make AMPLIFAI better:

Ways to Contribute

  • 🐛 Report Bugs: Found a bug? Please create an issue with detailed steps to reproduce it
  • 💡 Feature Requests: Have an idea for a new feature? Open an issue and let's discuss it
  • 📝 Improve Documentation: Help us make the documentation clearer and more comprehensive
  • 🔧 Code Contributions: Submit pull requests for bug fixes or new features
  • 🌟 Spread the Word: Star the repository and share it with your network

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

By contributing, you agree that your contributions will be licensed under the project's MIT License.

Let's build something amazing together! 🚀

Metadata

Release files for amplifai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amplifai 0.1.0
File Size Uploaded
amplifai-0.1.0.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amplifai 0.1.0
File Interpreter ABI Platform
amplifai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 16.0 kB

Release files / amplifai-0.1.0.tar.gz

Download URL amplifai-0.1.0.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4a25556ee27832406667bf3f6052038707180ab7278d700e057b0767ae5ea61c
BLAKE2b-256 checksum
How to use checksums
a5d29affc161e558fd19ec9fcb2d358ff31854c08475434d6ad7a7420926d74f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release files / amplifai-0.1.0-py3-none-any.whl

Download URL amplifai-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ce0d047939fc06896d3c4da159fe9a7c5f3ea620ffb82fec025f28de8b85d5b
BLAKE2b-256 checksum
How to use checksums
a846273f6726541e76e51bd70792c3980fdd2143b4d97d5efa5e56a78824a9d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.16

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page