Metadata-Version: 2.4
Name: candy-ai
Version: 21.0.0b1
Summary: candy-ai v21 BETA — AutoMemory, Compare, StreamFile, Logs, ImageGen Animate/StyleTransfer.
License-Expression: MIT
Project-URL: Homepage, https://client.hubworld.net
Keywords: ai,candy,cedric8-thinking,llm,chatbot,api,cli,nlp
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0

# 🍬 candy-ai v21 BETA

> ⚠️ **Version bêta** — Moteur **Cedric8-Thinking**

```bash
pip install candy-ai==21.0.0b1
```

---

## 🆕 Nouveautés v21

### 🧠 AutoMemory — Mémoire inter-sessions
```python
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
```python
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
```python
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
```python
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
```python
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
```bash
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
