dartantic_interface 3.0.0 copy "dartantic_interface: ^3.0.0" to clipboard
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, ChatMessageRole
  • StandardPart, TextPart, DataPart, LinkPart, ThinkingPart
  • ToolPart, ToolPartKind
  • ToolDefinition

Part Type Alias (genai_primitives 0.2.0 compatibility) #

In genai_primitives 0.2.0, the Part type hierarchy was reorganized:

  • Part became the extendable base class
  • StandardPart is 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 all ThinkingPart instances
  • thinkingText - concatenates all thinking text

2.0.0 #

  • BREAKING: Removed ProviderCaps enum 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 via ProviderTestCaps in dartantic_ai's test infrastructure. Consider the Provider.listModels method for run-time model details, e.g. chat, embedding, media, etc.
  • Removed caps field from Provider base class.

1.3.0 #

  • introduced media generation primitives (MediaGenerationModel, MediaGenerationResult, MediaGenerationModelResult, and MediaGenerationModelOptions)
  • extended Provider with media factory support and added ProviderCaps.mediaGeneration
  • added ModelKind.media for 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
1
likes
160
points
1.41k
downloads

Publisher

verified publishersellsbrothers.com

Weekly Downloads

Interface definitions for dartantic_ai for use in building custom providers.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

genai_primitives, json_schema_builder, logging, meta, mime, uuid

More

Packages that depend on dartantic_interface