Skip to main content

candy-ai v20 — 120 personnalités, ImageGen, Smart, Monitor, Multi-agents, CLI avancé.

Project description

🍬 candy-ai v20 BETA

⚠️ Version bêta — Moteur Cedric8-Thinking

Framework IA Python professionnel

pip install candy-ai==20.0.0b1

Quick Start

from candy import Coding

response = Coding.ask("Write a binary search in Python")
print(response)

🆕 Nouveautés v20

⚡ Async natif

import asyncio
from candy import Coding

# ask async
result = asyncio.run(Coding.ask_async("Write a bubble sort"))

# streaming async
async def main():
    async for token in Coding.stream_async("Explain recursion"):
        print(token, end="", flush=True)

asyncio.run(main())

# batch async — toutes les requêtes en parallèle
results = asyncio.run(Coding.batch_async(["sort", "reverse", "binary search"]))

🔀 Mix — Fusion de personnalités

from candy import Mix, Coding, Security, Reviewer

# Une seule requête avec l'expertise combinée
result = Mix(Coding, Security).ask("Écris un serveur HTTP sécurisé en Python")
print(result)

# Avec profil personnalisé
result = Mix(Coding, Security).use("A").ask("...")

# Async
result = asyncio.run(Mix(Coding, Security).ask_async("..."))

⛓️ Chain — Pipeline séquentiel

from candy import Chain, Coding, Reviewer, Debugger

# Chaque étape reçoit le résultat de la précédente
result = Chain([Coding, Reviewer, Debugger]).run("Écris une API REST")
print(result["final"])
print(result["steps"])   # résultats intermédiaires

# Async
result = asyncio.run(Chain([Coding, Reviewer]).run_async("..."))

🔁 Retry automatique + Cache offline

from candy import Coding

# Retry auto avec backoff exponentiel (1.5s → 3s → 6s)
# configuré via profil (max_retries)

# Cache : si l'API est down, répond depuis le cache
result = Coding.ask("Explain decorators", use_cache=True)

💬 Conversation améliorée

from candy import Conversation, Coding

chat = Conversation(Coding, profile="A", auto_compress=True)
print(chat.say("Explique les décorateurs Python"))
print(chat.say("Donne un exemple avec une classe"))

print(chat.title)               # titre auto-généré
chat.show_history()
chat.export_md("conversation.md")           # export Markdown
chat.save("chat.json")
chat.save("chat.json", append=True)         # fusion sans écraser
chat.load("chat.json")

🎨 ImageGen amélioré

from candy import ImageGen

# Édition / inpainting (v20)
ImageGen.edit(
    "photo.jpg",
    mask="mask.png",
    prompt="remplace le fond par un coucher de soleil",
    save="edited.png"
)

# Upscale x2 ou x4 (v20)
ImageGen.upscale("small.png", scale=4, save="big.png")

# Création standard
ImageGen.create("un chat astronaute", style="photorealistic", save="chat.png")
ImageGen.variation("original.png", strength=0.6, save="variation.png")
desc = ImageGen.describe("photo.jpg", lang="FR")
images = ImageGen.batch(["forêt", "ville", "portrait"], save_dir="./output/")

🩺 CLI amélioré

candy --doctor    # diagnostic complet : connexion, quota, cache
candy --update    # met à jour candy-ai automatiquement
candy --status    # statut API
candy --ask "mon prompt" --stream
candy --score "mon prompt"
candy --fix "mon prompt"
candy --version

Streaming

from candy import Writing

for token in Writing.stream("Write a short story about a lighthouse keeper"):
    print(token, end="", flush=True)

Context support

from candy import Analytic

data = """
Month,Revenue
Jan,12000
Feb,15400
"""
response = Analytic.ask("What trend do you see?", context=data)

Check your quota

from candy import Math
print(Math.quota())
# {'ip': '...', 'quota_used_today': 12, 'quota_limit': 500, 'quota_remaining': 488}

Available personalities (120)

50 originales + 40 v13 + 30 v17 = 120 personnalités. Voir la liste complète sur client.hubworld.net.


Powered by Cedric8-Thinking

candy connecte au moteur Cedric8-Thinking. Usage soumis à un quota journalier (500 requêtes/jour par défaut).


License

MIT

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-20.0.0.tar.gz (61.0 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-20.0.0-py3-none-any.whl (90.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for candy_ai-20.0.0.tar.gz
Algorithm Hash digest
SHA256 cd0bf5b545605def40761540ccbdf23838c945907ed764b07bc6daf8c35fc921
MD5 8e491e7454ee88dc38cf6518f5611e3a
BLAKE2b-256 5da95d8965349b997348c9e653067f1e5ffcd2fb8304a6de173f99d72fb4e407

See more details on using hashes here.

File details

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

File metadata

  • Download URL: candy_ai-20.0.0-py3-none-any.whl
  • Upload date:
  • Size: 90.4 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-20.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4bc528be22ebd9de48da8fc7e447773999e98fe7b9037fcef6184a4cb521c23
MD5 03126211793c16e4109f70616d0d2020
BLAKE2b-256 8b19d6bb72a6aae247cc86f42bfa6fdca8c2ec0fe8e1f871b16e4d8176a46e01

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