Repository navigation
V0.9.1
AmritaCore 0.9.1 Release Summary
This release introduces a major refactoring of the streaming and suspend/resume APIs, adds first-class support for model reasoning/thinking capabilities, enhances adapters with embeddings and extended thinking, and improves type safety with typed metadata classes.
Highlights
- ChatObject API Refactoring –
ChatObjectnow uses composition over inheritance for streaming functionality (io_streamattribute). All streaming and suspend/resume methods are deprecated forwarding wrappers and will be removed in v0.10.0. - Reasoning/Thinking Support – New
ThinkingConfigclass enables controlled reasoning for OpenAI o-series and Anthropic extended thinking. Reasoning content is exposed viareasoning_contentandreasoning_signaturefields. - Typed Metadata – New
amrita_core.builtins.typesmodule provides typed metadata classes for agent hooks and workflows, replacing plain dictionaries. - OpenAI Embeddings –
OpenAIAdapternow implementscall_embed()for vector retrieval workflows. - Anthropic Extended Thinking – Full support for Anthropic's thinking blocks, including delta streaming and signature round-tripping.
Breaking Changes & Deprecations
Deprecated Streaming Methods (v0.10.0 removal)
All streaming-related methods on ChatObject have been moved to chat.io_stream. The following methods are deprecated and emit warnings:
| Old method | New method |
|---|---|
get_response_generator() |
io_stream.get_response_generator() |
set_callback_func(func) |
io_stream.set_callback_func(func) |
set_callback_fun_sending(func) |
io_stream.set_callback_fun_sending(func) |
yield_response(response) |
io_stream.yield_response(response) |
yield_response_iteration(iterator) |
io_stream.yield_response_iteration(iterator) |
push_object(obj) |
io_stream.push_object(obj) |
queue_closed() |
io_stream.queue_closed() |
set_queue_done() |
io_stream.set_queue_done() |
wait_to_suspend(*tags, timeout) |
io_stream.wait_to_suspend(*tags, timeout) |
resume() |
io_stream.resume() |
Migration example:
# Old (0.9.0)
async for chunk in chat.get_response_generator():
print(chunk)
# New (0.9.1)
async for chunk in chat.io_stream.get_response_generator():
print(chunk)Constructor Parameter Changes
callbackparameter removed fromChatObject. Usechat.io_stream.set_callback_func()after creation.queue_sizeandqueue_timeoutparameters removed. Configure via customio_streamif needed.
Removed Dependency
anyiois no longer a direct dependency (now pulled viaamrita-sense).
New Features
Thinking/Reasoning Configuration
Added ThinkingConfig class to control model reasoning behavior:
from amrita_core.types import ThinkingConfig, ModelPreset
preset = ModelPreset(
model="claude-sonnet-4-20250514",
thinking_config=ThinkingConfig(
thinking_type="enabled",
thinking_effort="high",
content_mode="by-tool",
),
)Reasoning Content in Responses
UniResponse.reasoning_contentandUniResponse.reasoning_signatureMessage.reasoning_contentandMessage.reasoning_signature(only forrole="assistant")
Typed Built-in Metadata
New module amrita_core.builtins.types with typed metadata payloads:
AgentReasoningMetadata– Pre-resolve reasoning summariesAgentReasoningChunkMetadata– Streaming reasoning chunksAgentToolCallMetadata– Tool call notificationsAgentLoopErrorMetadata– Loop detection errorsAgentMiddleMessageMetadata– LLM middle messagesHookErrorMetadata– Hook-level error responses
OpenAI Embedding API
OpenAIAdapter.call_embed() enables text embedding for vector retrieval workflows.
Anthropic Extended Thinking
Full support for Anthropic's thinking feature:
- Processes
thinking_deltaandsignature_deltaevents during streaming - Handles thinking blocks in non-streaming responses
- Supports
thinkingparameter withbudget_tokens
Agent Workflow Enhancements
- Added
WHILEloop with counter factory for tool call iteration limits - New suspend tags:
SuspendEnum.ADVANCE_COUNTER,SuspendEnum.STRATEGY_EOF
Improvements
- Documentation: All API references updated to reflect
io_streamcomposition. AddedThinkingConfigdocumentation. Chinese translations synced. - ChatObject Workflow: Refactored into node-based composition with pre-rendered workflow for better performance.
- Message Validation:
Messagenow validates thatreasoning_contentonly appears on assistant messages. - Memory Limiter: Improved token counting with proper tokenizer type handling.
- Deprecation Warnings: Added clearer removal version indications (v0.10.0) to deprecated modules.
Bug Fixes
- Fixed Anthropic adapter test mocks to align with latest SDK event types.
- Corrected typo in deprecation message for
reinitalize_all(). - Fixed
queue_size/queue_timeoutnot being forwarded correctly in some edge cases.
Upgrade Notes
- Update
amrita-senseto >=0.3.0 (required). - Replace all
chat.get_response_generator()calls withchat.io_stream.get_response_generator(). - Replace
chat.set_callback_func()withchat.io_stream.set_callback_func(). - Remove
callback=,queue_size=,queue_timeout=fromChatObjectconstructor. - For suspend/resume, use
chat.io_stream.wait_to_suspend()andchat.io_stream.resume().
Dependency Updates
amrita-sense:>=0.2.1→>=0.3.0anyio: removed from direct dependenciesanthropic: updated to0.105.2openai: updated to2.41.0aiohttp: updated to3.14.0- Various other transitive updates (see
uv.lockfor full list)
What's Changed
- Add thinking config and refactor ChatObject streaming/workflow by @JohnRichard4096 in #67
Full Changelog: 0.9.0...0.9.1