Migration¶
Migrating to ASHA from other tools or older ASHA versions.
From ASHA 0.3.x → 0.4.2¶
See the dedicated guide: migration-v0.4.md
Key changes:
ProcessResultdataclass (not dict/string)- Root imports frozen to four symbols
wrap_llm→asha.integrations- Kwargs →
mode+PolicyConfig Pipeline/Processorremoved
From Presidio / regex / spaCy¶
Replace ad-hoc PII scrubbing with:
from asha import sanitize, process
safe = sanitize(user_input).output
# or full path:
result = process(user_input, mode="strict")
ASHA adds injection checks and token optimization in process().
From manual prompt engineering¶
from asha import process
optimized = process(verbose_user_message).output
Use mode="strict" when failure must block, not degrade.
From wrapping SDKs manually¶
# Before: preprocess then call
safe = process(user_msg).output
client.chat.completions.create(..., messages=[{"role":"user","content": safe}])
# After
from asha.integrations import wrap_llm
client = wrap_llm(client, mode="balanced")
client.chat.completions.create(...) # automatic preprocessing
Version pinning¶
asha==0.4.2
Review CHANGELOG.md on GitHub before upgrading across 0.x minors.