Skip to main content

candy-ai v21 — AutoMemory, Compare, StreamFile, Logs, ImageGen Animate/StyleTransfer.

Project description

🍬 candy-ai v21

Framework IA Python professionnel — Cedric8-Thinking Engine

pip install candy-ai

🆕 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 session, candy s'en souvient automatiquement
chat2 = Coding.chat()

print(AutoMemory.summary())
AutoMemory.remember("Mon stack : React + FastAPI + PostgreSQL")
AutoMemory.forget()    # tout effacer
AutoMemory.disable()

🔀 Compare — Même prompt, 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é
print(result["coding"])
name, resp = result.best()  # la plus longue
md = result.to_markdown()

# Async — toutes en parallèle
import asyncio
result = asyncio.run(Compare(Coding, Security).ask_async("..."))

📝 stream_to_file — Génération longue sans saturer la RAM

from candy import Writing, Coding

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

Coding.ask("Write a sort")         # loggué automatiquement

CandyLogger.tail(n=10)
print(CandyLogger.stats())
# → {"total_calls": 42, "avg_latency_ms": 312, "top_personality": "coding"}
logs = CandyLogger.read(last_n=50, personality="coding")
CandyLogger.clear()

🎨 ImageGen — Animate, StyleTransfer, CompareStyles

from candy import ImageGen

ImageGen.animate("un chat qui saute sur la lune", frames=8, save="anim.gif")

ImageGen.style_transfer(
    "mon_portrait.jpg",
    "van_gogh.jpg",
    strength=0.8,
    save="portrait_van_gogh.png"
)

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
candy logs --stats      # statistiques
candy logs --clear      # vider

Fonctionnalités v20 (toutes conservées)

Async, Mix, Chain, Retry, Cache offline, Conversation+ (titre, compression, export MD), ImageGen Edit/Upscale, CLI doctor/update.


Quick Start

from candy import Coding
print(Coding.ask("Write a binary search in Python"))

Streaming

for token in Writing.stream("Raconte une histoire"):
    print(token, end="", flush=True)

120 personnalités disponibles

Math, Coding, Writing, Medicine, Law, Finance, Security, Design, Psychology, Education, Research, Business, Cooking, Travel, Music, Film, Philosophy, Engineering, Crypto, AI, DevOps, Screenwriting, Comics, Animation, DataScience, Neuroscience, Trading, MentalHealth, Fitness, Sustainability... et 90 autres.


Powered by Cedric8-Thinking · MIT License

Project details


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.0.tar.gz (67.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

candy_ai-21.0.0-py3-none-any.whl (99.6 kB view details)

Uploaded Python 3

File details

Details for the file candy_ai-21.0.0.tar.gz.

File metadata

  • Download URL: candy_ai-21.0.0.tar.gz
  • Upload date:
  • Size: 67.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for candy_ai-21.0.0.tar.gz
Algorithm Hash digest
SHA256 219e2dca99d82f949a98c957cf5b5878886ac734575beafbab9469703be73d18
MD5 4363fafe61a4f532f4b9966f1648ab83
BLAKE2b-256 caae961d9e1b703313eea3a2eb03e78a86d86c1b4658c571fa063f6db8e5cf89

See more details on using hashes here.

File details

Details for the file candy_ai-21.0.0-py3-none-any.whl.

File metadata

  • Download URL: candy_ai-21.0.0-py3-none-any.whl
  • Upload date:
  • Size: 99.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for candy_ai-21.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ea59de7b57f64ff1e209b63d967592ed857d7ba3c581a6ecfc66386339f0e82
MD5 102c2c0db502ed1bd973d22d54ae2b7a
BLAKE2b-256 59dea945c3248dd793cd5c2334792453f0371f13b89b7966e455b79aceb0bb88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page