candy-ai v21 BETA — AutoMemory, Compare, StreamFile, Logs, ImageGen Animate/StyleTransfer.
Project description
🍬 candy-ai v21 BETA
⚠️ Version bêta — Moteur Cedric8-Thinking
pip install candy-ai==21.0.0b1
🆕 Nouveautés v21
🧠 AutoMemory — Mémoire inter-sessions
from candy import AutoMemory, Coding
AutoMemory.enable()
chat = Coding.chat()
chat.say("Je préfère toujours des réponses en français")
chat.say("Je travaille sur un projet FastAPI avec Python 3.12")
# La prochaine fois, candy s'en souvient automatiquement
chat2 = Coding.chat()
# → répond déjà en FR, avec le contexte FastAPI/Python
print(AutoMemory.summary())
AutoMemory.remember("Mon stack : React + FastAPI + PostgreSQL")
AutoMemory.forget() # tout effacer
🔀 Compare — Comparer plusieurs personnalités
from candy import Compare, Coding, Security, Reviewer
result = Compare(Coding, Security, Reviewer).ask("Comment sécuriser une API REST ?")
result.show() # affichage formaté dans le terminal
print(result["coding"]) # réponse de Coding
print(result["security"]) # réponse de Security
name, resp = result.best() # la réponse la plus longue
md = result.to_markdown() # export Markdown
# Async — toutes en parallèle
import asyncio
result = asyncio.run(Compare(Coding, Security).ask_async("..."))
📝 stream_to_file — Streaming vers fichier
from candy import Writing, Coding
# Génère un roman sans saturer la mémoire
Writing.stream_to_file(
"roman.txt",
"Écris un roman de science-fiction de 5000 mots",
show_progress=True
)
# → [candy] ✓ 24,831 chars → roman.txt (18.3s)
Coding.stream_to_file("api.py", "Génère une API REST complète avec FastAPI")
Writing.stream_to_file("journal.txt", "Entrée du jour...", append=True)
📋 CandyLogger — Logs structurés JSON
from candy import CandyLogger, Coding
CandyLogger.enable() # ~/.candy/logs/candy.jsonl
CandyLogger.enable("mes_logs.jsonl")
Coding.ask("Write a sort") # loggue automatiquement
Coding.ask("Explain recursion")
CandyLogger.tail(n=10) # affiche les 10 derniers appels
print(CandyLogger.stats()) # stats complètes
logs = CandyLogger.read(last_n=50, personality="coding")
CandyLogger.clear()
🎨 ImageGen — Animate, StyleTransfer, CompareStyles
from candy import ImageGen
# Animation GIF
ImageGen.animate("un chat qui saute sur la lune", frames=8, save="anim.gif")
# Style transfer — applique le style d'une image sur une autre
ImageGen.style_transfer(
"mon_portrait.jpg",
"van_gogh.jpg",
strength=0.8,
save="portrait_van_gogh.png"
)
# Génère la même image dans tous les styles
ImageGen.compare_styles("un château médiéval", save_dir="./styles/")
# → styles/default.png, styles/anime.png, styles/painting.png ...
🖥️ CLI — candy logs
candy logs # 10 derniers appels
candy logs --n 50 # 50 derniers appels
candy logs --stats # statistiques complètes
candy logs --clear # vider les logs
Toutes les fonctionnalités v20 conservées
Async, Mix, Chain, Retry, Cache, Conversation+, ImageGen Edit/Upscale, CLI doctor/update — tout est intact.
Powered by Cedric8-Thinking · MIT
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
candy_ai-21.0.0b1.tar.gz
(67.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file candy_ai-21.0.0b1.tar.gz.
File metadata
- Download URL: candy_ai-21.0.0b1.tar.gz
- Upload date:
- Size: 67.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63d0aaff14e5faefa76bc9d0881c9f19129c29ed322c04810e0b8eaecbfea0fc
|
|
| MD5 |
8df2844eb28efdd5eb5984a3d2ce7d0d
|
|
| BLAKE2b-256 |
b77a76bc36624de3607b806c3aebcf3e308df095d02d937d33e5af168fd35602
|
File details
Details for the file candy_ai-21.0.0b1-py3-none-any.whl.
File metadata
- Download URL: candy_ai-21.0.0b1-py3-none-any.whl
- Upload date:
- Size: 99.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a36020a890ee369a01e7b669915fe7df795f82bb0e415b00bf6d3e8e6fa1aab
|
|
| MD5 |
c1ad0f01116d8bcbdc2bb500078b4349
|
|
| BLAKE2b-256 |
9b40bf8fa3cd3e9aa1c11e8579302c630cc17fed405ed794ae257a7077be74d0
|