Build AI Apps Fast
Project description
CyberChipped
Introduction
CyberChipped enables building powerful AI apps fast by providing three core abstractions.
These abstractions are the OpenAI Assistant, AI Function, and AI Model.
The key selling point of this library is to build an OpenAI Assistant in two lines of code!
CyberChipped powers the most feature-rich AI Companion - CometHeart!
Install
pip install cyberchipped
Setup
Create a .env file in your project root with this key in it:
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
Abstractions
OpenAI Assistant
from cyberchipped.assistants import Assistant
with Assistant() as ai:
print(ai.say("Hello World!"))
# prints: "Hello there! How can I assist you today?"
AI Function
from cyberchipped import ai_fn
@ai_fn
def echo(text: str) -> str:
"""You return `text`."""
print(echo("Hello World!"))
# prints: "Hello World!"
AI Model
from cyberchipped import ai_model
from pydantic import BaseModel, Field
@ai_model
class Planet(BaseModel):
"""Planet Attributes"""
name: str = Field(..., description="The name of the planet.")
planet = Planet("Mars is a great place to visit!")
print(planet.name)
# prints: "Mars"
Database
CyberChipped requires a database to track and manage OpenAI Assistant threads across runs.
SQLite (default)
Will be saved in your local working directory (where you code is located) and be called cyberchipped.db
. Unless you use MongoDB.
MongoDB
Set the following env vars in your .env file:
MONGO_URL=YOUR_MONGO_URL
MONGO_DB=YOUR_DATABASE_NAME
MONGO_COLLECTION=YOUR_COLLECTION_NAME
Source
This is a hard fork of Marvin pre-release
Platform Support
Mac and Linux
Requirements
Python >= 3.11
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
Hashes for cyberchipped-0.6.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 887a7be17f46663eec9cf99d3431d9474b52e3c006d252dbacebc3e41b5f0cee |
|
MD5 | 60b01b6d449818617ee617adcb8b4821 |
|
BLAKE2b-256 | fc0f6400f8ab35002ca962a42aa2f82192dec280ce9dff1bba8b01e45b4155e2 |