V0.11.1
Release Summary – AmritaCore v0.11.1
Overview
AmritaCore v0.11.1 is a documentation and minor feature release that enhances request observability, updates API references, and clarifies migration paths for deprecated components. The framework continues to improve developer experience with better diagnostic data and cleaner documentation.
New Features
📊 Request Metadata in UniResponse
Every adapter call now returns detailed per-request diagnostic information through the new RequestMetadata class, accessible via UniResponse.metadata. This includes:
- Auto-generated
request_id(UUID4) - Provider’s original request ID (
original_request_id) - Model name
- Stop sequence and stop reason (e.g.,
"end_turn","max_tokens","tool_use","refusal") - Support for provider-specific extra fields via
extra="allow"
📈 Cache Statistics in UniResponseUsage
The UniResponseUsage class now includes cache_creation and cache_hit fields (primarily for Anthropic prompt caching), enabling better cost tracking and performance monitoring.
Documentation Updates
New API Documentation
- Added full reference for
RequestMetadataclass in both English and Chinese. - Updated
UniResponseandUniResponseUsagepages to reflect new fields.
Removed Obsolete Content
- Deleted the deprecated
SuspendObjectStreamAPI page – this functionality is now fully hosted in the AmritaSense package. Users are directed to the official AmritaSense documentation.
Code Examples Modernised
- Replaced outdated chat object examples with the recommended
async withand streaming pattern (chat.io_stream.get_response_generator()).
Clarified Import Paths
- Explicitly noted that the old compatibility endpoints (
amrita_core.protocol,amrita_core.hook.*,amrita_core.streaming) were removed in v0.10.x+. Users must import directly fromamrita_sensefor event system, streaming, and suspend/resume features.
Fixed Cross-References
- Updated broken links in the API sidebar (
SuspendObjectStream→RequestMetadata).
Code Improvements
Adapter Enhancements
- OpenAIAdapter: Now populates
RequestMetadatawith model name, request ID, and stop reason. Also supports thestopparameter incall_api. - AnthropicAdapter: Fills metadata with stop sequence, reason, and original request ID; adds cache creation/hit tokens to usage.
Utility Update
model_dump()now accepts any iterable, improving robustness when preparing messages for API calls.
Testing
- Added
_request_idto mock completions in test suite to ensure metadata coverage.
Upgrade Notes
Breaking Changes (from v0.10.x)
- Import paths: The deprecated shims (
amrita_core.hook.*,amrita_core.streaming,amrita_core.protocol) are no longer available. If you were using them, switch to the correspondingamrita_senseimports. - Deprecation:
init()remains a no-op stub; all async initialisation should useload_amrita()orminimal_init().
Migration Steps
- Replace any
from amrita_core.hook...withfrom amrita_sense.hook.... - Replace
from amrita_core.streaming import SuspendObjectStreamwithfrom amrita_sense.streaming import SuspendObjectStream. - For model adapters, import
ModelAdapterfromamrita_core.base.adapter, not fromamrita_core.protocol.
Version
0.11.1 – patch release (no functional API changes, only documentation and metadata additions).
Pull Requests
- Add request metadata and cache-aware usage to UniResponse by @JohnRichard4096 in #111
Feedback
Please report any issues on our GitHub issue tracker. We welcome contributions and suggestions!
Full Changelog: 0.11.0...0.11.1