Skip to content

V0.11.1

Choose a tag to compare

@JohnRichard4096 JohnRichard4096 released this 04 Jul 12:06
634b273

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 RequestMetadata class in both English and Chinese.
  • Updated UniResponse and UniResponseUsage pages to reflect new fields.

Removed Obsolete Content

  • Deleted the deprecated SuspendObjectStream API 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 with and 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 from amrita_sense for event system, streaming, and suspend/resume features.

Fixed Cross-References

  • Updated broken links in the API sidebar (SuspendObjectStreamRequestMetadata).

Code Improvements

Adapter Enhancements

  • OpenAIAdapter: Now populates RequestMetadata with model name, request ID, and stop reason. Also supports the stop parameter in call_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_id to 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 corresponding amrita_sense imports.
  • Deprecation: init() remains a no-op stub; all async initialisation should use load_amrita() or minimal_init().

Migration Steps

  1. Replace any from amrita_core.hook... with from amrita_sense.hook....
  2. Replace from amrita_core.streaming import SuspendObjectStream with from amrita_sense.streaming import SuspendObjectStream.
  3. For model adapters, import ModelAdapter from amrita_core.base.adapter, not from amrita_core.protocol.

Version

0.11.1 – patch release (no functional API changes, only documentation and metadata additions).

Pull Requests

Feedback

Please report any issues on our GitHub issue tracker. We welcome contributions and suggestions!

Full Changelog: 0.11.0...0.11.1