Catalog PyPI
Back to packageRELEASE DETAILS

1.0.1

PyPI

ai-alchemy

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

Published3 Jun 2024
Direct dependencies4
Transitive dependenciesNot calculated

README

Version 1.0.1 documentation

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`

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 4

Native requirements
4 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
requests
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
requests<3.0.0,>=2.31.0runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
pydantic<3.0.0,>=2.7.1runtime
openai
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
openai<2.0.0,>=1.30.1runtime
pandas-stubs
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": "<4.0,>=3.10",
  "evaluation": "NOT_EVALUATED"
}
pandas-stubs<3.0.0.0,>=2.2.2.240514runtime

Distribution files

2 collected
ai_alchemy-1.0.1-py3-none-any.whl

bdist_wheel · 5.38 KB · Python py3

Source file
ai_alchemy-1.0.1.tar.gz

sdist · 4.91 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:55 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:dcfac63db014e078a5229a7105e021dafb3bb55dcfaa689fd72728f65a2c9bb7

Other collected versions

View all collected versions →