Skip to main content

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`

Release files for ai-alchemy 1.0.1

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

Source distribution (sdist)

Source distribution for ai-alchemy 1.0.1
File Size Uploaded
ai_alchemy-1.0.1.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ai-alchemy 1.0.1
File Interpreter ABI Platform
ai_alchemy-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / ai_alchemy-1.0.1.tar.gz

Download URL ai_alchemy-1.0.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4f5c103ff18b2084aa4c230ef207091b4f17be0e357c5f1ee847046c12fce469
BLAKE2b-256 checksum
How to use checksums
e19149505f1211289c4fc1b99530a1234bcebc79da984e5b322fedf9e18afd4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.6 Linux/6.8.0-76060800daily20240311-generic

Release files / ai_alchemy-1.0.1-py3-none-any.whl

Download URL ai_alchemy-1.0.1-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea2a3caf891a0397b29e8e90d5845cee251be7e9953a6ddaa9eb44400fabf720
BLAKE2b-256 checksum
How to use checksums
d37f9da518e99bdb1a19bae27b4e1b58c15575ee5353ee05b656d4b2c5529f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.6 Linux/6.8.0-76060800daily20240311-generic

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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