Pont Python vers Cedric7-Thinking — 50 personnalités, 20 utilitaires (translate, summarize, sentiment, codegen...), Helper, CLI, profils, conversations, batch, streaming.
Project description
🍬 candy-ai v12
Pont Python vers Cedric7-Thinking — pas une IA, le logiciel qui fait le lien.
50 personnalités · 20 utilitaires · Helper · CLI · Profils · Conversations · Batch · Streaming
Installation
pip install candy-ai
Démarrage immédiat
from candy import Coding
print(Coding.ask("Write a quicksort in Python"))
🆕 v12 — 20 nouveaux utilitaires
from candy import (
translate, summarize, spellcheck, keywords, sentiment,
generate_title, ask_about, rephrase, generate_faq, compare,
codegen, explain_code, mock_data, timed_ask, cached_ask,
clear_cache, optimize_prompt, extract, pipeline, full_report,
detect_lang
)
Traduction & Langue
# Détecter la langue
from candy import detect_lang
print(detect_lang("Bonjour tout le monde")) # → FR
# Traduire
from candy import translate
print(translate("Hello world", to="FR")) # → Bonjour le monde
print(translate("Hola", to="EN")) # → Hello
Analyse de texte
from candy import summarize, sentiment, keywords, full_report
# Résumé en N mots
print(summarize(long_text, words=30, lang="FR"))
# Sentiment
s = sentiment("Ce produit est fantastique !")
print(s["label"]) # → positive
print(s["score"]) # → 0.95
# Mots-clés
kws = keywords("Article sur le machine learning", n=5)
# → ["machine learning", "réseaux neuronaux", ...]
# Rapport complet
report = full_report(my_article, lang="FR")
print(report["summary"])
print(report["sentiment"])
print(report["keywords"])
print(report["titles"])
Génération de contenu
from candy import generate_title, rephrase, spellcheck, generate_faq
# Titres accrocheurs
titles = generate_title(article, lang="FR", n=5)
# Reformulation
print(rephrase("C'est trop bien", style="formal", lang="FR"))
# Correction orthographique
print(spellcheck("Bonjour je mappelle Jean", lang="FR"))
# FAQ automatique
faq = generate_faq(product_description, n=5, lang="FR")
for item in faq:
print(f"Q: {item['question']}")
print(f"A: {item['answer']}")
Code
from candy import codegen, explain_code
# Génération de code
code = codegen("fonction qui trie une liste par longueur", language="python")
print(code)
# Explication de code
print(explain_code("def fib(n): return n if n<=1 else fib(n-1)+fib(n-2)", lang="FR"))
Utilitaires avancés
from candy import timed_ask, cached_ask, clear_cache, optimize_prompt
# Mesurer le temps de réponse
result = timed_ask("coding", "What is a decorator?")
print(f"Réponse en {result['time_ms']}ms — {result['words']} mots")
# Cache de réponses (évite les doublons, TTL 1h)
r1 = cached_ask("math", "C'est quoi pi ?") # → API
r2 = cached_ask("math", "C'est quoi pi ?") # → cache instantané
clear_cache() # vider le cache
# Optimiser un prompt
better = optimize_prompt("explique les décorateurs", personality="coding")
print(better)
Extraction & Pipeline
from candy import extract, pipeline, compare, ask_about, mock_data
# Extraire des données structurées d'un texte
data = extract(email_text, ["sender_name", "subject", "date", "action_required"])
print(data["sender_name"])
# Pipeline de transformations
result = pipeline(
"Mon texte brut...",
steps=[
("summarizer", "Résume en 2 phrases"),
("writing", "Rends le plus engageant"),
("reviewer", "Vérifie la grammaire"),
],
lang="FR"
)
print(result["final"])
# Comparer deux textes
diff = compare(version1, version2)
print(diff["similarities"])
print(diff["differences"])
# Q&A sur un texte
answer = ask_about(article, "Quelle est la conclusion ?", lang="FR")
# Générer des données de test
users = mock_data("user with name, email, age, city", n=5)
Profils
from candy import cfg, Coding
cfg.A.lang = "FR"
cfg.A.max_tokens = 2000
cfg.A.style = "detailed"
cfg.A = cfg.preset("french_beginner") # preset rapide
cfg.default.lang = "FR"
print(Coding.ask("Hello"))
print(Coding.use("A").ask("Explique les listes"))
Presets : french_beginner french_expert english_beginner english_expert
quick academic creative teacher coder journalist storyteller analyst coach debug
Tous les paramètres
| Paramètre | Défaut | Valeurs |
|---|---|---|
lang |
"EN" |
FR EN ES DE IT PT ZH JA AR RU NL PL SV TR KO HI VI ID CS RO |
max_tokens |
800 |
100 → 4096 |
temperature |
0.7 |
0.0 → 1.5 |
style |
"default" |
default concise detailed bullet academic casual technical eli5 |
tone |
"neutral" |
neutral encouraging strict humorous empathetic socratic |
output_format |
"text" |
text markdown json html |
expertise |
"intermediate" |
beginner intermediate expert |
retry |
1 |
tentatives en cas d'échec |
verbose |
False |
affiche les infos de requête |
CLI
candy helper # ouvre la fenêtre Helper
candy -- script.cdy # exécute un fichier .cdy
Les 50 personnalités
Math Coding Reflexion Analytic Full Science Writing History
Law Medicine Finance Marketing Security Design Language
Psychology Education Research Business Productivity Cooking
Travel Music Film Sports Philosophy Environment Architecture
Automotive Astronomy Biology Chemistry Physics Engineering
Entrepreneur Ethics Geopolitics Crypto AI DevOps Database
GameDev Comic Storyteller Translator Summarizer Debugger
Reviewer Planner Tutor
Propulsé par Cedric7-Thinking · Quota 800 req/jour · MIT License
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
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-12.0.0.tar.gz.
File metadata
- Download URL: candy_ai-12.0.0.tar.gz
- Upload date:
- Size: 33.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80de3e33d5bd673235442ced4b6f00abf58846ab9b0d6209984f7e0c3d16a165
|
|
| MD5 |
e566ace5a2b034e6227239cb9665313f
|
|
| BLAKE2b-256 |
1b7d320be9c4fa3682868f5b66a951c8205d56c9450f103e6e04b3bda3b57fab
|
File details
Details for the file candy_ai-12.0.0-py3-none-any.whl.
File metadata
- Download URL: candy_ai-12.0.0-py3-none-any.whl
- Upload date:
- Size: 44.6 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 |
b1116ad9a7a06a27321a2dba8abc25dcd07e3a7c1168438ffaf6302ecfa80244
|
|
| MD5 |
fd31191293d2312ee94272f60c6fac18
|
|
| BLAKE2b-256 |
3683ceec35573f9a8043280efcd065fa54e2e93179c003724d58e1d62b4fd14a
|