Skip to main content

Lightweight package for arbitrary data transformation and validation using AI models and first class python libraries like Pandas and Pydantic.

Project description

AI Alchemy

AI Alchemy is a Python library that provides a convenient way to interact with AI models, such as OpenAI's GPT-3.5 Turbo, and perform transformations on data.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Python installed on your machine. You can download Python here.

Installation

You can install AI Alchemy via pip:

pip install ai_alchemy

Usage

Here's a basic example of how to use AI Alchemy:

# Import necessary libraries
import os
import ai_alchemy
from ai_alchemy.ai import OpenAIWrapper
from pydantic import BaseModel

# Instantiate a wrapper for an AI model
openai = OpenAIWrapper(api_key=os.environ["OPENAI_API_KEY"], model="gpt-3.5-turbo")

# Define a Pydantic model
class User(BaseModel):
    name: str
    age: int

# Input data
data = "John Smith is 25 years old, five foot ten inches tall, and weighs 150 pounds."

# Use AI Alchemy to transform the data into a Pydantic model
model = ai_alchemy.cast.str_to_pydantic_model(data, openai, User)

# Now `model` is a `User` instance with `name` and `age` populated from `data`

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

ai_alchemy-0.1.12.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

ai_alchemy-0.1.12-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file ai_alchemy-0.1.12.tar.gz.

File metadata

  • Download URL: ai_alchemy-0.1.12.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/6.8.0-76060800daily20240311-generic

File hashes

Hashes for ai_alchemy-0.1.12.tar.gz
Algorithm Hash digest
SHA256 f79214cfa93a912da8ef2ad3325d7ec5ea0d0eef42ba0e41a85240f83ca5a1e0
MD5 eccb55f3b26fd3d074931392387f7b5e
BLAKE2b-256 f9fe88987eb4c866b0bb3822a9e57af8cac4686280355287007a6a8ff39b5c77

See more details on using hashes here.

File details

Details for the file ai_alchemy-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: ai_alchemy-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/6.8.0-76060800daily20240311-generic

File hashes

Hashes for ai_alchemy-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 8c590a3b4db5e2d4dec366c4f55f272f4c4bcd3f75471aa8a98f382402ae168b
MD5 5fa7de1207d1c8c58933b0114aaef4f2
BLAKE2b-256 0144cd161fa8eb8d229de22b83c866888771a4c84e8c2ee98b780d3a0e6e6d17

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page