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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ai_alchemy-0.1.10.tar.gz
.
File metadata
- Download URL: ai_alchemy-0.1.10.tar.gz
- Upload date:
- Size: 3.4 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81e5a056981342ea0f3b9d139c731d5850f5da447321b0994077b2a577b00690 |
|
MD5 | ca66be2af148ac744a41df931b29160a |
|
BLAKE2b-256 | e4288301d48c28651c33a53b6b56b746cdaf78a4ee9b203fe84f66b89f79cb5d |
File details
Details for the file ai_alchemy-0.1.10-py3-none-any.whl
.
File metadata
- Download URL: ai_alchemy-0.1.10-py3-none-any.whl
- Upload date:
- Size: 3.7 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3a0112a01c040d88796ceddc5cc0cec1355ca4aaf65ff8447e6d61f6170fdd1 |
|
MD5 | 7d244f5cf9a7f2b39c7d37e79e2fca29 |
|
BLAKE2b-256 | c58829d35ba7e7208122eac4b991168566b34c976c875c65d28c5e8d3192f554 |