ai_sdk_provider 1.2.0 copy "ai_sdk_provider: ^1.2.0" to clipboard
ai_sdk_provider: ^1.2.0 copied to clipboard

Provider interface specification for the AI SDK Dart port. Defines the LanguageModelV3, EmbeddingModelV2, and ImageModelV3 interfaces that all provider packages must implement.

1.2.0 #

Error hierarchy #

  • The full AiSdkError hierarchy now lives here (relocated from ai_sdk_dart) so that every provider package — which depends on ai_sdk_provider, not ai_sdk_dart — can throw the same typed errors. ai_sdk_dart re-exports the hierarchy, so its public surface is unchanged.
  • AiApiCallError is enriched with statusCode, url, responseBody, responseHeaders, type, code, isRetryable, and cause, plus an AiApiCallError.fromResponse(...) factory that tolerantly parses each provider's error-body shape (OpenAI/Groq/Mistral, Anthropic, Google, Cohere, Ollama). The original positional-message constructor stays const and backward-compatible.

Removed #

  • VideoModelV1 and its VideoModelV1CallOptions / VideoModelV1GenerateResult types. No provider ever implemented video generation, so the interface was dead surface area. The matching generateVideo entry point was removed from ai_sdk_dart in the same release.

1.1.0 #

  • LanguageModelV3CallOptions.outputSchema — new optional Map<String, dynamic>? field. When non-null, providers that support native structured output (e.g. OpenAI response_format: json_schema) should use it to request schema-validated responses directly from the model API.

1.0.0+1 #

  • Improved pubspec descriptions for better pub.dev discoverability.
  • Added example/example.md with usage examples and links to runnable apps.

1.0.0 #

First stable release. Defines the provider interface contract for all AI SDK Dart providers.

  • LanguageModelV3doGenerate / doStream interface.
  • EmbeddingModelV2<VALUE>doEmbed interface.
  • ImageModelV3doGenerate interface.
  • SpeechModelV1doGenerate interface.
  • TranscriptionModelV1doGenerate interface.
  • RerankModelV1doRerank interface.
  • Full LanguageModelV3StreamPart sealed class hierarchy (text, tool call, reasoning, source, file, finish, error parts).
  • LanguageModelV3CallOptions with all v6 call-time options.
  • LanguageModelV3GenerateResult and LanguageModelV3StreamResult.
  • Shared types: JsonValue, ProviderMetadata, content parts, finish reasons, tool definitions, usage.

0.2.0 #

  • Initial release.
  • LanguageModelV3 interface with doGenerate / doStream.
  • EmbeddingModelV2<VALUE> interface with doEmbed.
  • ImageModelV3 interface with doGenerate.
  • SpeechModelV1 interface with doGenerate.
  • TranscriptionModelV1 interface with doGenerate.
  • RerankModelV1 interface with doRerank.
  • Full LanguageModelV3StreamPart sealed class hierarchy.
  • LanguageModelV3CallOptions with all v6 call-time options.
  • LanguageModelV3GenerateResult and LanguageModelV3StreamResult.
  • Shared types: JsonValue, ProviderMetadata, content parts, finish reasons, tool definitions.
0
likes
160
points
243
downloads

Documentation

API reference

Publisher

verified publisherhashstudios.dev

Weekly Downloads

Provider interface specification for the AI SDK Dart port. Defines the LanguageModelV3, EmbeddingModelV2, and ImageModelV3 interfaces that all provider packages must implement.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

meta

More

Packages that depend on ai_sdk_provider