Build AI Apps Fast
Project description
CyberChipped
Intro
CyberChipped enables building powerful AI apps fast by providing four core abstractions.
These abstractions are the Assistant and 3 helpers: Function, Model, and Classifier.
Building an OpenAI Assistant with multiple tools and helpers is doable in minimal lines of code.
CyberChipped powers the most feature-rich AI Companion - CometHeart!
Install
pip install cyberchipped
Setup
import cyberchipped
cyberchipped.settings.openai.api_key = "YOUR_OPENAI_API_KEY"
Four Core Abstractions
Assistant
from cyberchipped.assistants import Assistant
from cyberchipped.assistants.threads import Thread
from cyberchipped.assistants.formatting import pprint_messages
with Assistant as ai:
thread = Thread()
thread.create()
thread.add("Hello World!")
thread.run(ai)
messages = thread.get_messages()
pprint_messages(messages)
# prints
# USER: Hello World!
# ASSISTANT: Yes! Good morning planet Earth!)
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"
AI Classifier
from cyberchipped import ai_classifier
from enum import Enum
@ai_classifier
class WhichGalaxy(Enum):
"""Picks the name of the galaxy a planet is located in."""
MILKY_WAY = "MILKY WAY"
ANDROMEDA = "ANDROMEDA"
PINWHEEL = "PINWHEEL"
OTHER = "OTHER"
NONE = "NONE"
WhichGalaxy("Earth")
# WhichGalaxy.MILKY_WAY
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
cyberchipped-0.1.6.tar.gz
(27.3 kB
view hashes)
Built Distribution
Close
Hashes for cyberchipped-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f2877d1d54e3f1ffd8bde04585289dfa27fd616b883c9b6f52a2bed28f8d5c4 |
|
MD5 | 505755ae73a538a6b364f2a67fd282d3 |
|
BLAKE2b-256 | ff937282c072db46a30d0ef148bfef3a21457090e878ce01c778f6d5bcbeca40 |