dartantic_interface 3.0.0
dartantic_interface: ^3.0.0 copied to clipboard
Interface definitions for dartantic_ai for use in building custom providers.
3.0.0 #
Streaming Thinking via ChatResult.thinking #
Added optional thinking field to ChatResult for streaming thinking content.
During streaming, thinking deltas are delivered via chunk.thinking for real-time
display, while the consolidated ThinkingPart appears in final messages for history.
Breaking Change: Migrated to genai_primitives Types #
Core message and part types are now provided by the genai_primitives package
and re-exported from dartantic_interface. This provides better
interoperability with other GenAI tooling in the Dart ecosystem.
Types re-exported from genai_primitives:
ChatMessage,ChatMessageRoleStandardPart,TextPart,DataPart,LinkPart,ThinkingPartToolPart,ToolPartKindToolDefinition
Part Type Alias (genai_primitives 0.2.0 compatibility) #
In genai_primitives 0.2.0, the Part type hierarchy was reorganized:
Partbecame the extendable base classStandardPartis the sealed class containing built-in part types
Dartantic provides Part as a typedef alias for StandardPart, so existing
code continues to work unchanged. If you need to create a custom Part that
extends the base class, import genai_primitives directly:
import 'package:genai_primitives/genai_primitives.dart' as gaip;
class MyCustomPart extends gaip.Part { ... }
Breaking Change: Migrated to json_schema_builder for Schemas #
The Schema type is now provided by the json_schema_builder package. Use the
S builder class for constructing schemas:
import 'package:dartantic_interface/dartantic_interface.dart';
// Build schemas with S.*
final schema = S.object(properties: {
'name': S.string(description: 'User name'),
'age': S.integer(minimum: 0),
});
New: ThinkingPart for Extended Reasoning #
Added ThinkingPart to represent extended thinking/reasoning content from LLMs.
This provides a unified representation across providers that support thinking
(OpenAI Responses, Anthropic, Google).
New Convenience Extensions #
Added MessagePartHelpers extension on Iterable<Part>:
thinkingParts- extracts allThinkingPartinstancesthinkingText- concatenates all thinking text
2.0.0 #
- BREAKING: Removed
ProviderCapsenum from the interface. Provider capabilities were only meaningful for testing default models and provided no provider-wide guarantees. Capability filtering for tests is now handled viaProviderTestCapsindartantic_ai's test infrastructure. Consider theProvider.listModelsmethod for run-time model details, e.g. chat, embedding, media, etc. - Removed
capsfield fromProviderbase class.
1.3.0 #
- introduced media generation primitives (
MediaGenerationModel,MediaGenerationResult,MediaGenerationModelResult, andMediaGenerationModelOptions) - extended
Providerwith media factory support and addedProviderCaps.mediaGeneration - added
ModelKind.mediafor provider defaults and discovery
1.2.0 #
- added optional 'thinking' field to ChatResult for enhanced reasoning output
- updated Provider to support thinking feature toggle
1.1.0 #
- ProviderCaps.vision => ProviderCaps.chatVision to tighten the meaning
1.0.5 #
- made usage nullable for when there is no usage.
1.0.4 #
- added
ProviderCaps.thinking
1.0.3 #
- remove custom lint dependency
1.0.2 #
- fixed a compilation error on the web
1.0.1 #
- downgrading meta for wider compatibility
1.0.0 #
- initial release