ai_sdk_provider 1.2.0
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
AiSdkErrorhierarchy now lives here (relocated fromai_sdk_dart) so that every provider package — which depends onai_sdk_provider, notai_sdk_dart— can throw the same typed errors.ai_sdk_dartre-exports the hierarchy, so its public surface is unchanged. AiApiCallErroris enriched withstatusCode,url,responseBody,responseHeaders,type,code,isRetryable, andcause, plus anAiApiCallError.fromResponse(...)factory that tolerantly parses each provider's error-body shape (OpenAI/Groq/Mistral, Anthropic, Google, Cohere, Ollama). The original positional-message constructor staysconstand backward-compatible.
Removed #
VideoModelV1and itsVideoModelV1CallOptions/VideoModelV1GenerateResulttypes. No provider ever implemented video generation, so the interface was dead surface area. The matchinggenerateVideoentry point was removed fromai_sdk_dartin the same release.
1.1.0 #
LanguageModelV3CallOptions.outputSchema— new optionalMap<String, dynamic>?field. When non-null, providers that support native structured output (e.g. OpenAIresponse_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.mdwith usage examples and links to runnable apps.
1.0.0 #
First stable release. Defines the provider interface contract for all AI SDK Dart providers.
LanguageModelV3—doGenerate/doStreaminterface.EmbeddingModelV2<VALUE>—doEmbedinterface.ImageModelV3—doGenerateinterface.SpeechModelV1—doGenerateinterface.TranscriptionModelV1—doGenerateinterface.RerankModelV1—doRerankinterface.- Full
LanguageModelV3StreamPartsealed class hierarchy (text, tool call, reasoning, source, file, finish, error parts). LanguageModelV3CallOptionswith all v6 call-time options.LanguageModelV3GenerateResultandLanguageModelV3StreamResult.- Shared types:
JsonValue,ProviderMetadata, content parts, finish reasons, tool definitions, usage.
0.2.0 #
- Initial release.
LanguageModelV3interface withdoGenerate/doStream.EmbeddingModelV2<VALUE>interface withdoEmbed.ImageModelV3interface withdoGenerate.SpeechModelV1interface withdoGenerate.TranscriptionModelV1interface withdoGenerate.RerankModelV1interface withdoRerank.- Full
LanguageModelV3StreamPartsealed class hierarchy. LanguageModelV3CallOptionswith all v6 call-time options.LanguageModelV3GenerateResultandLanguageModelV3StreamResult.- Shared types:
JsonValue,ProviderMetadata, content parts, finish reasons, tool definitions.